1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

update some strings and use fetch for the global config

This commit is contained in:
dkanada 2020-02-16 22:11:36 +09:00
parent ea9e79f4d3
commit ed1b35f50f
8 changed files with 34 additions and 53 deletions

View file

@ -278,7 +278,7 @@ define(["appSettings", "browser", "events", "htmlMediaHelper", "webSettings"], f
features.push("targetblank"); features.push("targetblank");
features.push("screensaver"); features.push("screensaver");
if (webSettings.getMultiserver()) { if (webSettings.getMultiServer()) {
features.push("multiserver") features.push("multiserver")
} }

View file

@ -63,7 +63,7 @@
<div class="selectContainer fldDateTimeLocale hide"> <div class="selectContainer fldDateTimeLocale hide">
<select is="emby-select" class="selectDateTimeLocale" label="${LabelDateTimeLocale}"> <select is="emby-select" class="selectDateTimeLocale" label="${LabelDateTimeLocale}">
<option value="">${AutoBasedOnLanguageSetting}</option> <option value="">${Auto}</option>
<option value="ar">Arabic</option> <option value="ar">Arabic</option>
<option value="be-BY">Belarusian (Belarus)</option> <option value="be-BY">Belarusian (Belarus)</option>
<option value="bg-BG">Bulgarian (Bulgaria)</option> <option value="bg-BG">Bulgarian (Bulgaria)</option>

View file

@ -1,4 +1,4 @@
define(['apphost', 'userSettings', 'browser', 'events', 'pluginManager', 'backdrop', 'globalize', 'require', 'appSettings'], function (appHost, userSettings, browser, events, pluginManager, backdrop, globalize, require, appSettings) { define(['apphost', 'userSettings', 'browser', 'events', 'pluginManager', 'backdrop', 'globalize', 'require', 'appSettings', 'webSettings'], function (appHost, userSettings, browser, events, pluginManager, backdrop, globalize, require, appSettings, webSettings) {
'use strict'; 'use strict';
var themeStyleElement; var themeStyleElement;
@ -116,8 +116,8 @@ define(['apphost', 'userSettings', 'browser', 'events', 'pluginManager', 'backdr
var linkUrl = info.stylesheetPath; var linkUrl = info.stylesheetPath;
unloadTheme(); unloadTheme();
var link = document.createElement('link');
var link = document.createElement('link');
link.setAttribute('rel', 'stylesheet'); link.setAttribute('rel', 'stylesheet');
link.setAttribute('type', 'text/css'); link.setAttribute('type', 'text/css');
link.onload = function () { link.onload = function () {

View file

@ -2,15 +2,11 @@ define(['require', 'globalize', 'appSettings', 'apphost', 'focusManager', 'loadi
"use strict"; "use strict";
function populateLanguages(select, languages) { function populateLanguages(select, languages) {
var html = ""; var html = "";
html += "<option value=''>" + globalize.translate('AnyLanguage') + "</option>"; html += "<option value=''>" + globalize.translate('AnyLanguage') + "</option>";
for (var i = 0, length = languages.length; i < length; i++) { for (var i = 0, length = languages.length; i < length; i++) {
var culture = languages[i]; var culture = languages[i];
html += "<option value='" + culture.ThreeLetterISOLanguageName + "'>" + culture.DisplayName + "</option>"; html += "<option value='" + culture.ThreeLetterISOLanguageName + "'>" + culture.DisplayName + "</option>";
} }
@ -18,7 +14,6 @@ define(['require', 'globalize', 'appSettings', 'apphost', 'focusManager', 'loadi
} }
function getSubtitleAppearanceObject(context) { function getSubtitleAppearanceObject(context) {
var appearanceSettings = {}; var appearanceSettings = {};
appearanceSettings.textSize = context.querySelector('#selectTextSize').value; appearanceSettings.textSize = context.querySelector('#selectTextSize').value;
@ -102,14 +97,12 @@ define(['require', 'globalize', 'appSettings', 'apphost', 'focusManager', 'loadi
} }
function onSubmit(e) { function onSubmit(e) {
var self = this; var self = this;
var apiClient = connectionManager.getApiClient(self.options.serverId); var apiClient = connectionManager.getApiClient(self.options.serverId);
var userId = self.options.userId; var userId = self.options.userId;
var userSettings = self.options.userSettings; var userSettings = self.options.userSettings;
userSettings.setUserInfo(userId, apiClient).then(function () { userSettings.setUserInfo(userId, apiClient).then(function () {
var enableSaveConfirmation = self.options.enableSaveConfirmation; var enableSaveConfirmation = self.options.enableSaveConfirmation;
save(self, self.options.element, userId, userSettings, apiClient, enableSaveConfirmation); save(self, self.options.element, userId, userSettings, apiClient, enableSaveConfirmation);
}); });
@ -118,6 +111,7 @@ define(['require', 'globalize', 'appSettings', 'apphost', 'focusManager', 'loadi
if (e) { if (e) {
e.preventDefault(); e.preventDefault();
} }
return false; return false;
} }
@ -197,9 +191,7 @@ define(['require', 'globalize', 'appSettings', 'apphost', 'focusManager', 'loadi
var userSettings = self.options.userSettings; var userSettings = self.options.userSettings;
apiClient.getUser(userId).then(function (user) { apiClient.getUser(userId).then(function (user) {
userSettings.setUserInfo(userId, apiClient).then(function () { userSettings.setUserInfo(userId, apiClient).then(function () {
self.dataLoaded = true; self.dataLoaded = true;
var appearanceSettings = userSettings.getSubtitleAppearanceSettings(self.options.appearanceKey); var appearanceSettings = userSettings.getSubtitleAppearanceSettings(self.options.appearanceKey);
@ -214,9 +206,8 @@ define(['require', 'globalize', 'appSettings', 'apphost', 'focusManager', 'loadi
}; };
SubtitleSettings.prototype.destroy = function () { SubtitleSettings.prototype.destroy = function () {
this.options = null; this.options = null;
}; };
return SubtitleSettings; return SubtitleSettings;
}); });

View file

@ -1,7 +1,5 @@
<form style="margin:0 auto;"> <form style="margin:0 auto;">
<div class="verticalSection"> <div class="verticalSection">
<h2 class="sectionTitle"> <h2 class="sectionTitle">
${Subtitles} ${Subtitles}
</h2> </h2>
@ -9,6 +7,7 @@
<div class="selectContainer"> <div class="selectContainer">
<select is="emby-select" id="selectSubtitleLanguage" label="${LabelPreferredSubtitleLanguage}"></select> <select is="emby-select" id="selectSubtitleLanguage" label="${LabelPreferredSubtitleLanguage}"></select>
</div> </div>
<div class="selectContainer"> <div class="selectContainer">
<select is="emby-select" id="selectSubtitlePlaybackMode" label="${LabelSubtitlePlaybackMode}"> <select is="emby-select" id="selectSubtitlePlaybackMode" label="${LabelSubtitlePlaybackMode}">
<option value="Default">${Default}</option> <option value="Default">${Default}</option>
@ -23,6 +22,7 @@
<div class="fieldDescription subtitlesOnlyForcedHelp subtitlesHelp hide">${OnlyForcedSubtitlesHelp}</div> <div class="fieldDescription subtitlesOnlyForcedHelp subtitlesHelp hide">${OnlyForcedSubtitlesHelp}</div>
<div class="fieldDescription subtitlesNoneHelp subtitlesHelp hide">${NoSubtitlesHelp}</div> <div class="fieldDescription subtitlesNoneHelp subtitlesHelp hide">${NoSubtitlesHelp}</div>
</div> </div>
<div class="selectContainer fldBurnIn hide"> <div class="selectContainer fldBurnIn hide">
<select is="emby-select" id="selectSubtitleBurnIn" label="${LabelBurnSubtitles}"> <select is="emby-select" id="selectSubtitleBurnIn" label="${LabelBurnSubtitles}">
<option value="">${Auto}</option> <option value="">${Auto}</option>
@ -34,7 +34,6 @@
</div> </div>
<div class="verticalSection subtitleAppearanceSection hide"> <div class="verticalSection subtitleAppearanceSection hide">
<h2 class="sectionTitle"> <h2 class="sectionTitle">
${HeaderSubtitleAppearance} ${HeaderSubtitleAppearance}
</h2> </h2>
@ -61,6 +60,7 @@
<option value="extralarge">${ExtraLarge}</option> <option value="extralarge">${ExtraLarge}</option>
</select> </select>
</div> </div>
<div class="selectContainer"> <div class="selectContainer">
<select is="emby-select" id="selectFont" label="${LabelFont}"> <select is="emby-select" id="selectFont" label="${LabelFont}">
<option value="">${Default}</option> <option value="">${Default}</option>
@ -71,12 +71,15 @@
<option value="smallcaps">${SmallCaps}</option> <option value="smallcaps">${SmallCaps}</option>
</select> </select>
</div> </div>
<div class="inputContainer hide"> <div class="inputContainer hide">
<input is="emby-input" id="inputTextBackground" label="${LabelTextBackgroundColor}" type="text" /> <input is="emby-input" id="inputTextBackground" label="${LabelTextBackgroundColor}" type="text" />
</div> </div>
<div class="inputContainer hide"> <div class="inputContainer hide">
<input is="emby-input" id="inputTextColor" label="${LabelTextColor}" type="text" /> <input is="emby-input" id="inputTextColor" label="${LabelTextColor}" type="text" />
</div> </div>
<div class="selectContainer"> <div class="selectContainer">
<select is="emby-select" id="selectDropShadow" label="${LabelDropShadow}"> <select is="emby-select" id="selectDropShadow" label="${LabelDropShadow}">
<option value="none">${None}</option> <option value="none">${None}</option>
@ -91,4 +94,4 @@
<button is="emby-button" type="submit" class="raised button-submit block btnSave hide"> <button is="emby-button" type="submit" class="raised button-submit block btnSave hide">
<span>${Save}</span> <span>${Save}</span>
</button> </button>
</form> </form>

View file

@ -20,6 +20,14 @@ define(['appStorage', 'events'], function (appStorage, events) {
return this.get('enableAutoLogin') !== 'false'; return this.get('enableAutoLogin') !== 'false';
}; };
AppSettings.prototype.enableSystemExternalPlayers = function (val) {
if (val != null) {
this.set('enableSystemExternalPlayers', val.toString());
}
return this.get('enableSystemExternalPlayers') === 'true';
};
AppSettings.prototype.enableAutomaticBitrateDetection = function (isInNetwork, mediaType, val) { AppSettings.prototype.enableAutomaticBitrateDetection = function (isInNetwork, mediaType, val) {
var key = 'enableautobitratebitrate-' + mediaType + '-' + isInNetwork; var key = 'enableautobitratebitrate-' + mediaType + '-' + isInNetwork;
if (val != null) { if (val != null) {
@ -123,13 +131,5 @@ define(['appStorage', 'events'], function (appStorage, events) {
return appStorage.getItem(getKey(name, userId)); return appStorage.getItem(getKey(name, userId));
}; };
AppSettings.prototype.enableSystemExternalPlayers = function (val) {
if (val != null) {
this.set('enableSystemExternalPlayers', val.toString());
}
return this.get('enableSystemExternalPlayers') === 'true';
};
return new AppSettings(); return new AppSettings();
}); });

View file

@ -1,29 +1,16 @@
define(['appStorage', 'events'], function (appStorage, events) { define(['appStorage', 'events'], function (appStorage, events) {
'use strict'; 'use strict';
function readConfig(path, callback) {
var file = new XMLHttpRequest();
file.overrideMimeType("application/json");
file.open("GET", path, true);
file.onreadystatechange = function() {
if (file.readyState === 4 && file.status == "200") {
callback(file.responseText);
}
}
file.send(null);
}
var data = {}; var data = {};
function WebSettings() { function WebSettings() {
readConfig("/config.json", function(text) { fetch("/config.json").then(function (response) {
data = JSON.parse(text); data = response.json();
}); })
} }
WebSettings.prototype.getMultiserver = function () { WebSettings.prototype.getMultiServer = function () {
return data.multiserver !== false; return data.multiServer || false;
}; };
return new WebSettings(); return new WebSettings();

View file

@ -15,7 +15,7 @@
"Alerts": "Alerts", "Alerts": "Alerts",
"All": "All", "All": "All",
"AllChannels": "All channels", "AllChannels": "All channels",
"AllComplexFormats": "All complex formats (ASS, SSA, VOBSUB, PGS, SUB/IDX, etc.)", "AllComplexFormats": "All Complex Formats (ASS, SSA, VOBSUB, PGS, SUB, IDX)",
"AllEpisodes": "All episodes", "AllEpisodes": "All episodes",
"AllLanguages": "All languages", "AllLanguages": "All languages",
"AllLibraries": "All libraries", "AllLibraries": "All libraries",
@ -27,9 +27,9 @@
"AllowRemoteAccess": "Allow remote connections to this Jellyfin Server.", "AllowRemoteAccess": "Allow remote connections to this Jellyfin Server.",
"AllowRemoteAccessHelp": "If unchecked, all remote connections will be blocked.", "AllowRemoteAccessHelp": "If unchecked, all remote connections will be blocked.",
"AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.", "AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.",
"AlwaysPlaySubtitles": "Always play subtitles", "AlwaysPlaySubtitles": "Always Play",
"AlwaysPlaySubtitlesHelp": "Subtitles matching the language preference will be loaded regardless of the audio language.", "AlwaysPlaySubtitlesHelp": "Subtitles matching the language preference will be loaded regardless of the audio language.",
"AnyLanguage": "Any language", "AnyLanguage": "Any Language",
"Anytime": "Anytime", "Anytime": "Anytime",
"AroundTime": "Around {0}", "AroundTime": "Around {0}",
"Art": "Art", "Art": "Art",
@ -55,7 +55,7 @@
"BoxRear": "Box (rear)", "BoxRear": "Box (rear)",
"Browse": "Browse", "Browse": "Browse",
"BrowsePluginCatalogMessage": "Browse our plugin catalog to view available plugins.", "BrowsePluginCatalogMessage": "Browse our plugin catalog to view available plugins.",
"BurnSubtitlesHelp": "Determines if the server should burn in subtitles when converting video depending on the subtitle format. Avoiding burning in subtitles will improve server performance. Select Auto to burn image based formats (VOBSUB, PGS, SUB/IDX, etc) and certain ASS/SSA subtitles.", "BurnSubtitlesHelp": "Determines if the server should burn in subtitles when transcoding videos. Avoiding this will greatly improve performance. Select Auto to burn image based formats (VOBSUB, PGS, SUB, IDX) and certain ASS or SSA subtitles.",
"ButtonAdd": "Add", "ButtonAdd": "Add",
"ButtonAddImage": "Add Image", "ButtonAddImage": "Add Image",
"ButtonAddMediaLibrary": "Add Media Library", "ButtonAddMediaLibrary": "Add Media Library",
@ -199,7 +199,7 @@
"DisplayInOtherHomeScreenSections": "Display in home screen sections such as latest media and continue watching", "DisplayInOtherHomeScreenSections": "Display in home screen sections such as latest media and continue watching",
"DisplayMissingEpisodesWithinSeasons": "Display missing episodes within seasons", "DisplayMissingEpisodesWithinSeasons": "Display missing episodes within seasons",
"DisplayMissingEpisodesWithinSeasonsHelp": "This must also be enabled for TV libraries in the server configuration.", "DisplayMissingEpisodesWithinSeasonsHelp": "This must also be enabled for TV libraries in the server configuration.",
"DisplayModeHelp": "Select the type of screen you're running Jellyfin on.", "DisplayModeHelp": "Select the layout style you want for the interface.",
"DoNotRecord": "Do not record", "DoNotRecord": "Do not record",
"Down": "Down", "Down": "Down",
"Download": "Download", "Download": "Download",
@ -1036,16 +1036,16 @@
"NoNextUpItemsMessage": "None found. Start watching your shows!", "NoNextUpItemsMessage": "None found. Start watching your shows!",
"NoPluginConfigurationMessage": "This plugin has no settings to configure.", "NoPluginConfigurationMessage": "This plugin has no settings to configure.",
"NoSubtitleSearchResultsFound": "No results found.", "NoSubtitleSearchResultsFound": "No results found.",
"NoSubtitles": "No subtitles", "NoSubtitles": "None",
"NoSubtitlesHelp": "Subtitles will not be loaded by default. They can still be turned on manually during playback.", "NoSubtitlesHelp": "Subtitles will not be loaded by default. They can still be turned on manually during playback.",
"None": "None", "None": "None",
"Normal": "Normal", "Normal": "Normal",
"NumLocationsValue": "{0} folders", "NumLocationsValue": "{0} folders",
"Off": "Off", "Off": "Off",
"OneChannel": "One channel", "OneChannel": "One channel",
"OnlyForcedSubtitles": "Only forced subtitles", "OnlyForcedSubtitles": "Only Forced",
"OnlyForcedSubtitlesHelp": "Only subtitles marked as forced will be loaded.", "OnlyForcedSubtitlesHelp": "Only subtitles marked as forced will be loaded.",
"OnlyImageFormats": "Only image formats (VOBSUB, PGS, SUB, etc)", "OnlyImageFormats": "Only Image Formats (VOBSUB, PGS, SUB)",
"Option3D": "3D", "Option3D": "3D",
"OptionAdminUsers": "Administrators", "OptionAdminUsers": "Administrators",
"OptionAlbum": "Album", "OptionAlbum": "Album",