Set locale of viewer to locale of Nextcloud.
This avoids differences in the language of Nextcloud and the viewer if the browser lanuage is different from the language of the Nextcloud user.
This commit is contained in:
parent
195434fc28
commit
c268cd1cad
1 changed files with 8 additions and 0 deletions
|
|
@ -87,6 +87,14 @@ if (OCA.FilesPdfViewer && OCA.FilesPdfViewer.PreviewPlugin) {
|
|||
};
|
||||
}
|
||||
|
||||
document.addEventListener("webviewerloaded", function(event) {
|
||||
var locale = OC.getLocale();
|
||||
if (locale && event.detail && event.detail.source && event.detail.source.PDFViewerApplicationOptions) {
|
||||
var PDFViewerApplicationOptions = event.detail.source.PDFViewerApplicationOptions;
|
||||
PDFViewerApplicationOptions.set('locale', locale.replace('_', '-'));
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
if (OCA.Sharing && OCA.Sharing.PublicApp) {
|
||||
var mimetype = $("#mimetype");
|
||||
|
|
|
|||
Loading…
Reference in a new issue