diff --git a/CRM/Core/I18n.php b/CRM/Core/I18n.php index 57877c96a5cd..be23d592ff0c 100644 --- a/CRM/Core/I18n.php +++ b/CRM/Core/I18n.php @@ -774,10 +774,6 @@ function ts($text, $params = []) { $function = $config->customTranslateFunction; } } - else { - // don't _translate_ anything until bootstrap has progressed enough - $params['skip_translation'] = 1; - } } $activeLocale = CRM_Core_I18n::getLocale(); diff --git a/tests/phpunit/E2E/Core/LocalizedDataTest.php b/tests/phpunit/E2E/Core/LocalizedDataTest.php new file mode 100644 index 000000000000..a1d13189715a --- /dev/null +++ b/tests/phpunit/E2E/Core/LocalizedDataTest.php @@ -0,0 +1,41 @@ +getPath("[civicrm.root]/sql/civicrm_data.{$locale}.mysql"); + $this->assertFileExists($path); + return file_get_contents($path); + }; + $sqls = [ + 'de_DE' => $getSql('de_DE'), + 'fr_FR' => $getSql('fr_FR'), + ]; + $pats = [ + 'de_DE' => '/new_organization.*Neue Organisation/i', + 'fr_FR' => '/new_organization.*Nouvelle organisation/i', + ]; + + $match = function($sqlLocale, $patLocale) use ($pats, $sqls) { + return (bool) preg_match($pats[$patLocale], $sqls[$sqlLocale]); + }; + + $this->assertTrue($match('de_DE', 'de_DE'), 'The German SQL should match the German pattern.'); + $this->assertTrue($match('fr_FR', 'fr_FR'), 'The French SQL should match the French pattern.'); + $this->assertFalse($match('de_DE', 'fr_FR'), 'The German SQL should not match the French pattern.'); + $this->assertFalse($match('fr_FR', 'de_DE'), 'The French SQL should not match the German pattern.'); + } + +}