Index: lib/utils.js |
=================================================================== |
--- a/lib/utils.js |
+++ b/lib/utils.js |
@@ -43,10 +43,21 @@ |
}, |
get appLocale() |
{ |
- let locale = ext.i18n.getMessage("@@ui_locale").replace(/_/g, "-"); |
+ let locale = ext.i18n.getUILanguage().replace(/_/g, "-"); |
Object.defineProperty(this, "appLocale", {value: locale, enumerable: true}); |
return this.appLocale; |
}, |
+ get readingDirection() |
+ { |
+ let direction = ext.i18n.getMessage("@@bidi_dir"); |
+ if (!direction) |
Sebastian Noack
2017/08/26 07:16:47
We probably should add a comment that this fallbac
|
+ direction = /^(ar|fa|he|ug|ur)(_|$)/.test(this.appLocale) ? "rtl" : "ltr"; |
+ Object.defineProperty( |
+ this, |
+ "readingDirection", |
+ {value: direction, enumerable: true}); |
+ return this.readingDirection; |
+ }, |
generateChecksum(lines) |
{ |
// We cannot calculate MD5 checksums yet :-( |