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