Merge pull request #35 from pranavk/fix_lang_Tags
Fix language tags that are fed to loleaflet
This commit is contained in:
commit
c49a7c7331
@ -129,7 +129,7 @@ var documentsMain = {
|
||||
var urlsrc = documentsMain.urlsrc +
|
||||
"WOPISrc=" + wopisrc +
|
||||
"&title=" + encodeURIComponent(title) +
|
||||
"&lang=" + OC.getLocale() +
|
||||
"&lang=" + OC.getLocale().replace('_', '-') + // loleaflet expects a BCP47 language tag syntax
|
||||
"&permission=readonly";
|
||||
|
||||
// access_token - must be passed via a form post
|
||||
@ -320,7 +320,7 @@ var documentsMain = {
|
||||
var urlsrc = documentsMain.urlsrc +
|
||||
"WOPISrc=" + wopisrc +
|
||||
"&title=" + encodeURIComponent(title) +
|
||||
"&lang=" + OC.getLocale() +
|
||||
"&lang=" + OC.getLocale().replace('_', '-') + // loleaflet expects a BCP47 language tag syntax
|
||||
"&closebutton=1" +
|
||||
"&revisionhistory=1";
|
||||
if (!documentsMain.canEdit || action === "view") {
|
||||
|
@ -233,13 +233,8 @@ class DocumentController extends Controller {
|
||||
if ($content && $view->file_put_contents($path, $content)) {
|
||||
$info = $view->getFileInfo($path);
|
||||
$ret = $this->wopiParser->getUrlSrc($mimetype);
|
||||
$lolang = strtolower(str_replace('_', '-', $this->settings->getUserValue($this->uid, 'core', 'lang', 'en')));
|
||||
$response = array(
|
||||
'status' => 'success',
|
||||
'fileid' => $info['fileid'] . '_' . $this->settings->getSystemValue('instanceid'),
|
||||
'urlsrc' => $ret['urlsrc'],
|
||||
'action' => $ret['action'],
|
||||
'lolang' => $lolang,
|
||||
'data' => \OCA\Files\Helper::formatFileInfo($info)
|
||||
);
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user