Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/richdocuments.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPéter Tóth <13013768+totpet@users.noreply.github.com>2019-02-17 01:45:49 +0300
committerPéter Tóth <13013768+totpet@users.noreply.github.com>2019-02-27 18:24:44 +0300
commitb102d97282cb512548e8820d71b67c34f093f665 (patch)
tree99f63dee4d5c642e3b0aeb6c132137291c9284ab /js/documents.js
parent4214e66e7161a2d157a49fef7ced523f519182df (diff)
Fixes #381: use language instead of locale
Signed-off-by: Péter Tóth <13013768+totpet@users.noreply.github.com>
Diffstat (limited to 'js/documents.js')
-rw-r--r--js/documents.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/js/documents.js b/js/documents.js
index 138604f7..5d0cc179 100644
--- a/js/documents.js
+++ b/js/documents.js
@@ -176,6 +176,10 @@ var documentsMain = {
return parent.OCA.Files.FileList;
}
return null;
+ },
+
+ getLanguage: function() {
+ return OC.getLanguage ? OC.getLanguage() : OC.getLocale();
},
UI : {
@@ -388,7 +392,7 @@ var documentsMain = {
var urlsrc = documentsMain.urlsrc +
"WOPISrc=" + wopisrc +
"&title=" + encodeURIComponent(title) +
- "&lang=" + OC.getLocale().replace('_', '-') + // loleaflet expects a BCP47 language tag syntax
+ "&lang=" + documentsMain.getLanguage().replace('_', '-') + // loleaflet expects a BCP47 language tag syntax
"&permission=readonly";
// access_token - must be passed via a form post
@@ -580,7 +584,7 @@ var documentsMain = {
var urlsrc = documentsMain.urlsrc +
"WOPISrc=" + wopisrc +
"&title=" + encodeURIComponent(title) +
- "&lang=" + OC.getLocale().replace(/^([a-z]{2}).*_([A-Z]{2})$/, function(match, p1, p2) {return p1 + '-' + p2.toLowerCase();}) + // loleaflet expects a BCP47 language tag syntax
+ "&lang=" + documentsMain.getLanguage().replace(/^([a-z]{2}).*_([A-Z]{2})$/, function(match, p1, p2) {return p1 + '-' + p2.toLowerCase();}) + // loleaflet expects a BCP47 language tag syntax
"&closebutton=1" +
"&revisionhistory=1";
if (!documentsMain.canEdit || action === "view") {