mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update dynamic localization
This commit is contained in:
parent
171f241ac3
commit
3f851e9d0b
1 changed files with 14 additions and 5 deletions
|
@ -74,6 +74,13 @@ var Dashboard = {
|
||||||
|
|
||||||
filterHtml: function (html) {
|
filterHtml: function (html) {
|
||||||
|
|
||||||
|
// replace the first instance
|
||||||
|
html = html.replace('<!--', '');
|
||||||
|
|
||||||
|
// replace the last instance
|
||||||
|
// https://stackoverflow.com/questions/29188409/how-do-i-replace-the-last-occurance-of-a-variable-in-a-string
|
||||||
|
html = html.replace(new RegExp("(.*)" + '-->'), "");
|
||||||
|
|
||||||
return Globalize.translateDocument(html, 'html');
|
return Globalize.translateDocument(html, 'html');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -2066,9 +2073,6 @@ var AppInfo = {};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
var pageContainer = document.querySelector('.pageContainer');
|
|
||||||
var pageContainerInnerHtml = pageContainer ? pageContainer.innerHTML : '';
|
|
||||||
|
|
||||||
function onConnectionManagerCreated(deferred) {
|
function onConnectionManagerCreated(deferred) {
|
||||||
|
|
||||||
Globalize.ensure().done(function () {
|
Globalize.ensure().done(function () {
|
||||||
|
@ -2076,8 +2080,13 @@ var AppInfo = {};
|
||||||
|
|
||||||
document.title = Globalize.translateDocument(document.title, 'html');
|
document.title = Globalize.translateDocument(document.title, 'html');
|
||||||
|
|
||||||
if (pageContainer) {
|
var mainDrawerPanelContent = document.querySelector('.mainDrawerPanelContent');
|
||||||
pageContainer.innerHTML = Globalize.translateDocument(pageContainerInnerHtml, 'html');
|
|
||||||
|
if (mainDrawerPanelContent) {
|
||||||
|
var newHtml = mainDrawerPanelContent.innerHTML.substring(4);
|
||||||
|
newHtml = newHtml.substring(0, newHtml.length - 3);
|
||||||
|
|
||||||
|
mainDrawerPanelContent.innerHTML = Globalize.translateDocument(newHtml, 'html');
|
||||||
}
|
}
|
||||||
|
|
||||||
onDocumentReady();
|
onDocumentReady();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue