From 214c0535992112599230e2f484de8545cb0065bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthieu=20S=C3=A9v=C3=A8re?= Date: Wed, 1 Jun 2011 13:57:18 +0200 Subject: [PATCH 1/2] Fix 12641 : english not translatable --- kernel/common/ezi18noperator.php | 2 +- settings/site.ini | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/kernel/common/ezi18noperator.php b/kernel/common/ezi18noperator.php index ac24e18dd15..ed9b0278fc8 100644 --- a/kernel/common/ezi18noperator.php +++ b/kernel/common/ezi18noperator.php @@ -116,7 +116,7 @@ function i18nTrans( $operatorName, &$node, $tpl, &$resourceData, if ( $ini->variable( 'RegionalSettings', 'TextTranslation' ) != 'disabled' ) { $language = eZLocale::instance()->localeFullCode(); - if ( $language != "eng-GB" ) // eng-GB does not need translation + if ( $language != $ini->variable( 'RegionalSettings', 'Basei18nLocale' ) ) { $file = 'translation.ts'; $ini = eZINI::instance(); diff --git a/settings/site.ini b/settings/site.ini index ac596f52f3e..8d1a6fde745 100644 --- a/settings/site.ini +++ b/settings/site.ini @@ -864,6 +864,9 @@ OverrideSiteDesign=standard [RegionalSettings] # The locale for your site Locale=eng-GB +# Text will not be translated with i18n operator on base i18n locale +# Leave empty if you want to use i18n translation on every locale +Basei18nLocale=eng-GB # Set this if the http locale in the locale is wrong HTTPLocale= # Set this if you want to run the entire PHP system in a given From 3bbd184d79b0a0d75c56dfeb060b7093f0244cac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthieu=20S=C3=A9v=C3=A8re?= Date: Mon, 10 Oct 2011 14:41:14 +0200 Subject: [PATCH 2/2] Forgot one instance of hard coded locale --- kernel/common/ezpi18n.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/kernel/common/ezpi18n.php b/kernel/common/ezpi18n.php index f5b31776991..26a7808ed49 100644 --- a/kernel/common/ezpi18n.php +++ b/kernel/common/ezpi18n.php @@ -93,14 +93,13 @@ public static function tr( $context, $source, $comment = null, $arguments = null */ protected static function translateText( $context, $source, $comment = null, $arguments = null ) { + $ini = eZINI::instance(); $localeCode = eZLocale::instance()->localeFullCode(); - if ( $localeCode == 'eng-GB' ) + if ( $localeCode == $ini->variable( 'RegionalSettings', 'Basei18nLocale' ) ) { - // we don't have ts-file for 'eng-GB'. return self::insertArguments( $source, $arguments ); } - $ini = eZINI::instance(); $useCache = $ini->variable( 'RegionalSettings', 'TranslationCache' ) != 'disabled'; eZTSTranslator::initialize( $context, $localeCode, 'translation.ts', $useCache );