Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

API CHANGE Don't use $tinymce_lang lookup in i18n::get_lang_from_loca…

…le(), as it mixes locales with langs and hence breaks language fallbacks in _t() (e.g. "pt_BR" returns "pt_br", rather than "pt")
  • Loading branch information...
commit a44916dc19f9d15be76420e5842ab50ab8dbb227 1 parent c2797f3
@chillu chillu authored
Showing with 2 additions and 11 deletions.
  1. +2 −11 i18n/i18n.php
View
13 i18n/i18n.php
@@ -1742,22 +1742,13 @@ static function get_translatable_modules() {
/**
* Returns the "short" language name from a locale,
- * e.g. "en_US" would return "en". This conversion
- * is determined internally by the {@link $tinymce_lang}
- * lookup table. If no match can be found in this lookup,
- * the characters before the underscore ("_") are returned.
- *
- * @todo More generic lookup table, don't rely on tinymce specific conversion
+ * e.g. "en_US" would return "en".
*
* @param string $locale E.g. "en_US"
* @return string Short language code, e.g. "en"
*/
static function get_lang_from_locale($locale) {
- if(isset(self::$tinymce_lang[$locale])) {
- return self::$tinymce_lang[$locale];
- } else {
- return preg_replace('/(_|-).*/', '', $locale);
- }
+ return preg_replace('/(_|-).*/', '', $locale);
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.