[issue 5440] fix rtl direction bug for full language codes
This commit is contained in:
parent
251b2cae2c
commit
e2c001c19d
@ -123,7 +123,11 @@
|
|||||||
// http://www.w3.org/International/questions/qa-scripts
|
// http://www.w3.org/International/questions/qa-scripts
|
||||||
// Arabic, Hebrew, Farsi, Pashto, Urdu
|
// Arabic, Hebrew, Farsi, Pashto, Urdu
|
||||||
var rtlList = ['ar', 'he', 'fa', 'ps', 'ur'];
|
var rtlList = ['ar', 'he', 'fa', 'ps', 'ur'];
|
||||||
return (rtlList.indexOf(gLanguage) >= 0 ? 'rtl' : 'ltr');
|
|
||||||
|
// use the short language code for "full" codes like 'ar-sa' (issue 5440)
|
||||||
|
var shortCode = gLanguage.split('-')[0];
|
||||||
|
|
||||||
|
return (rtlList.indexOf(shortCode) >= 0) ? 'rtl' : 'ltr';
|
||||||
},
|
},
|
||||||
|
|
||||||
// translate an element or document fragment
|
// translate an element or document fragment
|
||||||
|
6
external/webL10n/l10n.js
vendored
6
external/webL10n/l10n.js
vendored
@ -977,7 +977,11 @@ document.webL10n = (function(window, document, undefined) {
|
|||||||
// http://www.w3.org/International/questions/qa-scripts
|
// http://www.w3.org/International/questions/qa-scripts
|
||||||
// Arabic, Hebrew, Farsi, Pashto, Urdu
|
// Arabic, Hebrew, Farsi, Pashto, Urdu
|
||||||
var rtlList = ['ar', 'he', 'fa', 'ps', 'ur'];
|
var rtlList = ['ar', 'he', 'fa', 'ps', 'ur'];
|
||||||
return (rtlList.indexOf(gLanguage) >= 0) ? 'rtl' : 'ltr';
|
|
||||||
|
// use the short language code for "full" codes like 'ar-sa' (issue 5440)
|
||||||
|
var shortCode = gLanguage.split('-')[0];
|
||||||
|
|
||||||
|
return (rtlList.indexOf(shortCode) >= 0) ? 'rtl' : 'ltr';
|
||||||
},
|
},
|
||||||
|
|
||||||
// translate an element or document fragment
|
// translate an element or document fragment
|
||||||
|
Loading…
Reference in New Issue
Block a user