[CRM-17662] Cannot use Russian or Ukranian translations with native gettext Created: 03/Dec/15 Updated: 11/Dec/15 Status: Project: Component/s: Affects Version/s: Fix Version/s: Open CiviCRM Internationalisation 4.6.10 Type: Reporter: Resolution: Labels: Remaining Estimate: Time Spent: Original Estimate: Bug Christopher Gervais Unresolved i18n Not Specified Attachments: None Priority: Assignee: Votes: Minor Mathieu Lutfy 0 Not Specified Not Specified CRM-17662_0.patch None Documentation Required?: Needs Funding Funding Source (see https://civicrm.org/issuequeue): Description I get the following notices, and translation don't work for certain languages: Notice: Undefined index: ru in CRM_Core_I18n_PseudoConstant::longForShort() I've only seen this affect Russian (ru_RU) and Ukranian (uk_UA), but my sample size was only 5, so I suspect this is broader. I fixed this locally by adding the following lines to `longForShortMapping()` in `sites/all/modules/civicrm/CRM/Core/I18n/PseudoConstant.php`: $longForShortMapping['ru'] = 'ru_RU'; $longForShortMapping['uk'] = 'uk_UA'; Comments Comment by David Greenberg [ 03/Dec/15 ] Can u take a look at this? Comment by Christopher Gervais [ 04/Dec/15 ] Basic patch. It doesn't seem like listing individual locales this way is easily maintainable though. Comment by Mathieu Lutfy [ 04/Dec/15 ] Hi Chris, Thanks for the patch. This list is only necessary for languages that have regional translations, but there aren't tons of them (en, fr, es, pt, ar). Normally this mapping is only for cases where we need to override the mapping that assumes "xx" => "xx_XX". It is used for when the CMS uses "inherit CMS language" in the locale options, because Drupal only has locales in short format "ru", not full format, such as ru_RU (see: CRM/Utils/System/DrupalBase.php getUFLocale). It is probably necessary for UK, but not for RU? (because ru => ru_RU). Might also be necessary for Arabic, because we're using ar_EG as the main Arabic translation. Mathieu Comment by Mathieu Lutfy [ 11/Dec/15 ] @ergonlogic: could you check if the languages were enabled in the "languages" option list? ex: go to /civicrm/admin/options?reset=1 then search for "languages", then click "options" I think that Russian is enabled by default, but Ukrainian is not. This points to a larger problem: when we enable a language, we need to make sure that the option value is enabled. Also, this "list of languages" screen is rather important, but not exposed in the navigation menus. Generated at Tue Feb 09 16:24:14 UTC 2016 using JIRA 6.2#6252sha1:aa343257d4ce030d9cb8c531be520be9fac1c996.