Skip to content
Snippets Groups Projects
Commit cbb2e021 authored by xurizaemon's avatar xurizaemon
Browse files

Lang code restructure from 1c9f455c, applied to Drupal6.php

parent a5ecff8d
Branches
Tags
No related merge requests found
......@@ -615,20 +615,26 @@ SELECT name, mail
function getUFLocale() {
// return CiviCRM’s xx_YY locale that either matches Drupal’s Chinese locale
// (for CRM-6281), Drupal’s xx_YY or is retrieved based on Drupal’s xx
// sometimes for CLI based on order called, this might not be set and/or empty
global $language;
switch (TRUE) {
case $language->language == 'zh-hans':
return 'zh_CN';
case $language->language == 'zh-hant':
return 'zh_TW';
if (empty($language)) {
return NULL;
}
case preg_match('/^.._..$/', $language->language):
return $language->language;
if ($language->language == 'zh-hans') {
return 'zh_CN';
}
default:
return CRM_Core_I18n_PseudoConstant::longForShort(substr($language->language, 0, 2));
if ($language->language == 'zh-hant') {
return 'zh_TW';
}
if (preg_match('/^.._..$/', $language->language)) {
return $language->language;
}
return CRM_Core_I18n_PseudoConstant::longForShort(substr($language->language, 0, 2));
}
function getVersion() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment