diff --git a/Makefile b/Makefile index f5cdefd9..d6ce8b60 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -VERSION=0.15.1 +VERSION=0.15.2 .PHONY: dist dist: owncloud-collabora-online.spec info.xml diff --git a/controller/documentcontroller.php b/controller/documentcontroller.php index ff8e3b91..d0f4d37a 100644 --- a/controller/documentcontroller.php +++ b/controller/documentcontroller.php @@ -256,7 +256,8 @@ class DocumentController extends Controller { $response = array( 'status' => 'success', 'fileid' => $info['fileid'], - 'urlsrc' => $this->getWopiSrcUrl($discovery_parsed, $mimetype, 'edit') + 'urlsrc' => $this->getWopiSrcUrl($discovery_parsed, $mimetype, 'edit'), + 'lolang' => $this->settings->getUserValue($this->uid, 'core', 'lang', 'en') ); } else { $response = array( @@ -471,6 +472,7 @@ class DocumentController extends Controller { $documents[$key]['icon'] = preg_replace('/\.png$/', '.svg', \OCP\Template::mimetype_icon($document['mimetype'])); $documents[$key]['hasPreview'] = \OC::$server->getPreviewManager()->isMimeSupported($document['mimetype']); $documents[$key]['urlsrc'] = $this->getWopiSrcUrl($discovery_parsed, $document['mimetype'], 'edit'); + $documents[$key]['lolang'] = strtolower(str_replace('_', '-', $this->settings->getUserValue($this->uid, 'core', 'lang', 'en'))); $fileIds[] = $document['fileid']; } diff --git a/js/documents.js b/js/documents.js index 28157242..cb524131 100644 --- a/js/documents.js +++ b/js/documents.js @@ -32,6 +32,7 @@ $.widget('oc.documentGrid', { .attr('title', document.path) .attr('original-title', document.path) .attr('urlsrc', document.urlsrc) + .attr('lolang', document.lolang) .find('label').text(document.name) ; @@ -234,6 +235,7 @@ var documentsMain = { var urlsrc = $('li[data-id='+ documentsMain.fileId +']>a').attr('urlsrc') + "WOPISrc=" + wopisrc + "&title=" + encodeURIComponent(title) + + "&lang=" + $('li[data-id='+ documentsMain.fileId +']>a').attr('lolang') + "&closebutton=1"; // access_token - must be passed via a form post @@ -466,6 +468,7 @@ var documentsMain = { if (response && response.fileid){ docElem.attr('data-id', response.fileid); docElem.find('a').attr('urlsrc', response.urlsrc); + docElem.find('a').attr('lolang', response.lolang); documentsMain.prepareSession(); documentsMain.joinSession(response.fileid); } else { diff --git a/templates/admin.php b/templates/admin.php index ee99f77c..869bd728 100644 --- a/templates/admin.php +++ b/templates/admin.php @@ -4,7 +4,7 @@ script('richdocuments', 'admin');

t('Collabora Online')) ?>

- +
t('URL (and port) of the Collabora Online server that provides the editing functionality as a WOPI client.')) ?>