├── tests ├── Fixtures │ └── app │ │ └── .gitignore ├── ClearCachePhpunitExtension.php ├── LanguageTest.php ├── PageFinder │ └── AssociatedForLanguageTest.php └── ContaoTestCase.php ├── phpstan.neon ├── .gitignore ├── .github ├── FUNDING.yml └── workflows │ └── ci.yml ├── public ├── language-warning.png ├── .htaccess └── backend.css ├── contao ├── templates │ ├── block_alternate_links.html5 │ ├── mod_changelanguage.html5 │ └── nav_dropdown.html5 ├── config │ └── config.php ├── dca │ ├── tl_user.php │ ├── tl_page.php │ └── tl_module.php └── languages │ ├── en │ ├── tl_faq.xlf │ ├── tl_calendar_events.xlf │ ├── tl_article.xlf │ ├── tl_user.xlf │ ├── modules.xlf │ ├── tl_news.xlf │ ├── default.xlf │ ├── tl_calendar.xlf │ ├── tl_news_archive.xlf │ ├── tl_faq_category.xlf │ ├── tl_page.xlf │ └── tl_module.xlf │ ├── ja │ ├── tl_faq.xlf │ ├── tl_calendar_events.xlf │ ├── tl_article.xlf │ ├── tl_user.xlf │ ├── modules.xlf │ ├── tl_news.xlf │ ├── default.xlf │ ├── tl_page.xlf │ ├── tl_calendar.xlf │ ├── tl_faq_category.xlf │ ├── tl_module.xlf │ └── tl_news_archive.xlf │ ├── cs │ ├── tl_faq.xlf │ ├── tl_user.xlf │ ├── tl_calendar_events.xlf │ ├── tl_article.xlf │ ├── modules.xlf │ ├── tl_news.xlf │ ├── default.xlf │ ├── tl_calendar.xlf │ ├── tl_news_archive.xlf │ ├── tl_module.xlf │ ├── tl_faq_category.xlf │ └── tl_page.xlf │ ├── ru │ ├── tl_faq.xlf │ ├── tl_calendar_events.xlf │ ├── tl_article.xlf │ ├── tl_user.xlf │ ├── modules.xlf │ ├── tl_news.xlf │ ├── default.xlf │ ├── tl_calendar.xlf │ ├── tl_news_archive.xlf │ └── tl_page.xlf │ ├── de │ ├── tl_faq.xlf │ ├── tl_user.xlf │ ├── tl_calendar_events.xlf │ ├── tl_article.xlf │ ├── modules.xlf │ ├── tl_news.xlf │ ├── default.xlf │ ├── tl_calendar.xlf │ ├── tl_news_archive.xlf │ ├── tl_page.xlf │ └── tl_faq_category.xlf │ ├── pl │ ├── tl_faq.xlf │ ├── tl_user.xlf │ ├── tl_calendar_events.xlf │ ├── tl_article.xlf │ ├── modules.xlf │ ├── tl_news.xlf │ ├── default.xlf │ ├── tl_calendar.xlf │ ├── tl_news_archive.xlf │ ├── tl_faq_category.xlf │ ├── tl_module.xlf │ └── tl_page.xlf │ ├── pt │ ├── tl_faq.xlf │ ├── tl_user.xlf │ ├── tl_calendar_events.xlf │ ├── tl_article.xlf │ ├── modules.xlf │ ├── tl_news.xlf │ ├── default.xlf │ ├── tl_calendar.xlf │ └── tl_module.xlf │ ├── fr │ ├── tl_faq.xlf │ ├── tl_user.xlf │ ├── tl_calendar_events.xlf │ ├── modules.xlf │ ├── tl_article.xlf │ ├── tl_news.xlf │ ├── default.xlf │ ├── tl_calendar.xlf │ ├── tl_news_archive.xlf │ └── tl_faq_category.xlf │ └── lv │ ├── tl_faq.xlf │ ├── tl_user.xlf │ ├── tl_calendar_events.xlf │ ├── tl_article.xlf │ ├── modules.xlf │ ├── tl_news.xlf │ ├── default.xlf │ ├── tl_calendar.xlf │ ├── tl_news_archive.xlf │ ├── tl_faq_category.xlf │ ├── tl_page.xlf │ └── tl_module.xlf ├── ecs.php ├── src ├── Terminal42ChangeLanguageBundle.php ├── EventListener │ ├── Navigation │ │ ├── NavigationHandlerInterface.php │ │ ├── FaqNavigationListener.php │ │ ├── CalendarNavigationListener.php │ │ └── NewsNavigationListener.php │ ├── AbstractTableListener.php │ ├── DataContainer │ │ ├── UserLabelsListener.php │ │ ├── FaqListener.php │ │ ├── CalendarEventsListener.php │ │ ├── LanguageMainTrait.php │ │ └── NewsListener.php │ ├── InsertTagsListener.php │ └── BackendView │ │ └── PageViewListener.php ├── ContaoManager │ └── Plugin.php ├── Event │ └── ChangelanguageNavigationEvent.php ├── Language.php ├── DependencyInjection │ └── Terminal42ChangeLanguageExtension.php ├── Helper │ └── LabelCallback.php └── Migration │ └── CustomLanguageTextMigration.php ├── .editorconfig ├── README.md ├── config └── services.yaml ├── composer-dependency-analyser.php ├── phpunit.xml.dist └── .tx └── config /tests/Fixtures/app/.gitignore: -------------------------------------------------------------------------------- 1 | /var 2 | -------------------------------------------------------------------------------- /phpstan.neon: -------------------------------------------------------------------------------- 1 | parameters: 2 | ignoreErrors: 3 | - '#Parameter \#2 \$models#' 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /tools/*/vendor 2 | /vendor/ 3 | /composer.lock 4 | /phpunit.xml 5 | /.phpunit.result.cache 6 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: terminal42 4 | ko_fi: terminal42 5 | -------------------------------------------------------------------------------- /public/language-warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terminal42/contao-changelanguage/HEAD/public/language-warning.png -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | Order allow,deny 3 | Allow from all 4 | 5 | 6 | Require all granted 7 | -------------------------------------------------------------------------------- /contao/templates/block_alternate_links.html5: -------------------------------------------------------------------------------- 1 | links as $link): ?> 2 | 3 | -------------------------------------------------------------------------------- /contao/config/config.php: -------------------------------------------------------------------------------- 1 | skip([NoSuperfluousPhpdocTagsFixer::class]); 10 | }; 11 | -------------------------------------------------------------------------------- /src/Terminal42ChangeLanguageBundle.php: -------------------------------------------------------------------------------- 1 | 3 | 12 | -------------------------------------------------------------------------------- /src/EventListener/Navigation/NavigationHandlerInterface.php: -------------------------------------------------------------------------------- 1 | addLegend('changelanguage_legend', '', PaletteManipulator::POSITION_APPEND) 7 | ->addField('pageLanguageLabels', 'changelanguage_legend') 8 | ->applyToPalette('login', 'tl_user') 9 | ; 10 | 11 | $GLOBALS['TL_DCA']['tl_user']['fields']['pageLanguageLabels'] = [ 12 | 'exclude' => true, 13 | 'inputType' => 'checkbox', 14 | 'eval' => ['multiple' => true, 'tl_class' => 'w50'], 15 | 'sql' => 'text NULL', 16 | ]; 17 | -------------------------------------------------------------------------------- /tests/ClearCachePhpunitExtension.php: -------------------------------------------------------------------------------- 1 | remove([ 16 | __DIR__.'/../var', 17 | ]); 18 | } 19 | 20 | public function executeAfterLastTest(): void 21 | { 22 | $this->executeBeforeFirstTest(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/EventListener/AbstractTableListener.php: -------------------------------------------------------------------------------- 1 | table = $table; 14 | } 15 | 16 | /** 17 | * Register necessary callbacks for this listener. 18 | */ 19 | abstract public function register(): void; 20 | 21 | /** 22 | * Gets the table name for this listener. 23 | */ 24 | protected function getTable(): string 25 | { 26 | return $this->table; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /contao/languages/en/tl_faq.xlf: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | Master question 11 | 12 | 13 | Choose the question in the master category equaling this question. 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/EventListener/DataContainer/UserLabelsListener.php: -------------------------------------------------------------------------------- 1 | connection = $connection; 20 | } 21 | 22 | /** 23 | * @return array 24 | */ 25 | public function __invoke(): array 26 | { 27 | return $this->connection->fetchAllKeyValue("SELECT id, title FROM tl_page WHERE type='root' AND (fallback='' OR languageRoot!=0) ORDER BY pid, sorting"); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ChangeLanguage v3 2 | 3 | 4 | *ChangeLanguage* is an extension for the [Contao CMS][1] 5 | which allows visitors to switch between different languages of your website. 6 | 7 | Contao itself provides multilingual support by default, you can create unlimited 8 | number of page trees in different languages on either the same or different 9 | domains. *ChangeLanguage* simply adds the functionality to link pages 10 | together and present the website visitor with a list of available languages. 11 | 12 | 13 | [Full Documentation](https://extensions.terminal42.ch/docs/changelanguage/) 14 | 15 | If your workflow consists of creating a page in one language and then 16 | duplicating it for translation, take a look at the [i18n-duplication][2] 17 | extension. 18 | 19 | 20 | [1]: https://contao.org 21 | [2]: https://extensions.contao.org/?p=christianbargon/contao-i18n-duplication 22 | -------------------------------------------------------------------------------- /contao/languages/en/tl_calendar_events.xlf: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | Master event 11 | 12 | 13 | Choose the event in the master calendar equaling this event. 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /contao/languages/ja/tl_faq.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master question 6 | マスターの質問 7 | 8 | 9 | Choose the question in the master category equaling this question. 10 | この質問と同等な質問をマスターのカテゴリから選択してください。 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /contao/languages/cs/tl_faq.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master question 6 | Hlavní otázka 7 | 8 | 9 | Choose the question in the master category equaling this question. 10 | Vyberte otázku v hlavní kategorii odpovídající této otázce. 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /contao/languages/ru/tl_faq.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master question 6 | Основной вопрос 7 | 8 | 9 | Choose the question in the master category equaling this question. 10 | Выберите вопрос в основной категории, равный этому вопросу. 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /contao/languages/de/tl_faq.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master question 6 | Haupt-Frage 7 | 8 | 9 | Choose the question in the master category equaling this question. 10 | Bitte wählen Sie die Frage im Hauptarchive welcher dieser entspricht. 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /contao/languages/pl/tl_faq.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master question 6 | Główne pytanie 7 | 8 | 9 | Choose the question in the master category equaling this question. 10 | Wybierz pytanie w głównej kategorii, które odpowiada temu pytaniu. 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /contao/languages/ja/tl_calendar_events.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master event 6 | マスターのイベント 7 | 8 | 9 | Choose the event in the master calendar equaling this event. 10 | このイベントと同等なイベントをマスターのカレンダーから選択してください。 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /contao/languages/pt/tl_faq.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master question 6 | Pergunta principal 7 | 8 | 9 | Choose the question in the master category equaling this question. 10 | Escolher a pergunta na categoria principal, igualando esta pergunta. 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /contao/languages/fr/tl_faq.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master question 6 | Question de base 7 | 8 | 9 | Choose the question in the master category equaling this question. 10 | Merci de sélectionner la question de base qui correspond à cette question. 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /contao/languages/lv/tl_faq.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master question 6 | Galvenais jautājums 7 | 8 | 9 | Choose the question in the master category equaling this question. 10 | Izvēlieties notikumu galvenajā kategorijā, kas atbilst šim jautājumam. 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /config/services.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | _defaults: 3 | autoconfigure: true 4 | autowire: true 5 | 6 | Terminal42\ChangeLanguage\EventListener\: 7 | resource: ../src/EventListener/* 8 | exclude: ../src/EventListener/{BackendView,DataContainer}/* 9 | public: true 10 | 11 | Terminal42\ChangeLanguage\EventListener\DataContainer\MissingLanguageIconListener: ~ 12 | Terminal42\ChangeLanguage\EventListener\DataContainer\PageFieldsListener: ~ 13 | Terminal42\ChangeLanguage\EventListener\DataContainer\PageInitializationListener: ~ 14 | Terminal42\ChangeLanguage\EventListener\DataContainer\PageOperationListener: ~ 15 | Terminal42\ChangeLanguage\EventListener\DataContainer\UserLabelsListener: ~ 16 | 17 | Terminal42\ChangeLanguage\EventListener\CallbackSetupListener: 18 | 19 | Terminal42\ChangeLanguage\Migration\: 20 | resource: ../src/Migration/* 21 | 22 | Terminal42\ChangeLanguage\PageFinder: ~ 23 | -------------------------------------------------------------------------------- /composer-dependency-analyser.php: -------------------------------------------------------------------------------- 1 | ignoreErrorsOnPackage('contao/calendar-bundle', [ErrorType::DEV_DEPENDENCY_IN_PROD]) 9 | ->ignoreErrorsOnPackage('contao/faq-bundle', [ErrorType::DEV_DEPENDENCY_IN_PROD]) 10 | ->ignoreErrorsOnPackage('contao/news-bundle', [ErrorType::DEV_DEPENDENCY_IN_PROD]) 11 | 12 | // Ignore test setup 13 | ->addPathToExclude(__DIR__ . '/tests/Fixtures') 14 | ->addPathToExclude(__DIR__ . '/tests/ClearCachePhpunitExtension.php') 15 | ->ignoreErrorsOnPackage('symfony/monolog-bundle', [ErrorType::UNUSED_DEPENDENCY]) 16 | ->ignoreErrorsOnPackage('symfony/phpunit-bridge', [ErrorType::UNUSED_DEPENDENCY]) 17 | ->ignoreErrorsOnPackage('terminal42/service-annotation-bundle', [ErrorType::UNUSED_DEPENDENCY]) 18 | ; 19 | -------------------------------------------------------------------------------- /contao/languages/cs/tl_user.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Fallback page titles 6 | 7 | 8 | Select the root pages for which pages you want to show the fallback page title. 9 | 10 | 11 | ChangeLanguage 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /contao/languages/de/tl_user.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Fallback page titles 6 | 7 | 8 | Select the root pages for which pages you want to show the fallback page title. 9 | 10 | 11 | ChangeLanguage 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /contao/languages/fr/tl_user.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Fallback page titles 6 | 7 | 8 | Select the root pages for which pages you want to show the fallback page title. 9 | 10 | 11 | ChangeLanguage 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /contao/languages/lv/tl_user.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Fallback page titles 6 | 7 | 8 | Select the root pages for which pages you want to show the fallback page title. 9 | 10 | 11 | ChangeLanguage 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /contao/languages/pl/tl_user.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Fallback page titles 6 | 7 | 8 | Select the root pages for which pages you want to show the fallback page title. 9 | 10 | 11 | ChangeLanguage 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /contao/languages/pt/tl_user.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Fallback page titles 6 | 7 | 8 | Select the root pages for which pages you want to show the fallback page title. 9 | 10 | 11 | ChangeLanguage 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /contao/languages/ru/tl_calendar_events.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master event 6 | Основное событие 7 | 8 | 9 | Choose the event in the master calendar equaling this event. 10 | Выберите событие в основном календаре равное этому событию. 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /contao/languages/cs/tl_calendar_events.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master event 6 | Hlavní událost 7 | 8 | 9 | Choose the event in the master calendar equaling this event. 10 | Vyberte událost v hlavním kalendáři, která se rovná této události. 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /contao/languages/de/tl_calendar_events.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master event 6 | Haupt-Event 7 | 8 | 9 | Choose the event in the master calendar equaling this event. 10 | Bitte wählen Sie den Event im Hauptkalender welcher diesem entspricht. 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /contao/languages/pt/tl_calendar_events.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master event 6 | Evento principal 7 | 8 | 9 | Choose the event in the master calendar equaling this event. 10 | Escolher o evento no calendário principal igualando este evento. 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/EventListener/DataContainer/FaqListener.php: -------------------------------------------------------------------------------- 1 | $models 25 | * 26 | * @return array 27 | */ 28 | protected function formatOptions(Model $current, Collection $models): array 29 | { 30 | $options = []; 31 | 32 | foreach ($models as $model) { 33 | $options[$model->id] = \sprintf('%s [ID %s]', $model->question, $model->id); 34 | } 35 | 36 | return $options; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /contao/languages/lv/tl_calendar_events.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master event 6 | Galvenais notikums 7 | 8 | 9 | Choose the event in the master calendar equaling this event. 10 | Izvēlieties notikumu galvenajā kalendārā, kas atbilst šim notikumam. 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /contao/languages/fr/tl_calendar_events.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master event 6 | Evénement de base 7 | 8 | 9 | Choose the event in the master calendar equaling this event. 10 | Merci de sélectionner l'événement de base qui correspond à cet événement. 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /contao/languages/pl/tl_calendar_events.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master event 6 | Główne wydarzenie 7 | 8 | 9 | Choose the event in the master calendar equaling this event. 10 | Wybierz wydarzenie w kalendarzu głównym, które odpowiada temu wydarzeniu. 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /contao/languages/en/tl_article.xlf: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | Fallback article 11 | 12 | 13 | Choose the article in the language marked as fallback equals this article. 14 | 15 | 16 | No equal article 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /contao/languages/en/tl_user.xlf: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | Fallback page titles 11 | 12 | 13 | Select the root pages for which pages you want to show the fallback page title. 14 | 15 | 16 | ChangeLanguage 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/EventListener/DataContainer/CalendarEventsListener.php: -------------------------------------------------------------------------------- 1 | 25 | */ 26 | protected function formatOptions(Model $current, Collection $models): array 27 | { 28 | $options = []; 29 | 30 | foreach ($models as $model) { 31 | $options[$model->id] = \sprintf( 32 | '%s [%s]', 33 | $model->title, 34 | Date::parse($GLOBALS['TL_CONFIG']['datimFormat'], $model->startTime), 35 | ); 36 | } 37 | 38 | return $options; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /contao/languages/en/modules.xlf: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | Change Language 11 | This is only used to translate the "inactive modules" in the backend. 12 | 13 | 14 | Change Language 15 | 16 | 17 | This module allows you to switch between different language versions of a page. 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /contao/languages/en/tl_news.xlf: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | Master article 11 | 12 | 13 | Choose the article in the master archive equaling this article. 14 | 15 | 16 | Same day 17 | 18 | 19 | Other days 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | ./tests 14 | ./tests/Fixtures 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /contao/languages/ja/tl_article.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Fallback article 6 | 代替のアーティクル 7 | 8 | 9 | Choose the article in the language marked as fallback equals this article. 10 | この言語のアーティクルと同等な、代替とするアーティクルを選択してください。 11 | 12 | 13 | No equal article 14 | 同等なアーティクルなし 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/ContaoManager/Plugin.php: -------------------------------------------------------------------------------- 1 | setReplace(['changelanguage']) 23 | ->setLoadAfter([ 24 | ContaoCoreBundle::class, 25 | ContaoNewsBundle::class, 26 | ContaoCalendarBundle::class, 27 | ContaoFaqBundle::class, 28 | ]), 29 | ]; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /contao/languages/ja/tl_user.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Fallback page titles 6 | Facebookページの題名 7 | 8 | 9 | Select the root pages for which pages you want to show the fallback page title. 10 | Facebookのページの題名を表示したいページのルートのページを選択します。 11 | 12 | 13 | ChangeLanguage 14 | 言語の変更 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /contao/languages/pl/tl_article.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Fallback article 6 | Artykuł domyślny 7 | 8 | 9 | Choose the article in the language marked as fallback equals this article. 10 | Wybierz artykuł w języku głównym, który odpowiada temu artykułowi. 11 | 12 | 13 | No equal article 14 | Brak artykułu 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /contao/languages/cs/tl_article.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Fallback article 6 | Záložní článek 7 | 8 | 9 | Choose the article in the language marked as fallback equals this article. 10 | Vyberte článek v záložním jazyce, který se rovná tomuto článku. 11 | 12 | 13 | No equal article 14 | Žádný záložní článek 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /contao/languages/lv/tl_article.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Fallback article 6 | Atkāpšanās raksts 7 | 8 | 9 | Choose the article in the language marked as fallback equals this article. 10 | Izvēlieties rakstu atkāpšanās valodā, kas atbilst šim rakstam. 11 | 12 | 13 | No equal article 14 | Nav vienādu rakstu 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /contao/languages/pt/tl_article.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Fallback article 6 | Artigo em queda 7 | 8 | 9 | Choose the article in the language marked as fallback equals this article. 10 | Escolher o artigo na língua marcada como fallback é igual a esta página. 11 | 12 | 13 | No equal article 14 | Nenhum artigo igual 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /contao/languages/ru/tl_article.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Fallback article 6 | Резервная статья 7 | 8 | 9 | Choose the article in the language marked as fallback equals this article. 10 | Выберите статью, на языке отмеченным как резервный, равную этой статье. 11 | 12 | 13 | No equal article 14 | Нет равных статей 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /contao/languages/ja/modules.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Change Language 6 | 言語の変更 7 | This is only used to translate the "inactive modules" in the backend. 8 | 9 | 10 | Change Language 11 | 言語の変更 12 | 13 | 14 | This module allows you to switch between different language versions of a page. 15 | このモジュールで異なる言語のページに切り替えができます。 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /contao/languages/ru/tl_user.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Fallback page titles 6 | Заголовки резервных страниц 7 | 8 | 9 | Select the root pages for which pages you want to show the fallback page title. 10 | Выберите корневые страницы, для которых необходимо отображать заголовок резервной страницы. 11 | 12 | 13 | ChangeLanguage 14 | Изменить язык 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/EventListener/DataContainer/LanguageMainTrait.php: -------------------------------------------------------------------------------- 1 | getTable()]['fields']['languageMain'] = [ 14 | 'label' => &$GLOBALS['TL_LANG'][$this->getTable()]['languageMain'], 15 | 'exclude' => true, 16 | 'inputType' => 'select', 17 | 'options_callback' => fn (DataContainer $dc) => $this->onLanguageMainOptions($dc), 18 | 'eval' => [ 19 | 'includeBlankOption' => true, 20 | 'blankOptionLabel' => &$GLOBALS['TL_LANG'][$this->getTable()]['languageMain'][2], 21 | 'chosen' => true, 22 | 'tl_class' => 'w50', 23 | ], 24 | 'sql' => "int(10) unsigned NOT NULL default '0'", 25 | 'relation' => ['type' => 'hasOne', 'table' => $this->getTable()], 26 | ]; 27 | } 28 | 29 | abstract protected function onLanguageMainOptions(DataContainer $dc); 30 | 31 | abstract protected function getTable(); 32 | } 33 | -------------------------------------------------------------------------------- /contao/languages/ja/tl_news.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master article 6 | マスターのアーティクル 7 | 8 | 9 | Choose the article in the master archive equaling this article. 10 | このアーティクルと同等なアーティクルをマスターのアーカイブから選択してください。 11 | 12 | 13 | Same day 14 | 同じ日 15 | 16 | 17 | Other days 18 | 他の日 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /contao/languages/cs/modules.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Change Language 6 | Změnit jazyk 7 | This is only used to translate the "inactive modules" in the backend. 8 | 9 | 10 | Change Language 11 | Změnit jazyk 12 | 13 | 14 | This module allows you to switch between different language versions of a page. 15 | Tento modul umožňuje přepínat mezi různými jazykovými verzemi stránky. 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /contao/languages/lv/modules.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Change Language 6 | Mainīt valodu 7 | This is only used to translate the "inactive modules" in the backend. 8 | 9 | 10 | Change Language 11 | Mainīt valodu 12 | 13 | 14 | This module allows you to switch between different language versions of a page. 15 | Šis modulis ļauj pārslēgties starp dažādām lapas valodas versijām. 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /contao/languages/pl/modules.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Change Language 6 | Zmiana języka 7 | This is only used to translate the "inactive modules" in the backend. 8 | 9 | 10 | Change Language 11 | Zmiana języka 12 | 13 | 14 | This module allows you to switch between different language versions of a page. 15 | Moduł umożliwia przełączanie między różnymi wersjami językowymi strony. 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /contao/languages/de/tl_article.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Fallback article 6 | Fallback-Artikel 7 | 8 | 9 | Choose the article in the language marked as fallback equals this article. 10 | Wählen Sie den Artikel in der Fallback-Sprache aus, welcher diesem hier entspricht. So ist es für den Sprachenwechsler möglich, einen Artikel direkt zu verlinken. 11 | 12 | 13 | No equal article 14 | Kein passender Artikel 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /contao/languages/ru/modules.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Change Language 6 | Изменить язык 7 | This is only used to translate the "inactive modules" in the backend. 8 | 9 | 10 | Change Language 11 | Изменить язык 12 | 13 | 14 | This module allows you to switch between different language versions of a page. 15 | Этот модуль позволяет переключаться между версиями страницы на разных языках. 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /contao/languages/de/modules.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Change Language 6 | Sprachenwechsler 7 | This is only used to translate the "inactive modules" in the backend. 8 | 9 | 10 | Change Language 11 | Sprachenwechsler 12 | 13 | 14 | This module allows you to switch between different language versions of a page. 15 | Mit diesem Modul könen Sie zwischen mehreren Sprachversionen einer Seite wechseln. 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /contao/languages/fr/modules.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Change Language 6 | Changer la langue 7 | This is only used to translate the "inactive modules" in the backend. 8 | 9 | 10 | Change Language 11 | Changer la langue 12 | 13 | 14 | This module allows you to switch between different language versions of a page. 15 | Ce module vous permet de basculer d'une langue à l'autre pour une page donnée. 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /contao/dca/tl_page.php: -------------------------------------------------------------------------------- 1 | &$GLOBALS['TL_LANG']['tl_page']['languageMain'], 9 | 'exclude' => true, 10 | 'inputType' => 'pageTree', 11 | 'eval' => ['fieldType' => 'radio', 'multiple' => false, 'rootNodes' => [0], 'tl_class' => 'w50 clr'], 12 | 'sql' => "int(10) unsigned NOT NULL default '0'", 13 | ]; 14 | 15 | $GLOBALS['TL_DCA']['tl_page']['fields']['languageRoot'] = [ 16 | 'label' => &$GLOBALS['TL_LANG']['tl_page']['languageRoot'], 17 | 'exclude' => true, 18 | 'inputType' => 'select', 19 | 'eval' => ['includeBlankOption' => true, 'blankOptionLabel' => &$GLOBALS['TL_LANG']['tl_page']['languageRoot'][2], 'tl_class' => 'w50'], 20 | 'sql' => "int(10) unsigned NOT NULL default '0'", 21 | ]; 22 | 23 | $GLOBALS['TL_DCA']['tl_page']['fields']['languageQuery'] = [ 24 | 'label' => &$GLOBALS['TL_LANG']['tl_page']['languageQuery'], 25 | 'exclude' => true, 26 | 'inputType' => 'text', 27 | 'eval' => ['tl_class' => 'w50'], 28 | 'sql' => "varchar(255) NOT NULL default ''", 29 | ]; 30 | -------------------------------------------------------------------------------- /contao/languages/cs/tl_news.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master article 6 | Hlavní článek 7 | 8 | 9 | Choose the article in the master archive equaling this article. 10 | Vyberte hlavní článek, který se rovná tomuto článku. 11 | 12 | 13 | Same day 14 | Stejný den 15 | 16 | 17 | Other days 18 | Ostatní dny 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /contao/languages/pt/modules.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Change Language 6 | Alterar Idioma 7 | This is only used to translate the "inactive modules" in the backend. 8 | 9 | 10 | Change Language 11 | Alterar Idioma 12 | 13 | 14 | This module allows you to switch between different language versions of a page. 15 | Este módulo permite-lhe alternar entre as diferentes versões linguísticas de uma página. 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /contao/languages/ru/tl_news.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master article 6 | Основная статья 7 | 8 | 9 | Choose the article in the master archive equaling this article. 10 | Выберите статью в основном архиве, равную этой статье. 11 | 12 | 13 | Same day 14 | Тот же день 15 | 16 | 17 | Other days 18 | Другие дни 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /contao/languages/pt/tl_news.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master article 6 | Artigo principal 7 | 8 | 9 | Choose the article in the master archive equaling this article. 10 | Escolher o artigo no arquivo principal igualando este artigo. 11 | 12 | 13 | Same day 14 | Mesmo dia 15 | 16 | 17 | Other days 18 | Outros dias 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /contao/languages/fr/tl_article.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Fallback article 6 | Article dans la langue de base 7 | 8 | 9 | Choose the article in the language marked as fallback equals this article. 10 | Choisissez l'article dans la langue de base qui correspondra à cet article. Il sera ainsi possible de lier directement un article à un autre lors d'un changement de langue. 11 | 12 | 13 | No equal article 14 | Pas d'article correspondant 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /contao/languages/pl/tl_news.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master article 6 | Główny artykuł 7 | 8 | 9 | Choose the article in the master archive equaling this article. 10 | Wybierz artykuł w głównym archiwum, który odpowiada temu artykułowi. 11 | 12 | 13 | Same day 14 | Ten sam dzień 15 | 16 | 17 | Other days 18 | Inne dni 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /contao/languages/lv/tl_news.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master article 6 | Galvenais raksts 7 | 8 | 9 | Choose the article in the master archive equaling this article. 10 | Izvēlieties rakstu galvenajā arhīvā, kas atbilst šim rakstam. 11 | 12 | 13 | Same day 14 | Tajā pašā dienā 15 | 16 | 17 | Other days 18 | Citas dienas 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /contao/languages/de/tl_news.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master article 6 | Hauptbeitrag 7 | 8 | 9 | Choose the article in the master archive equaling this article. 10 | Bitte wählen Sie den Beitrag im Hauptarchive welcher diesem entspricht. 11 | 12 | 13 | Same day 14 | Am selben Tag 15 | 16 | 17 | Other days 18 | An anderen Tagen 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /contao/languages/en/default.xlf: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | The selected page is already assigned to "%s" in the main language. 11 | 12 | 13 | Main language missing 14 | 15 | 16 | Language 17 | 18 | 19 | Switch to 20 | 21 | 22 | Switch to %s 23 | 24 | 25 | Go to current page in %s 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /contao/languages/fr/tl_news.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master article 6 | Article de base 7 | 8 | 9 | Choose the article in the master archive equaling this article. 10 | Choisissez l'article dans la langue de base qui correspondra à cet article. Il sera ainsi possible de lier directement un article à un autre lors d'un changement de langue. 11 | 12 | 13 | Same day 14 | Le même jour 15 | 16 | 17 | Other days 18 | A d'autres jours 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /contao/templates/nav_dropdown.html5: -------------------------------------------------------------------------------- 1 | level, 6); 4 | 5 | if ($intLevel < 1) { 6 | $intLevel = 1; 7 | } 8 | 9 | if (1 == $intLevel): 10 | $arrLanguages = Contao\System::getContainer()->get('contao.intl.locales')->getLocales(null, true); 11 | 12 | foreach ($this->items as $item) { 13 | if ($item['isActive'] || str_contains($item['subitems'], 'class="active')) { 14 | $blnHasActive = true; 15 | break; 16 | } 17 | } 18 | ?> 19 | 31 | 32 | -------------------------------------------------------------------------------- /src/Event/ChangelanguageNavigationEvent.php: -------------------------------------------------------------------------------- 1 | navigationItem = $navigationItem; 22 | $this->urlParameterBag = $urlParameters; 23 | } 24 | 25 | /** 26 | * Gets the navigation item for this event. 27 | */ 28 | public function getNavigationItem(): NavigationItem 29 | { 30 | return $this->navigationItem; 31 | } 32 | 33 | /** 34 | * Gets the UrlParameterBag for this navigation item. 35 | */ 36 | public function getUrlParameterBag(): UrlParameterBag 37 | { 38 | return $this->urlParameterBag; 39 | } 40 | 41 | public function skipInNavigation(): void 42 | { 43 | $this->skipped = true; 44 | $this->stopPropagation(); 45 | } 46 | 47 | public function isSkipped(): bool 48 | { 49 | return $this->skipped; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/EventListener/DataContainer/NewsListener.php: -------------------------------------------------------------------------------- 1 | $models 26 | * 27 | * @return array> 28 | */ 29 | protected function formatOptions(Model $current, Collection $models): array 30 | { 31 | $sameDay = $GLOBALS['TL_LANG']['tl_news']['sameDay']; 32 | $otherDay = $GLOBALS['TL_LANG']['tl_news']['otherDay']; 33 | $dayBegin = strtotime('0:00', (int) $current->date); 34 | $options = [$sameDay => [], $otherDay => []]; 35 | 36 | foreach ($models as $model) { 37 | $group = strtotime('0:00', (int) $model->date) === $dayBegin ? $sameDay : $otherDay; 38 | 39 | $options[$group][$model->id] = \sprintf( 40 | '%s [%s]', 41 | $model->headline, 42 | Date::parse($GLOBALS['TL_CONFIG']['datimFormat'], $model->time), 43 | ); 44 | } 45 | 46 | return $options; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /contao/languages/pl/default.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The selected page is already assigned to "%s" in the main language. 6 | 7 | 8 | Main language missing 9 | Brak głównego języka 10 | 11 | 12 | Language 13 | Język 14 | 15 | 16 | Switch to 17 | Zmień na 18 | 19 | 20 | Switch to %s 21 | Zmień na %s 22 | 23 | 24 | Go to current page in %s 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /contao/languages/lv/default.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The selected page is already assigned to "%s" in the main language. 6 | 7 | 8 | Main language missing 9 | Trūkst galvenās valodas 10 | 11 | 12 | Language 13 | Valoda 14 | 15 | 16 | Switch to 17 | Pāriet uz 18 | 19 | 20 | Switch to %s 21 | Pāriet uz %s 22 | 23 | 24 | Go to current page in %s 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/Language.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The selected page is already assigned to "%s" in the main language. 6 | 選択したページは既に主言語の"%s"に割り当てられています。 7 | 8 | 9 | Main language missing 10 | 主言語が不明 11 | 12 | 13 | Language 14 | 言語 15 | 16 | 17 | Switch to 18 | 切り替え 19 | 20 | 21 | Switch to %s 22 | %sに切り替え 23 | 24 | 25 | Go to current page in %s 26 | %sの現在のページに移動 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /contao/languages/cs/default.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The selected page is already assigned to "%s" in the main language. 6 | Vybraná stránka je již přiřazena k "%s" v hlavním jazyce. 7 | 8 | 9 | Main language missing 10 | Chybí hlavní jazyk 11 | 12 | 13 | Language 14 | Jazyk 15 | 16 | 17 | Switch to 18 | Přepnout na 19 | 20 | 21 | Switch to %s 22 | Přepnout na %s 23 | 24 | 25 | Go to current page in %s 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /contao/languages/pt/default.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The selected page is already assigned to "%s" in the main language. 6 | A página seleccionada já está atribuída a "%s" na idioma principal. 7 | 8 | 9 | Main language missing 10 | Falta o idioma principal 11 | 12 | 13 | Language 14 | Idioma 15 | 16 | 17 | Switch to 18 | Mudar para 19 | 20 | 21 | Switch to %s 22 | Mudar para %s 23 | 24 | 25 | Go to current page in %s 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /contao/languages/fr/default.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The selected page is already assigned to "%s" in the main language. 6 | La page sélectionnée est déjà attribuée en "%s" dans la langue principale. 7 | 8 | 9 | Main language missing 10 | Langue principale manquante 11 | 12 | 13 | Language 14 | Langue 15 | 16 | 17 | Switch to 18 | Basculer en 19 | 20 | 21 | Switch to %s 22 | Basculer en %s 23 | 24 | 25 | Go to current page in %s 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/EventListener/InsertTagsListener.php: -------------------------------------------------------------------------------- 1 | parser = $parser; 23 | } 24 | 25 | /** 26 | * Replaces {{changelanguage_*::*}} insert tag. 27 | * 28 | * @return string|false 29 | */ 30 | public function __invoke(string $insertTag) 31 | { 32 | $parts = StringUtil::trimsplit('::', $insertTag); 33 | 34 | if (!str_starts_with($parts[0], 'changelanguage')) { 35 | return false; 36 | } 37 | 38 | try { 39 | $pageFinder = new PageFinder(); 40 | $currentPage = PageModel::findByIdOrAlias($parts[1]); 41 | 42 | if (null === $currentPage) { 43 | return ''; 44 | } 45 | 46 | $targetPage = $pageFinder->findAssociatedForLanguage($currentPage, $parts[2]); 47 | } catch (\RuntimeException $e) { 48 | // parent page of current page not found or not published 49 | return ''; 50 | } 51 | 52 | return $this->parser->replace( 53 | \sprintf( 54 | '{{%s::%s}}', 55 | substr($parts[0], 15), 56 | $targetPage->id, 57 | ), 58 | ); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /contao/languages/ru/default.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The selected page is already assigned to "%s" in the main language. 6 | Выбранная страница уже назначена "%s" в основном языке. 7 | 8 | 9 | Main language missing 10 | Основной язык отсутствует 11 | 12 | 13 | Language 14 | Язык 15 | 16 | 17 | Switch to 18 | Переключить на 19 | 20 | 21 | Switch to %s 22 | Переключить на %s 23 | 24 | 25 | Go to current page in %s 26 | Перейти к текущей странице в %s 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /contao/languages/de/default.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The selected page is already assigned to "%s" in the main language. 6 | Dieser Datensatz ist in der Hauptsprache bereits mit "%s" verknüpft. 7 | 8 | 9 | Main language missing 10 | Hauptsprache fehlt 11 | 12 | 13 | Language 14 | Sprache 15 | 16 | 17 | Switch to 18 | Wechseln zu 19 | 20 | 21 | Switch to %s 22 | Zu %s wechseln 23 | 24 | 25 | Go to current page in %s 26 | Gehe zur aktuellen Seite in %s 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /tests/LanguageTest.php: -------------------------------------------------------------------------------- 1 | assertSame($languageTag, Language::toLanguageTag($localeId)); 18 | } 19 | 20 | /** 21 | * @dataProvider languagesProvider 22 | */ 23 | public function testConvertLanguageTagToLocaleId(string $localeId, string $languageTag): void 24 | { 25 | $this->assertSame($localeId, Language::toLocaleID($languageTag)); 26 | } 27 | 28 | /** 29 | * @dataProvider invalidLanguagesProvider 30 | */ 31 | public function testInvalidLanguage(string $language): void 32 | { 33 | $this->expectException('InvalidArgumentException'); 34 | 35 | Language::normalize($language, '-'); 36 | } 37 | 38 | /** 39 | * @return iterable> 40 | */ 41 | public static function languagesProvider(): iterable 42 | { 43 | yield ['en', 'en']; 44 | yield ['de', 'de']; 45 | yield ['en_US', 'en-US']; 46 | yield ['de_DE', 'de-DE']; 47 | yield ['de_CH', 'de-CH']; 48 | } 49 | 50 | /** 51 | * @return iterable> 52 | */ 53 | public static function invalidLanguagesProvider(): iterable 54 | { 55 | yield ['']; 56 | yield ['-']; 57 | yield ['en-']; 58 | yield ['en_']; 59 | yield ['cn-Hant']; 60 | yield ['cn-Hant-TW']; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /contao/dca/tl_module.php: -------------------------------------------------------------------------------- 1 | &$GLOBALS['TL_LANG']['tl_module']['hideActiveLanguage'], 9 | 'exclude' => true, 10 | 'inputType' => 'checkbox', 11 | 'eval' => ['tl_class' => 'w50'], 12 | 'sql' => "char(1) NOT NULL default ''", 13 | ]; 14 | 15 | $GLOBALS['TL_DCA']['tl_module']['fields']['hideNoFallback'] = [ 16 | 'label' => &$GLOBALS['TL_LANG']['tl_module']['hideNoFallback'], 17 | 'exclude' => true, 18 | 'inputType' => 'checkbox', 19 | 'eval' => ['tl_class' => 'w50'], 20 | 'sql' => "char(1) NOT NULL default ''", 21 | ]; 22 | 23 | $GLOBALS['TL_DCA']['tl_module']['fields']['customLanguage'] = [ 24 | 'label' => &$GLOBALS['TL_LANG']['tl_module']['customLanguage'], 25 | 'exclude' => true, 26 | 'inputType' => 'checkbox', 27 | 'eval' => ['submitOnChange' => true, 'tl_class' => 'clr'], 28 | 'sql' => "char(1) NOT NULL default ''", 29 | ]; 30 | 31 | $GLOBALS['TL_DCA']['tl_module']['fields']['customLanguageText'] = [ 32 | 'label' => &$GLOBALS['TL_LANG']['tl_module']['customLanguageText'], 33 | 'exclude' => true, 34 | 'inputType' => 'keyValueWizard', 35 | 'eval' => ['mandatory' => true, 'allowHtml' => true, 'tl_class' => 'clr'], 36 | 'sql' => 'text NULL', 37 | ]; 38 | -------------------------------------------------------------------------------- /src/DependencyInjection/Terminal42ChangeLanguageExtension.php: -------------------------------------------------------------------------------- 1 | load('services.yaml'); 25 | 26 | $this->removeExtensionListeners($container); 27 | } 28 | 29 | private function removeExtensionListeners(ContainerBuilder $container): void 30 | { 31 | $bundles = $container->getParameter('kernel.bundles'); 32 | $conditions = [ 33 | 'ContaoCalendarBundle' => [CalendarNavigationListener::class], 34 | 'ContaoNewsBundle' => [NewsNavigationListener::class], 35 | 'ContaoFaqBundle' => [FaqNavigationListener::class], 36 | ]; 37 | 38 | foreach ($conditions as $name => $listeners) { 39 | if (!isset($bundles[$name])) { 40 | foreach ($listeners as $listener) { 41 | $container->removeDefinition($listener); 42 | } 43 | } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /contao/languages/en/tl_calendar.xlf: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | Master calendar 11 | 12 | 13 | Please define the master calendar to allow language switching. 14 | 15 | 16 | This master has already been selected for the "%s" calendar! 17 | 18 | 19 | Language 20 | 21 | 22 | Please enter the page language according to the ISO-639-1 standard (e.g. "en" for English or "en-US" for American English). 23 | 24 | 25 | Language settings 26 | 27 | 28 | This is a master calendar 29 | 30 | 31 | Master calendar is "%s" 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /contao/languages/en/tl_news_archive.xlf: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | Master archive 11 | 12 | 13 | Please define the master archive to allow language switching. 14 | 15 | 16 | This master has already been selected for the "%s" archive! 17 | 18 | 19 | Language 20 | 21 | 22 | Please enter the page language according to the ISO-639-1 standard (e.g. "en" for English or "en-US" for American English). 23 | 24 | 25 | Language settings 26 | 27 | 28 | This is a master archive 29 | 30 | 31 | Master archive is "%s" 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /contao/languages/en/tl_faq_category.xlf: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | Master category 11 | 12 | 13 | Please define the master category to allow language switching. 14 | 15 | 16 | This master has already been selected for the "%s" category! 17 | 18 | 19 | Language 20 | 21 | 22 | Please enter the page language according to the ISO-639-1 standard (e.g. "en" for English or "en-US" for American English). 23 | 24 | 25 | Language settings 26 | 27 | 28 | This is a master category 29 | 30 | 31 | Master category is "%s" 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /contao/languages/en/tl_page.xlf: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | Main language page 11 | 12 | 13 | Choose the page in the language marked as fallback equals this page. 14 | 15 | 16 | Foreign-Domain Root Page 17 | 18 | 19 | Select the root page if this page tree is related to another domain. 20 | 21 | 22 | This is a main language root site 23 | 24 | 25 | Keep query parameters 26 | 27 | 28 | Enter a comma separated list of query parameters that should be kept when switching to a translation of this page. 29 | 30 | 31 | Language & Translation 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/EventListener/BackendView/PageViewListener.php: -------------------------------------------------------------------------------- 1 | get('request_stack')->getSession()->getBag('contao_backend')->get('tl_page_node'); 24 | 25 | if ($node < 1) { 26 | return null; 27 | } 28 | 29 | return PageModel::findById($node); 30 | } 31 | 32 | /** 33 | * @return array 34 | */ 35 | protected function getAvailableLanguages(PageModel $page): array 36 | { 37 | $options = []; 38 | 39 | foreach ($this->pageFinder->findAssociatedForPage($page, true, null, false) as $model) { 40 | $model->loadDetails(); 41 | $options[$model->id] = $this->getLanguageLabel($model->language); 42 | } 43 | 44 | return $options; 45 | } 46 | 47 | protected function doSwitchView($id): void 48 | { 49 | $requestStack = System::getContainer()->get('request_stack'); 50 | $requestStack->getSession()->getBag('contao_backend')->set('tl_page_node', (int) $id); 51 | 52 | $uri = Uri::createFromString($requestStack->getCurrentRequest()->getUri()); 53 | $uri = UriModifier::removePairs($uri, 'switchLanguage'); 54 | 55 | throw new RedirectResponseException((string) $uri); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: ~ 8 | # schedule: 9 | # - cron: 0 13 * * MON,THU 10 | 11 | permissions: read-all 12 | 13 | jobs: 14 | build-tools: 15 | uses: 'terminal42/contao-build-tools/.github/workflows/build-tools.yml@main' 16 | 17 | tests: 18 | name: PHP ${{ matrix.php }} / Contao ${{ matrix.contao }} 19 | runs-on: ubuntu-latest 20 | strategy: 21 | fail-fast: false 22 | matrix: 23 | php: ['7.4', '8.1', '8.2', '8.3', '8.4'] 24 | contao: ['4.13', '5.3', '5.4'] 25 | exclude: 26 | - php: '7.4' 27 | contao: '5.3' 28 | - php: '7.4' 29 | contao: '5.4' 30 | steps: 31 | - name: Setup PHP 32 | uses: shivammathur/setup-php@v2 33 | with: 34 | php-version: ${{ matrix.php }} 35 | extensions: dom, fileinfo, filter, gd, hash, intl, json, mbstring, mysqli, pcre, pdo_mysql, zlib 36 | coverage: none 37 | 38 | - name: Initialize the database 39 | run: | 40 | sudo /etc/init.d/mysql start 41 | mysql -uroot -proot -e "CREATE database changelanguage" 42 | 43 | - name: Checkout 44 | uses: actions/checkout@v3 45 | 46 | - name: Require Contao version for tests 47 | run: composer require contao/core-bundle:${{ matrix.contao }}.* --dev --no-update 48 | 49 | - name: Install the dependencies 50 | run: composer install --no-interaction --no-progress 51 | 52 | - name: Run the unit tests 53 | run: composer run unit-tests 54 | env: 55 | DATABASE_URL: mysql://root:root@127.0.0.1:3306/changelanguage 56 | -------------------------------------------------------------------------------- /contao/languages/en/tl_module.xlf: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | Hide active language 11 | 12 | 13 | Please check here if you want to hide the active language on your site. 14 | 15 | 16 | Hide languages without direct fallback 17 | 18 | 19 | Do not show languages that have no direct fallback assigned. 20 | 21 | 22 | Custom language texts 23 | 24 | 25 | Please check here if you want to have custom texts for your languages (not uppercase language 26 | shortcuts). 27 | 28 | 29 | Language texts 30 | 31 | 32 | Enter the page language as key and a replacement text as value. 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /tests/PageFinder/AssociatedForLanguageTest.php: -------------------------------------------------------------------------------- 1 | pageFinder = new PageFinder(); 20 | } 21 | 22 | public function testFindsOnePage(): void 23 | { 24 | $enRoot = $this->createRootPage('', 'en', true); 25 | $deRoot = $this->createRootPage('', 'de', false); 26 | 27 | $enPage = $this->createPage($enRoot->id); 28 | $dePage = $this->createPage($deRoot->id, $enPage->id); 29 | 30 | $page = $this->pageFinder->findAssociatedForLanguage($dePage, 'en'); 31 | 32 | $this->assertInstanceOf(PageModel::class, $page); 33 | $this->assertSame($enPage->id, $page->id); 34 | } 35 | 36 | public function testReturnsRootWhenNoMatch(): void 37 | { 38 | $enRoot = $this->createRootPage('', 'en', true); 39 | $deRoot = $this->createRootPage('', 'de', false); 40 | 41 | $pageModel = $this->createPage($deRoot->id); 42 | $pageModel->language = 'de'; 43 | 44 | $page = $this->pageFinder->findAssociatedForLanguage($pageModel, 'en'); 45 | 46 | $this->assertInstanceOf(PageModel::class, $page); 47 | $this->assertSame($enRoot->id, $page->id); 48 | } 49 | 50 | public function testThrowsExceptionWhenLanguageDoesNotExist(): void 51 | { 52 | $this->expectException('InvalidArgumentException'); 53 | 54 | $enRoot = $this->createRootPage('', 'en', true); 55 | $deRoot = $this->createRootPage('', 'de', false); 56 | 57 | $enPage = $this->createPage($enRoot->id); 58 | $dePage = $this->createPage($deRoot->id, $enPage->id); 59 | 60 | $this->pageFinder->findAssociatedForLanguage($dePage, 'fr'); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/EventListener/Navigation/FaqNavigationListener.php: -------------------------------------------------------------------------------- 1 | getUrlParameterBag()->setUrlAttribute($this->getUrlKey(), $model->alias ?: $model->id); 27 | $event->getNavigationItem()->setTitle($model->question); 28 | $event->getNavigationItem()->setPageTitle($model->pageTitle); 29 | } 30 | 31 | protected function getUrlKey(): string 32 | { 33 | return isset($GLOBALS['TL_CONFIG']['useAutoItem']) ? 'items' : 'auto_item'; 34 | } 35 | 36 | protected function findCurrent(): ?FaqModel 37 | { 38 | $alias = $this->getAutoItem(); 39 | 40 | if ('' === $alias) { 41 | return null; 42 | } 43 | 44 | /** @var PageModel $objPage */ 45 | global $objPage; 46 | 47 | if (null === ($calendars = FaqCategoryModel::findBy('jumpTo', $objPage->id))) { 48 | return null; 49 | } 50 | 51 | return FaqModel::findPublishedByParentAndIdOrAlias($alias, $calendars->fetchEach('id')); 52 | } 53 | 54 | /** 55 | * @param array $columns 56 | * @param array $values 57 | * @param array $options 58 | */ 59 | protected function findPublishedBy(array $columns, array $values = [], array $options = []): ?FaqModel 60 | { 61 | return FaqModel::findOneBy( 62 | $this->addPublishedConditions($columns, FaqModel::getTable(), false), 63 | $values, 64 | $options, 65 | ); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/EventListener/Navigation/CalendarNavigationListener.php: -------------------------------------------------------------------------------- 1 | getUrlParameterBag()->setUrlAttribute($this->getUrlKey(), $model->alias ?: $model->id); 27 | $event->getNavigationItem()->setTitle($model->title); 28 | $event->getNavigationItem()->setPageTitle($model->pageTitle); 29 | } 30 | 31 | protected function getUrlKey(): string 32 | { 33 | return isset($GLOBALS['TL_CONFIG']['useAutoItem']) ? 'events' : 'auto_item'; 34 | } 35 | 36 | protected function findCurrent(): ?CalendarEventsModel 37 | { 38 | $alias = $this->getAutoItem(); 39 | 40 | if ('' === $alias) { 41 | return null; 42 | } 43 | 44 | /** @var PageModel $objPage */ 45 | global $objPage; 46 | 47 | if (null === ($calendars = CalendarModel::findBy('jumpTo', $objPage->id))) { 48 | return null; 49 | } 50 | 51 | return CalendarEventsModel::findPublishedByParentAndIdOrAlias($alias, $calendars->fetchEach('id')); 52 | } 53 | 54 | /** 55 | * @param array $columns 56 | * @param array $values 57 | * @param array $options 58 | */ 59 | protected function findPublishedBy(array $columns, array $values = [], array $options = []) 60 | { 61 | return CalendarEventsModel::findOneBy( 62 | $this->addPublishedConditions($columns, CalendarEventsModel::getTable()), 63 | $values, 64 | $options, 65 | ); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /tests/ContaoTestCase.php: -------------------------------------------------------------------------------- 1 | reset(); 32 | } 33 | 34 | protected function query(string $statement): int 35 | { 36 | $connection = static::getConnection(); 37 | 38 | $connection->executeQuery($statement); 39 | 40 | return (int) $connection->lastInsertId(); 41 | } 42 | 43 | /** 44 | * @param int|string $languageRoot 45 | */ 46 | protected function createRootPage(string $dns = '', string $language = '', bool $fallback = true, $languageRoot = 0, bool $published = true): PageModel 47 | { 48 | $pageModel = new PageModel(); 49 | $pageModel->type = 'root'; 50 | $pageModel->title = 'foobar'; 51 | $pageModel->dns = $dns; 52 | $pageModel->language = $language; 53 | $pageModel->fallback = $fallback; 54 | $pageModel->languageRoot = $languageRoot; 55 | $pageModel->published = $published; 56 | 57 | $pageModel->save(); 58 | 59 | return $pageModel; 60 | } 61 | 62 | /** 63 | * @param int|string $pid 64 | * @param int|string $languageMain 65 | */ 66 | protected function createPage($pid = 0, $languageMain = 0, bool $published = true): PageModel 67 | { 68 | $pageModel = new PageModel(); 69 | $pageModel->pid = $pid; 70 | $pageModel->type = 'regular'; 71 | $pageModel->languageMain = $languageMain; 72 | $pageModel->published = $published; 73 | 74 | $pageModel->save(); 75 | 76 | return $pageModel; 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /contao/languages/ja/tl_page.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Main language page 6 | 主言語のページ 7 | 8 | 9 | Choose the page in the language marked as fallback equals this page. 10 | このページと同等な、代替とする主言語のページを選択してください。 11 | 12 | 13 | Foreign-Domain Root Page 14 | 外部のドメインのルートのページ 15 | 16 | 17 | Select the root page if this page tree is related to another domain. 18 | このページのツリーが他のドメインに関係している場合はルートのページを選択してください。 19 | 20 | 21 | This is a main language root site 22 | これは主言語のルートのサイト 23 | 24 | 25 | Keep query parameters 26 | 問い合わせ文字列を保持 27 | 28 | 29 | Enter a comma separated list of query parameters that should be kept when switching to a translation of this page. 30 | このページの翻訳版に切り替えるときに保持する問い合わせ文字列をコンマで区切って入力してください。 31 | 32 | 33 | Language & Translation 34 | 言語と翻訳 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /contao/languages/ja/tl_calendar.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master calendar 6 | マスターのカレンダー 7 | 8 | 9 | Please define the master calendar to allow language switching. 10 | 言語の切り替えができるようにマスターのカレンダーを指定してください。 11 | 12 | 13 | This master has already been selected for the "%s" calendar! 14 | このマスターは既に"%s"カレンダーに選択されています! 15 | 16 | 17 | Language 18 | 言語 19 | 20 | 21 | Please enter the page language according to the ISO-639-1 standard (e.g. "en" for English or "en-US" for American English). 22 | ISO-639-1標準規格によるページの言語を入力してください。(例えば、英語の場合は"en"、アメリカ英語の場合は"en-US"。) 23 | 24 | 25 | Language settings 26 | 言語の設定 27 | 28 | 29 | This is a master calendar 30 | これはマスターのカレンダー 31 | 32 | 33 | Master calendar is "%s" 34 | マスターのカレンダーは"%s" 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /public/backend.css: -------------------------------------------------------------------------------- 1 | .header_switchLanguage { 2 | float: left; 3 | margin: 2px 0 0 12px; 4 | } 5 | 6 | /* Contao 5.6+ */ 7 | .operations > .header_switchLanguage { 8 | margin: 14px 0 0 15px; 9 | } 10 | 11 | .header_switchLanguage svg { 12 | float: left; 13 | width: 16px; 14 | height: 16px; 15 | padding-right: 8px; 16 | fill: #589b0e; 17 | } 18 | 19 | .header_switchLanguage > span { 20 | position: relative; 21 | display: inline-block; 22 | padding-bottom: 10px; 23 | } 24 | 25 | .header_switchLanguage ul { 26 | position: absolute; 27 | left: 50%; 28 | display: none; 29 | min-width: 100px; 30 | margin: 10px 12px 0 0; 31 | padding: 5px 10px; 32 | text-align: left; 33 | background: #fff; 34 | border: 1px solid #ccc; 35 | -moz-border-radius: 4px; 36 | -webkit-border-radius: 4px; 37 | border-radius: 4px; 38 | z-index: 99999999; 39 | -webkit-transform: translateX(-50%); 40 | transform: translateX(-50%); 41 | list-style: none; 42 | } 43 | 44 | .header_switchLanguage > span:hover ul { 45 | display: block; 46 | } 47 | 48 | .header_switchLanguage ul:after, .header_switchLanguage ul:before { 49 | bottom: 100%; 50 | left: 50%; 51 | border: solid transparent; 52 | content: " "; 53 | height: 0; 54 | width: 0; 55 | position: absolute; 56 | pointer-events: none; 57 | } 58 | 59 | .header_switchLanguage ul:after { 60 | border-color: rgba(255, 255, 255, 0); 61 | border-bottom-color: #fff; 62 | border-width: 5px; 63 | margin-left: -5px; 64 | } 65 | 66 | .header_switchLanguage ul:before { 67 | border-color: rgba(204, 204, 204, 0); 68 | border-bottom-color: #ccc; 69 | border-width: 6px; 70 | margin-left: -6px; 71 | } 72 | 73 | .header_switchLanguage li { 74 | padding: 3px 0; 75 | white-space: nowrap; 76 | } 77 | 78 | .header_switchLanguage a { 79 | display: block; 80 | } 81 | 82 | .header_switchLanguage a:before { 83 | content: "› "; 84 | } 85 | 86 | html[data-color-scheme="dark"] .header_switchLanguage ul { 87 | background-color: #232529; 88 | border-color: #3f4146; 89 | list-style: none; 90 | } 91 | 92 | html[data-color-scheme="dark"] .header_switchLanguage ul:before, 93 | html[data-color-scheme="dark"] .header_switchLanguage ul:after { 94 | border-bottom-color: #3f4146; 95 | } 96 | -------------------------------------------------------------------------------- /.tx/config: -------------------------------------------------------------------------------- 1 | [main] 2 | host = https://www.transifex.com 3 | type = XLIFF 4 | 5 | [o:terminal42:p:contao-changelanguage:r:default] 6 | file_filter = contao/languages//default.xlf 7 | source_file = contao/languages/en/default.xlf 8 | source_lang = en 9 | 10 | [o:terminal42:p:contao-changelanguage:r:modules] 11 | file_filter = contao/languages//modules.xlf 12 | source_file = contao/languages/en/modules.xlf 13 | source_lang = en 14 | 15 | [o:terminal42:p:contao-changelanguage:r:tl_article] 16 | file_filter = contao/languages//tl_article.xlf 17 | source_file = contao/languages/en/tl_article.xlf 18 | source_lang = en 19 | 20 | [o:terminal42:p:contao-changelanguage:r:tl_calendar] 21 | file_filter = contao/languages//tl_calendar.xlf 22 | source_file = contao/languages/en/tl_calendar.xlf 23 | source_lang = en 24 | 25 | [o:terminal42:p:contao-changelanguage:r:tl_calendar_events] 26 | file_filter = contao/languages//tl_calendar_events.xlf 27 | source_file = contao/languages/en/tl_calendar_events.xlf 28 | source_lang = en 29 | 30 | [o:terminal42:p:contao-changelanguage:r:tl_faq] 31 | file_filter = contao/languages//tl_faq.xlf 32 | source_file = contao/languages/en/tl_faq.xlf 33 | source_lang = en 34 | 35 | [o:terminal42:p:contao-changelanguage:r:tl_faq_category] 36 | file_filter = contao/languages//tl_faq_category.xlf 37 | source_file = contao/languages/en/tl_faq_category.xlf 38 | source_lang = en 39 | 40 | [o:terminal42:p:contao-changelanguage:r:tl_module] 41 | file_filter = contao/languages//tl_module.xlf 42 | source_file = contao/languages/en/tl_module.xlf 43 | source_lang = en 44 | 45 | [o:terminal42:p:contao-changelanguage:r:tl_news] 46 | file_filter = contao/languages//tl_news.xlf 47 | source_file = contao/languages/en/tl_news.xlf 48 | source_lang = en 49 | 50 | [o:terminal42:p:contao-changelanguage:r:tl_news_archive] 51 | file_filter = contao/languages//tl_news_archive.xlf 52 | source_file = contao/languages/en/tl_news_archive.xlf 53 | source_lang = en 54 | 55 | [o:terminal42:p:contao-changelanguage:r:tl_page] 56 | file_filter = contao/languages//tl_page.xlf 57 | source_file = contao/languages/en/tl_page.xlf 58 | source_lang = en 59 | 60 | [o:terminal42:p:contao-changelanguage:r:tl_user] 61 | file_filter = contao/languages//tl_user.xlf 62 | source_file = contao/languages/en/tl_user.xlf 63 | source_lang = en 64 | -------------------------------------------------------------------------------- /contao/languages/ja/tl_faq_category.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master category 6 | マスターのカテゴリ 7 | 8 | 9 | Please define the master category to allow language switching. 10 | 言語の切り替えができるようにマスターのカテゴリを選択してください。 11 | 12 | 13 | This master has already been selected for the "%s" category! 14 | このマスターは既に"%s"のカテゴリーに選択されています! 15 | 16 | 17 | Language 18 | 言語 19 | 20 | 21 | Please enter the page language according to the ISO-639-1 standard (e.g. "en" for English or "en-US" for American English). 22 | ISO-639-1標準規格によるページの言語を入力してください。(例えば、英語の場合は"en"、アメリカ英語の場合は"en-US"。) 23 | 24 | 25 | Language settings 26 | 言語の設定 27 | 28 | 29 | This is a master category 30 | これはマスターのカテゴリ 31 | 32 | 33 | Master category is "%s" 34 | マスターのカテゴリは"%s" 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /contao/languages/ja/tl_module.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Hide active language 6 | 有効な言語を非表示 7 | 8 | 9 | Please check here if you want to hide the active language on your site. 10 | サイトの有効な言語を表示したくない場合に選択してください。 11 | 12 | 13 | Hide languages without direct fallback 14 | 代替の指定のない言語を非表示 15 | 16 | 17 | Do not show languages that have no direct fallback assigned. 18 | 代替の言語の指定のない言語を表示しません。 19 | 20 | 21 | Custom language texts 22 | 独自の言語の文字列 23 | 24 | 25 | Please check here if you want to have custom texts for your languages (not uppercase language 26 | shortcuts). 27 | (大文字の言語名ではない)独自の文字列を言語名に使用したい場合に選択してください。 28 | 29 | 30 | Language texts 31 | 言語の文字列 32 | 33 | 34 | Enter the page language as key and a replacement text as value. 35 | ページの言語をキー、代替のテキストを値として入力します。 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /contao/languages/ja/tl_news_archive.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master archive 6 | マスターのアーカイブ 7 | 8 | 9 | Please define the master archive to allow language switching. 10 | 言語の切り替えができるようにマスターのアーカイブを指定してください。 11 | 12 | 13 | This master has already been selected for the "%s" archive! 14 | このマスターは既に"%s"のアーカイブにに選択されています! 15 | 16 | 17 | Language 18 | 言語 19 | 20 | 21 | Please enter the page language according to the ISO-639-1 standard (e.g. "en" for English or "en-US" for American English). 22 | ISO-639-1標準規格によるページの言語を入力してください。(例えば、英語の場合は"en"、アメリカ英語の場合は"en-US"。) 23 | 24 | 25 | Language settings 26 | 言語の設定 27 | 28 | 29 | This is a master archive 30 | これはマスターのアーカイブ 31 | 32 | 33 | Master archive is "%s" 34 | マスターのアーカイブは"%s" 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /src/Helper/LabelCallback.php: -------------------------------------------------------------------------------- 1 | previous) || \is_array($this->previous)) { 29 | $result = $this->executeCallback($this->previous, $args); 30 | } 31 | 32 | return $this->executeCallback($callback, [$args, $result]); 33 | }; 34 | 35 | if (4 === ($GLOBALS['TL_DCA'][$table]['list']['sorting']['mode'] ?? null)) { 36 | $this->previous = $GLOBALS['TL_DCA'][$table]['list']['sorting']['child_record_callback'] ?? null; 37 | $GLOBALS['TL_DCA'][$table]['list']['sorting']['child_record_callback'] = $chain; 38 | } else { 39 | $this->previous = $GLOBALS['TL_DCA'][$table]['list']['label']['label_callback'] ?? null; 40 | $GLOBALS['TL_DCA'][$table]['list']['label']['label_callback'] = $chain; 41 | } 42 | } 43 | 44 | /** 45 | * Creates and registers new LabelCallback. 46 | */ 47 | public static function createAndRegister(string $table, callable $callback): self 48 | { 49 | $instance = new self(); 50 | $instance->register($table, $callback); 51 | 52 | return $instance; 53 | } 54 | 55 | /** 56 | * @param callable|array $callback 57 | * @param array $args 58 | * 59 | * @return mixed 60 | */ 61 | private function executeCallback($callback, array $args) 62 | { 63 | // Support Contao's getInstance() method when callback is an array 64 | if (\is_array($callback)) { 65 | return \call_user_func_array( 66 | [System::importStatic($callback[0]), $callback[1]], 67 | $args, 68 | ); 69 | } 70 | 71 | return $callback(...$args); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /contao/languages/pl/tl_calendar.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master calendar 6 | Główny kalendarz 7 | 8 | 9 | Please define the master calendar to allow language switching. 10 | Proszę wybrać główny kalendarz, aby umożliwić zmianę języka. 11 | 12 | 13 | This master has already been selected for the "%s" calendar! 14 | 15 | 16 | Language 17 | Język 18 | 19 | 20 | Please enter the page language according to the ISO-639-1 standard (e.g. "en" for English or "en-US" for American English). 21 | Wprowadź język strony w standardzie ISO-639-1 (np. "en" dla języka angielskiego lub "en-US" dla języka angielskiego amerykańskiego). 22 | 23 | 24 | Language settings 25 | Ustawienia języka 26 | 27 | 28 | This is a master calendar 29 | To jest główny kalendarz 30 | 31 | 32 | Master calendar is "%s" 33 | Główny kalendarz to "%s" 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /contao/languages/lv/tl_calendar.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master calendar 6 | Galvenais kalendārs 7 | 8 | 9 | Please define the master calendar to allow language switching. 10 | Lūdzu, norādiet galveno kalendāru, lai atļautu valodas maiņu. 11 | 12 | 13 | This master has already been selected for the "%s" calendar! 14 | 15 | 16 | Language 17 | Valoda 18 | 19 | 20 | Please enter the page language according to the ISO-639-1 standard (e.g. "en" for English or "en-US" for American English). 21 | Lūdzu, ievadiet lapas valodu saskaņā ar ISO-639-1 standartu (piemēram, angļu valodā "en" vai amerikāņu angļu valodā "en-US"). 22 | 23 | 24 | Language settings 25 | Valodas iestatījumi 26 | 27 | 28 | This is a master calendar 29 | Šis ir galvenais kalendārs 30 | 31 | 32 | Master calendar is "%s" 33 | Galvenais kalendārs ir "%s" 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/EventListener/Navigation/NewsNavigationListener.php: -------------------------------------------------------------------------------- 1 | getUrlParameterBag()->setUrlAttribute($this->getUrlKey(), $model->alias ?: $model->id); 27 | $event->getNavigationItem()->setTitle($model->headline); 28 | $event->getNavigationItem()->setPageTitle($model->pageTitle); 29 | } 30 | 31 | protected function getUrlKey(): string 32 | { 33 | return isset($GLOBALS['TL_CONFIG']['useAutoItem']) ? 'items' : 'auto_item'; 34 | } 35 | 36 | protected function findCurrent(): ?NewsModel 37 | { 38 | $alias = $this->getAutoItem(); 39 | 40 | if ('' === $alias) { 41 | return null; 42 | } 43 | 44 | /** @var PageModel $objPage */ 45 | global $objPage; 46 | 47 | if (null === ($archives = NewsArchiveModel::findBy('jumpTo', $objPage->id))) { 48 | return null; 49 | } 50 | 51 | // Fix Contao bug that returns a collection (see contao-changelanguage#71) 52 | $options = ['limit' => 1, 'return' => 'Model']; 53 | 54 | return NewsModel::findPublishedByParentAndIdOrAlias($alias, $archives->fetchEach('id'), $options); 55 | } 56 | 57 | /** 58 | * @param array $columns 59 | * @param array $values 60 | * @param array $options 61 | */ 62 | protected function findPublishedBy(array $columns, array $values = [], array $options = []): ?NewsModel 63 | { 64 | return NewsModel::findOneBy( 65 | $this->addPublishedConditions($columns, NewsModel::getTable()), 66 | $values, 67 | $options, 68 | ); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /contao/languages/lv/tl_news_archive.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master archive 6 | Galvenais arhīvs 7 | 8 | 9 | Please define the master archive to allow language switching. 10 | Lūdzu, norādiet galveno arhīvu, lai atļautu valodas maiņu. 11 | 12 | 13 | This master has already been selected for the "%s" archive! 14 | 15 | 16 | Language 17 | Valoda 18 | 19 | 20 | Please enter the page language according to the ISO-639-1 standard (e.g. "en" for English or "en-US" for American English). 21 | Lūdzu, ievadiet lapas valodu saskaņā ar ISO-639-1 standartu (piemēram, angļu valodā "en" vai amerikāņu angļu valodā "en-US"). 22 | 23 | 24 | Language settings 25 | Valodas iestatījumi 26 | 27 | 28 | This is a master archive 29 | Šis ir galvenais arhīvs 30 | 31 | 32 | Master archive is "%s" 33 | Galvenais arhīvs ir "%s" 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/Migration/CustomLanguageTextMigration.php: -------------------------------------------------------------------------------- 1 | connection = $connection; 22 | $this->framework = $framework; 23 | } 24 | 25 | public function shouldRun(): bool 26 | { 27 | $schemaManager = $this->connection->createSchemaManager(); 28 | 29 | if (!$schemaManager->tablesExist(['tl_module'])) { 30 | return false; 31 | } 32 | 33 | $tableColumns = $schemaManager->listTableColumns('tl_module'); 34 | 35 | if (!isset($tableColumns['customlanguagetext'])) { 36 | return false; 37 | } 38 | 39 | $texts = $this->connection->fetchFirstColumn('SELECT customLanguageText FROM tl_module'); 40 | 41 | foreach ($texts as $text) { 42 | $text = StringUtil::deserialize($text); 43 | 44 | if (\is_array($text) && isset($text[0]['label'])) { 45 | return true; 46 | } 47 | } 48 | 49 | return false; 50 | } 51 | 52 | public function run(): MigrationResult 53 | { 54 | $this->framework->initialize(); 55 | 56 | $records = $this->connection->fetchAllAssociative('SELECT id, customLanguageText FROM tl_module'); 57 | 58 | foreach ($records as $record) { 59 | $data = StringUtil::deserialize($record['customLanguageText']); 60 | 61 | if (\is_array($data) && isset($data[0]['label'])) { 62 | $newData = []; 63 | 64 | foreach ($data as $datum) { 65 | $newData[] = ['key' => $datum['value'], 'value' => $datum['label']]; 66 | } 67 | 68 | $this->connection->update('tl_module', ['customLanguageText' => serialize($newData)], ['id' => $record['id']]); 69 | } 70 | } 71 | 72 | return $this->createResult(true); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /contao/languages/pl/tl_news_archive.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master archive 6 | Główne archiwum 7 | 8 | 9 | Please define the master archive to allow language switching. 10 | Proszę wybrać główne archiwum, aby umożliwić zmianę języka. 11 | 12 | 13 | This master has already been selected for the "%s" archive! 14 | 15 | 16 | Language 17 | Język 18 | 19 | 20 | Please enter the page language according to the ISO-639-1 standard (e.g. "en" for English or "en-US" for American English). 21 | Wprowadź język strony w standardzie ISO-639-1 (np. "en" dla języka angielskiego lub "en-US" dla języka angielskiego amerykańskiego). 22 | 23 | 24 | Language settings 25 | Ustawienia języka 26 | 27 | 28 | This is a master archive 29 | To jest główne archiwum 30 | 31 | 32 | Master archive is "%s" 33 | Główne archiwum to "%s" 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /contao/languages/lv/tl_faq_category.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master category 6 | Galvenā kategorija 7 | 8 | 9 | Please define the master category to allow language switching. 10 | Lūdzu, norādiet galveno kategoriju, lai atļautu valodas maiņu. 11 | 12 | 13 | This master has already been selected for the "%s" category! 14 | 15 | 16 | Language 17 | Valoda 18 | 19 | 20 | Please enter the page language according to the ISO-639-1 standard (e.g. "en" for English or "en-US" for American English). 21 | Lūdzu, ievadiet lapas valodu saskaņā ar ISO-639-1 standartu (piemēram, angļu valodā "en" vai amerikāņu angļu valodā "en-US"). 22 | 23 | 24 | Language settings 25 | Valodas iestatījumi 26 | 27 | 28 | This is a master category 29 | Šī ir galvenā kategorija 30 | 31 | 32 | Master category is "%s" 33 | Galvenā kategorija ir "%s" 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /contao/languages/pl/tl_faq_category.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master category 6 | Główna kategoria 7 | 8 | 9 | Please define the master category to allow language switching. 10 | Proszę wybrać główną kategorię, aby umożliwić zmianę języka. 11 | 12 | 13 | This master has already been selected for the "%s" category! 14 | 15 | 16 | Language 17 | Język 18 | 19 | 20 | Please enter the page language according to the ISO-639-1 standard (e.g. "en" for English or "en-US" for American English). 21 | Wprowadź język strony w standardzie ISO-639-1 (np. "en" dla języka angielskiego lub "en-US" dla języka angielskiego amerykańskiego). 22 | 23 | 24 | Language settings 25 | Ustawienia języka 26 | 27 | 28 | This is a master category 29 | To jest główna kategoria 30 | 31 | 32 | Master category is "%s" 33 | Główna kategoria to "%s" 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /contao/languages/fr/tl_calendar.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master calendar 6 | Calendrier de base 7 | 8 | 9 | Please define the master calendar to allow language switching. 10 | Merci de sélectionner le calendrier de base pour permettre le changement de langue. 11 | 12 | 13 | This master has already been selected for the "%s" calendar! 14 | 15 | 16 | Language 17 | Langue 18 | 19 | 20 | Please enter the page language according to the ISO-639-1 standard (e.g. "en" for English or "en-US" for American English). 21 | Merci d'introduire la langue de la page conformément à la norme ISO-639-1 (par exemple "en" pour l'anglais ou "en-US" pour l'anglais américain). 22 | 23 | 24 | Language settings 25 | Paramètres de la langue 26 | 27 | 28 | This is a master calendar 29 | Il s'agit d'un calendrier de base 30 | 31 | 32 | Master calendar is "%s" 33 | Le calendrier de base est "%s" 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /contao/languages/cs/tl_calendar.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master calendar 6 | Hlavní kalendář 7 | 8 | 9 | Please define the master calendar to allow language switching. 10 | Definujte prosím hlavní kalendář, abyste umožnili přepínání jazyků. 11 | 12 | 13 | This master has already been selected for the "%s" calendar! 14 | Tento hlavní již byl vybrán pro "%s" kalendář! 15 | 16 | 17 | Language 18 | Jazyk 19 | 20 | 21 | Please enter the page language according to the ISO-639-1 standard (e.g. "en" for English or "en-US" for American English). 22 | Zadejte prosím jazyk stránky podle normy ISO-639-1 (např. „cs", „en“ pro angličtinu nebo „en-US“ pro americkou angličtinu). 23 | 24 | 25 | Language settings 26 | Nastavení jazyka 27 | 28 | 29 | This is a master calendar 30 | Toto je hlavní kalendář 31 | 32 | 33 | Master calendar is "%s" 34 | Hlavní kalendář je "%s" 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /contao/languages/fr/tl_news_archive.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master archive 6 | Archive de base 7 | 8 | 9 | Please define the master archive to allow language switching. 10 | Merci de sélectionner l'archive de base pour permettre le changement de langue. 11 | 12 | 13 | This master has already been selected for the "%s" archive! 14 | 15 | 16 | Language 17 | Langue 18 | 19 | 20 | Please enter the page language according to the ISO-639-1 standard (e.g. "en" for English or "en-US" for American English). 21 | Merci d'introduire la langue de la page conformément à la norme ISO-639-1 (par exemple "en" pour l'anglais ou "en-US" pour l'anglais américain). 22 | 23 | 24 | Language settings 25 | Paramètres de la langue 26 | 27 | 28 | This is a master archive 29 | Il s'agit d'une archive de base 30 | 31 | 32 | Master archive is "%s" 33 | L'archive de base est "%s" 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /contao/languages/de/tl_calendar.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master calendar 6 | Hauptkalender 7 | 8 | 9 | Please define the master calendar to allow language switching. 10 | Wählen Sie den Hauptkalender um Sprachenwechel zu ermöglichen. 11 | 12 | 13 | This master has already been selected for the "%s" calendar! 14 | Dies ist bereits der Hauptkalender für "%s"! 15 | 16 | 17 | Language 18 | Sprache 19 | 20 | 21 | Please enter the page language according to the ISO-639-1 standard (e.g. "en" for English or "en-US" for American English). 22 | Bitte geben Sie die Sprache gemäss ISO-639-1 Standard ein (z.B. "en" für Englisch oder "en-US" für amerikanisches Englisch). 23 | 24 | 25 | Language settings 26 | Spracheinstellungen 27 | 28 | 29 | This is a master calendar 30 | Dies ist ein Hauptkalender 31 | 32 | 33 | Master calendar is "%s" 34 | Der Hauptkalender ist "%s" 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /contao/languages/lv/tl_page.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Main language page 6 | Galvenā valodas lapa 7 | 8 | 9 | Choose the page in the language marked as fallback equals this page. 10 | Izvēlieties lapu atkāpšanās valodā, kas atbilst šai lapai. 11 | 12 | 13 | Foreign-Domain Root Page 14 | Ārzemju domēna saknes lapa 15 | 16 | 17 | Select the root page if this page tree is related to another domain. 18 | Izvēlieties saknes lapu, ja šis lapas koks ir saistīts ar citu domēnu. 19 | 20 | 21 | This is a main language root site 22 | Šī ir galvenās valodas saknes vietne 23 | 24 | 25 | Keep query parameters 26 | Saglabāt vaicājuma parametrus 27 | 28 | 29 | Enter a comma separated list of query parameters that should be kept when switching to a translation of this page. 30 | Ievadiet ar komatu atdalītu vaicājuma parametru sarakstu, kas jāsaglabā, pārejot uz šīs lapas tulkojumu. 31 | 32 | 33 | Language & Translation 34 | Valoda un tulkojums 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /contao/languages/cs/tl_news_archive.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master archive 6 | Hlavní archiv 7 | 8 | 9 | Please define the master archive to allow language switching. 10 | Definujte prosím hlavní archiv, aby bylo možné přepínat jazyky. 11 | 12 | 13 | This master has already been selected for the "%s" archive! 14 | Tento hlavní již byl vybrán pro "%s" archiv! 15 | 16 | 17 | Language 18 | Jazyk 19 | 20 | 21 | Please enter the page language according to the ISO-639-1 standard (e.g. "en" for English or "en-US" for American English). 22 | Zadejte prosím jazyk stránky podle normy ISO-639-1 (např. „cs", „en“ pro angličtinu nebo „en-US“ pro americkou angličtinu). 23 | 24 | 25 | Language settings 26 | Nastavení jazyka 27 | 28 | 29 | This is a master archive 30 | Toto je hlavní archiv 31 | 32 | 33 | Master archive is "%s" 34 | Hlavní archiv je "%s" 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /contao/languages/fr/tl_faq_category.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master category 6 | Catégorie de base 7 | 8 | 9 | Please define the master category to allow language switching. 10 | Merci de sélectionner la catégorie de base pour permettre le changement de langue. 11 | 12 | 13 | This master has already been selected for the "%s" category! 14 | 15 | 16 | Language 17 | Langue 18 | 19 | 20 | Please enter the page language according to the ISO-639-1 standard (e.g. "en" for English or "en-US" for American English). 21 | Merci d'introduire la langue de la page conformément à la norme ISO-639-1 (par exemple "en" pour l'anglais ou "en-US" pour l'anglais américain). 22 | 23 | 24 | Language settings 25 | Paramètres de la langue 26 | 27 | 28 | This is a master category 29 | Il s'agit d'une catégorie de base 30 | 31 | 32 | Master category is "%s" 33 | La catégorie de base est "%s" 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /contao/languages/pl/tl_module.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Hide active language 6 | Ukryj aktywny język 7 | 8 | 9 | Please check here if you want to hide the active language on your site. 10 | Jeśli wybierzesz tę opcję, ukryjesz aktywny język. 11 | 12 | 13 | Hide languages without direct fallback 14 | Ukryj języki bez przypisanego języka domyślnego 15 | 16 | 17 | Do not show languages that have no direct fallback assigned. 18 | Nie pokazuj języków, które nie mają przypisanego języka domyślnego. 19 | 20 | 21 | Custom language texts 22 | Własne etykiety języków 23 | 24 | 25 | Please check here if you want to have custom texts for your languages (not uppercase language 26 | shortcuts). 27 | Wybierzesz tę opcję, jeżeli chcesz użyć własne etykiety języków (skróty pisane małymi literami). 28 | 29 | 30 | Language texts 31 | Etykiety języków 32 | 33 | 34 | Enter the page language as key and a replacement text as value. 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /contao/languages/cs/tl_module.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Hide active language 6 | Skrýt aktivní jazyk 7 | 8 | 9 | Please check here if you want to hide the active language on your site. 10 | Zde zaškrtněte, pokud chcete skrýt aktivní jazyk na svých stránkách. 11 | 12 | 13 | Hide languages without direct fallback 14 | Skrýt jazyky bez přímého záložního řešení 15 | 16 | 17 | Do not show languages that have no direct fallback assigned. 18 | Nezobrazovat jazyky, které nemají přiřazený založní jazyk 19 | 20 | 21 | Custom language texts 22 | Vlastní texty jazyků 23 | 24 | 25 | Please check here if you want to have custom texts for your languages (not uppercase language 26 | shortcuts). 27 | Zde zaškrtněte, pokud chcete mít vlastní texty pro vaše jazyky (nikoli jazyk velkých písmen 28 | zkratky). 29 | 30 | 31 | Language texts 32 | Texty jazyků 33 | 34 | 35 | Enter the page language as key and a replacement text as value. 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /contao/languages/ru/tl_calendar.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master calendar 6 | Основной календарь 7 | 8 | 9 | Please define the master calendar to allow language switching. 10 | Определите основной календарь, чтобы разрешить переключение языков. 11 | 12 | 13 | This master has already been selected for the "%s" calendar! 14 | Этот основной архив уже выбран для календаря "%s"! 15 | 16 | 17 | Language 18 | Язык 19 | 20 | 21 | Please enter the page language according to the ISO-639-1 standard (e.g. "en" for English or "en-US" for American English). 22 | Введите язык страницы в соответствии со стандартом ISO-639-1 (напр., "en" для Английского или "en-US" для Американского варианта английского). 23 | 24 | 25 | Language settings 26 | Настройки языка 27 | 28 | 29 | This is a master calendar 30 | Это основной календарь 31 | 32 | 33 | Master calendar is "%s" 34 | Основной календарь "%s" 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /contao/languages/de/tl_news_archive.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master archive 6 | Hauptarchiv 7 | 8 | 9 | Please define the master archive to allow language switching. 10 | Wählen Sie das Hauptarchiv um Sprachenwechsel zu ermöglichen. 11 | 12 | 13 | This master has already been selected for the "%s" archive! 14 | Dies ist bereits das Hauptarchiv für "%s"! 15 | 16 | 17 | Language 18 | Sprache 19 | 20 | 21 | Please enter the page language according to the ISO-639-1 standard (e.g. "en" for English or "en-US" for American English). 22 | Bitte geben Sie die Sprache gemäss ISO-639-1 Standard ein (z.B. "en" für Englisch oder "en-US" für amerikanisches Englisch). 23 | 24 | 25 | Language settings 26 | Spracheinstellungen 27 | 28 | 29 | This is a master archive 30 | Dies ist ein Hauptarchiv 31 | 32 | 33 | Master archive is "%s" 34 | Das Hauptarchiv ist "%s" 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /contao/languages/pl/tl_page.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Main language page 6 | Strona głównego języka 7 | 8 | 9 | Choose the page in the language marked as fallback equals this page. 10 | Wybierz stronę w języku oznaczonym jako domyślny odpowiadającą tej stronie. 11 | 12 | 13 | Foreign-Domain Root Page 14 | Punkt startowy innej domeny 15 | 16 | 17 | Select the root page if this page tree is related to another domain. 18 | Wybierz punkt startowy, jeśli to drzewo jest powiązane z inną domeną. 19 | 20 | 21 | This is a main language root site 22 | To jest strona głównego języka 23 | 24 | 25 | Keep query parameters 26 | Zachowaj parametry URL 27 | 28 | 29 | Enter a comma separated list of query parameters that should be kept when switching to a translation of this page. 30 | Wprowadź oddzieloną przecinkami listę parametrów URL, który powinny zostać zachowane przy zmianie tłumaczenia tej strony. 31 | 32 | 33 | Language & Translation 34 | Język i tłumaczenie 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /contao/languages/cs/tl_faq_category.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master category 6 | Hlavní kategorie 7 | 8 | 9 | Please define the master category to allow language switching. 10 | Definujte prosím hlavní kategorii, abyste umožnili přepínání jazyků. 11 | 12 | 13 | This master has already been selected for the "%s" category! 14 | Tento hlavní již byl vybrán pro "%s" kategorii! 15 | 16 | 17 | Language 18 | Jazyk 19 | 20 | 21 | Please enter the page language according to the ISO-639-1 standard (e.g. "en" for English or "en-US" for American English). 22 | Zadejte prosím jazyk stránky podle normy ISO-639-1 (např. „cs", „en“ pro angličtinu nebo „en-US“ pro americkou angličtinu). 23 | 24 | 25 | Language settings 26 | Nastavení jazyka 27 | 28 | 29 | This is a master category 30 | Toto je hlavní kategorie 31 | 32 | 33 | Master category is "%s" 34 | Hlavní kategorie je "%s" 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /contao/languages/de/tl_page.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Main language page 6 | Seite in Hauptsprache 7 | 8 | 9 | Choose the page in the language marked as fallback equals this page. 10 | Wählen Sie die Seite in der Fallback-Sprache aus, die dieser hier entspricht. 11 | 12 | 13 | Foreign-Domain Root Page 14 | Fremd-Domain Hauptsprache 15 | 16 | 17 | Select the root page if this page tree is related to another domain. 18 | Wählen Sie ob diese Seitenstruktur zur Sprache einer anderen Domain gehört. 19 | 20 | 21 | This is a main language root site 22 | Dies ist die Hauptdomain 23 | 24 | 25 | Keep query parameters 26 | Query-Parameter beibehalten 27 | 28 | 29 | Enter a comma separated list of query parameters that should be kept when switching to a translation of this page. 30 | Geben Sie eine kommaseparierte Liste von Query-Parametern ein, welche beim Sprachwechsel beibehalten werden sollen. 31 | 32 | 33 | Language & Translation 34 | Sprache & Übersetzung 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /contao/languages/cs/tl_page.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Main language page 6 | Hlavní jazyková stránka 7 | 8 | 9 | Choose the page in the language marked as fallback equals this page. 10 | Vyberte stránku v jazyce označeném jako záložní, která se rovná této stránce. 11 | 12 | 13 | Foreign-Domain Root Page 14 | Kořenová stránka cizí domény 15 | 16 | 17 | Select the root page if this page tree is related to another domain. 18 | Vyberte kořenovou stránku, pokud tento strom stránky souvisí s jinou doménou. 19 | 20 | 21 | This is a main language root site 22 | Toto je hlavní jazyk kořene webu 23 | 24 | 25 | Keep query parameters 26 | Zachovejte parametry dotazu 27 | 28 | 29 | Enter a comma separated list of query parameters that should be kept when switching to a translation of this page. 30 | Zadejte čárkami oddělený seznam parametrů dotazu, které by měly být zachovány při přechodu na překlad této stránky. 31 | 32 | 33 | Language & Translation 34 | Jazyk a překlady 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /contao/languages/lv/tl_module.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Hide active language 6 | Slēpt aktīvo valodu 7 | 8 | 9 | Please check here if you want to hide the active language on your site. 10 | Lūdzu, atzīmējiet šeit, ja vēlaties paslēpt aktīvo valodu savā vietnē. 11 | 12 | 13 | Hide languages without direct fallback 14 | Slēpt valodas bez tiešas rezerves 15 | 16 | 17 | Do not show languages that have no direct fallback assigned. 18 | Nerādīt valodas, kurām nav piešķirtas tiešās rezerves. 19 | 20 | 21 | Custom language texts 22 | Pielāgotie valodu teksti 23 | 24 | 25 | Please check here if you want to have custom texts for your languages (not uppercase language 26 | shortcuts). 27 | Lūdzu, atzīmējiet šeit, ja vēlaties pielāgotus tekstus savām valodām (nevis lielo burtu valodu 28 |   saīsnes). 29 | 30 | 31 | Language texts 32 | Valodu teksti 33 | 34 | 35 | Enter the page language as key and a replacement text as value. 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /contao/languages/ru/tl_news_archive.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master archive 6 | Основной архив 7 | 8 | 9 | Please define the master archive to allow language switching. 10 | Определите основной архив, чтобы разрешить переключение языков. 11 | 12 | 13 | This master has already been selected for the "%s" archive! 14 | Этот основной архив уже выбран для архива "%s"! 15 | 16 | 17 | Language 18 | Язык 19 | 20 | 21 | Please enter the page language according to the ISO-639-1 standard (e.g. "en" for English or "en-US" for American English). 22 | Введите язык страницы в соответствии со стандартом ISO-639-1 (напр., "en" для Английского или "en-US" для Американского варианта английского). 23 | 24 | 25 | Language settings 26 | Настройки языка 27 | 28 | 29 | This is a master archive 30 | Это основной архив 31 | 32 | 33 | Master archive is "%s" 34 | Основной архив "%s" 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /contao/languages/ru/tl_page.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Main language page 6 | Основной язык страницы 7 | 8 | 9 | Choose the page in the language marked as fallback equals this page. 10 | Выберите страницу, на языке отмеченным как резервный, равную этой странице. 11 | 12 | 13 | Foreign-Domain Root Page 14 | Корневая страница внешнего домена 15 | 16 | 17 | Select the root page if this page tree is related to another domain. 18 | Выберите корневую страницу, если это дерево страниц связано с другим доменом. 19 | 20 | 21 | This is a main language root site 22 | Это основной язык корня сайта 23 | 24 | 25 | Keep query parameters 26 | Сохранить параметры запроса 27 | 28 | 29 | Enter a comma separated list of query parameters that should be kept when switching to a translation of this page. 30 | Введите разделенный запятыми список параметров запроса, который должен храниться при переключении на перевод этой страницы. 31 | 32 | 33 | Language & Translation 34 | Язык и перевод 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /contao/languages/de/tl_faq_category.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master category 6 | Hauptkategorie 7 | 8 | 9 | Please define the master category to allow language switching. 10 | Wählen Sie die Hauptkategorie um Sprachenwechel zu ermöglichen. 11 | 12 | 13 | This master has already been selected for the "%s" category! 14 | Dies ist bereits die Hauptkategorie für "%s"! 15 | 16 | 17 | Language 18 | Sprache 19 | 20 | 21 | Please enter the page language according to the ISO-639-1 standard (e.g. "en" for English or "en-US" for American English). 22 | Bitte geben Sie die Sprache gemäss ISO-639-1 Standard ein (z.B. "en" für Englisch oder "en-US" für amerikanisches Englisch). 23 | 24 | 25 | Language settings 26 | Spracheinstellungen 27 | 28 | 29 | This is a master category 30 | Dies ist eine Hauptkategorie 31 | 32 | 33 | Master category is "%s" 34 | Die Hauptkategorie ist "%s" 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /contao/languages/pt/tl_calendar.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Master calendar 6 | Calendário principal 7 | 8 | 9 | Please define the master calendar to allow language switching. 10 | É favor definir o calendário principal para permitir a mudança de idioma. 11 | 12 | 13 | This master has already been selected for the "%s" calendar! 14 | Este mestre já foi seleccionado para o calendário "%s"! 15 | 16 | 17 | Language 18 | Idioma 19 | 20 | 21 | Please enter the page language according to the ISO-639-1 standard (e.g. "en" for English or "en-US" for American English). 22 | Por favor introduza a língua da página de acordo com a norma ISO-639-1 (por exemplo "en" para inglês ou "en-US" para inglês americano). 23 | 24 | 25 | Language settings 26 | Configurações de idioma 27 | 28 | 29 | This is a master calendar 30 | Este é um calendário principal 31 | 32 | 33 | Master calendar is "%s" 34 | O calendário principal é "%s". 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /contao/languages/pt/tl_module.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Hide active language 6 | Esconder linguagem activa 7 | 8 | 9 | Please check here if you want to hide the active language on your site. 10 | Verifique aqui se pretende esconder a língua activa no seu site. 11 | 12 | 13 | Hide languages without direct fallback 14 | Esconder línguas sem recuo directo 15 | 16 | 17 | Do not show languages that have no direct fallback assigned. 18 | Não mostre línguas que não tenham sido atribuídas directamente a um fallback. 19 | 20 | 21 | Custom language texts 22 | Textos linguísticos personalizados 23 | 24 | 25 | Please check here if you want to have custom texts for your languages (not uppercase language 26 | shortcuts). 27 | Verifique aqui se deseja ter textos personalizados para as suas línguas (e não para a língua em maiúsculas atalhos). 28 | 29 | 30 | Language texts 31 | Textos de idiomas 32 | 33 | 34 | Enter the page language as key and a replacement text as value. 35 | 36 | 37 | 38 | --------------------------------------------------------------------------------