 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 | 
| @@ -43,10 +43,22 @@ | 
| }, | 
| get appLocale() | 
| { | 
| - let locale = ext.i18n.getMessage("@@ui_locale").replace(/_/g, "-"); | 
| + let locale = ext.i18n.getUILanguage(); | 
| Object.defineProperty(this, "appLocale", {value: locale, enumerable: true}); | 
| return this.appLocale; | 
| }, | 
| + get readingDirection() | 
| + { | 
| + let direction = ext.i18n.getMessage("@@bidi_dir"); | 
| 
kzar
2017/08/30 11:54:09
Shouldn't we also make use of this.readingDirectio
 
kzar
2017/08/30 13:55:02
Argh, disregard that! I see how this works now, we
 | 
| + if (!direction) | 
| 
kzar
2017/08/30 11:54:09
Nit: Please use braces since it spans multiple lin
 
Sebastian Noack
2017/08/30 16:28:24
I'd rather just move the comment above.
 
Oleksandr
2017/08/30 23:00:36
Done.
 | 
| + // This fallback is only necessary for Microsoft Edge | 
| + direction = /^(?:ar|fa|he|ug|ur)\b/.test(this.appLocale) ? "rtl" : "ltr"; | 
| 
kzar
2017/08/30 11:54:09
(I assume Sebastian checked this regexp, I have no
 
Sebastian Noack
2017/08/30 16:28:24
For reference, this is the regular expression we u
 
Oleksandr
2017/08/30 23:00:36
Based on the list here: https://msdn.microsoft.com
 | 
| + Object.defineProperty( | 
| + this, | 
| + "readingDirection", | 
| + {value: direction, enumerable: true}); | 
| 
kzar
2017/08/30 11:54:09
Nit: Please put the closing parenthesis on the fol
 | 
| + return this.readingDirection; | 
| + }, | 
| generateChecksum(lines) | 
| { | 
| // We cannot calculate MD5 checksums yet :-( |