feat: implement global autoresponder plugin

This commit is contained in:
Marek Miklewicz
2026-06-02 19:19:00 +02:00
commit 6f989af278
62 changed files with 2018 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
<?php
declare(strict_types=1);
require_once PLUGIN_ROOT . '/exec/lib/Lang.php';
require_once PLUGIN_ROOT . '/exec/lib/Settings.php';
test('language falls back to default language then English', function (): void {
$settingsPath = TEST_TMP . '/lang-settings.conf';
test_write($settingsPath, "DEFAULT_PLUGIN_LANGUAGE=pl\n");
$settings = Settings::load($settingsPath);
$lang = Lang::load('de', $settings);
assert_same('pl', $lang->code());
assert_same('Globalne autorespondery', $lang->t('Global autoresponders'));
test_write($settingsPath, "DEFAULT_PLUGIN_LANGUAGE=de\n");
$settings = Settings::load($settingsPath);
$lang = Lang::load('fr', $settings);
assert_same('en', $lang->code());
});