Fix getting interface_language - refs BT#10175

1.10.x
Angel Fernando Quiroz Campos 10 years ago
parent 0ddfccb252
commit 2a6ec3126e
  1. 22
      main/inc/lib/internationalization.lib.php
  2. 2
      src/Chamilo/CoreBundle/Component/Editor/Editor.php

@ -195,16 +195,22 @@ function api_get_interface_language($purified = false, $check_sub_language = fal
$language_id = api_get_language_id($language_interface);
$language_info = api_get_language_info($language_id);
if (!empty($language_id) &&
!empty($language_info) &&
!empty($language_info['parent_id'])) {
$language_info = api_get_language_info($language_info['parent_id']);
$parent_language_name = $language_info['english_name'];
if (!empty($parent_language_name)) {
return $parent_language_name;
if (
!empty($language_id) &&
!empty($language_info)
) {
if (!empty($language_info['parent_id'])) {
$language_info = api_get_language_info($language_info['parent_id']);
$parent_language_name = $language_info['english_name'];
if (!empty($parent_language_name)) {
return $parent_language_name;
}
}
return $language_info['english_name'];
}
return 'english';
} else {
return $parent_language_name;

@ -241,6 +241,6 @@ class Editor
*/
public function getLocale()
{
return 'en';
return api_get_language_isocode();
}
}

Loading…
Cancel
Save