 Issue 29338190:
  Issue 3697 - Fall back to i18n.getUILanguage if @ui_locale isn't supported  (Closed)
    
  
    Issue 29338190:
  Issue 3697 - Fall back to i18n.getUILanguage if @ui_locale isn't supported  (Closed) 
  | Index: lib/utils.js | 
| =================================================================== | 
| --- a/lib/utils.js | 
| +++ b/lib/utils.js | 
| @@ -44,10 +44,23 @@ | 
| }, | 
| get appLocale() | 
| { | 
| - var locale = ext.i18n.getMessage("@@ui_locale").replace(/_/g, "-"); | 
| + var locale = ext.i18n.getMessage("@@ui_locale"); | 
| + if (locale == "") { | 
| + locale = ext.i18n.getUILanguage(); | 
| + } | 
| + locale = locale.replace(/_/g, "-"); | 
| Object.defineProperty(this, "appLocale", {value: locale, enumerable: true}); | 
| return this.appLocale; | 
| }, | 
| + get readingDirection() | 
| + { | 
| + var direction = ext.i18n.getMessage("@@bidi_dir"); | 
| + if (direction == "") { | 
| 
Sebastian Noack
2016/05/12 22:14:29
Nit: I would rather check for !direction, this rea
 
Sebastian Noack
2016/05/12 22:14:30
Nit: Braces aren't required according to our codin
 | 
| + direction = /^(ar|fa|he|ug|ur)(_|$)/.test(this.appLocale) ? "rtl" : "ltr"; | 
| + } | 
| + Object.defineProperty(this, "readingDirection", {value: direction, enumerable: true}); | 
| + return this.readingDirection; | 
| + }, | 
| generateChecksum: function(lines) | 
| { | 
| // We cannot calculate MD5 checksums yet :-( |