Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #12641 : cannot add translations to eng-GB #69

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion kernel/common/ezi18noperator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
5 changes: 2 additions & 3 deletions kernel/common/ezpi18n.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand Down
3 changes: 3 additions & 0 deletions settings/site.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down