set the correct language tag expected by JS

(cherry picked from commit b565415e1c223afd690ce62aa9604aabe86b31a2)
Signed-off-by: Andras Timar <andras.timar@collabora.com>
This commit is contained in:
Andras Timar 2017-01-18 10:08:18 +01:00
parent f74b0b3018
commit 1cc5e43106

View File

@ -231,12 +231,13 @@ 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'], 'fileid' => $info['fileid'],
'urlsrc' => $ret['urlsrc'], 'urlsrc' => $ret['urlsrc'],
'action' => $ret['action'], 'action' => $ret['action'],
'lolang' => $this->settings->getUserValue($this->uid, 'core', 'lang', 'en'), 'lolang' => $lolang,
'data' => \OCA\Files\Helper::formatFileInfo($info) 'data' => \OCA\Files\Helper::formatFileInfo($info)
); );
} else { } else {