mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
add language to startup wizard
This commit is contained in:
parent
28ea06a627
commit
57eb18290f
4 changed files with 81 additions and 12 deletions
|
@ -29,7 +29,7 @@
|
|||
</select>
|
||||
<div class="fieldDescription">
|
||||
<div>${LabelPreferredDisplayLanguageHelp}</div>
|
||||
<div>
|
||||
<div style="margin-top: .25em;">
|
||||
<a href="http://mediabrowser3.com/community/index.php?/topic/5727-join-our-translation-team/" target="_blank">${LabelReadHowYouCanContribute}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,6 +1,59 @@
|
|||
var WizardStartPage = {
|
||||
(function (window, $) {
|
||||
|
||||
gotoNextPage: function () {
|
||||
Dashboard.navigate('wizarduser.html');
|
||||
function loadPage(page, config, languageOptions) {
|
||||
|
||||
$('#selectLocalizationLanguage', page).html(languageOptions.map(function (l) {
|
||||
|
||||
return '<option value="' + l.Value + '">' + l.Name + '</option>';
|
||||
|
||||
})).val(config.UICulture).selectmenu('refresh');
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
};
|
||||
|
||||
function save(page) {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
ApiClient.getServerConfiguration().done(function (config) {
|
||||
|
||||
config.UICulture = $('#selectLocalizationLanguage', page).val();
|
||||
|
||||
ApiClient.updateServerConfiguration(config).done(function (result) {
|
||||
|
||||
Dashboard.navigate('wizarduser.html');
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
$(document).on('pageshow', "#wizardStartPage", function () {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var page = this;
|
||||
|
||||
var promise1 = ApiClient.getServerConfiguration();
|
||||
|
||||
var promise2 = $.getJSON(ApiClient.getUrl("Localization/Options"));
|
||||
|
||||
$.when(promise1, promise2).done(function (response1, response2) {
|
||||
|
||||
loadPage(page, response1[0], response2[0]);
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
window.WizardStartPage = {
|
||||
|
||||
onSubmit: function () {
|
||||
|
||||
save($(this).parents('.page'));
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
})(window, jQuery);
|
|
@ -12,6 +12,7 @@
|
|||
<h2>
|
||||
<img src="css/images/mblogoicon.png" />${HeaderSetupLibrary}</h2>
|
||||
|
||||
<br />
|
||||
<div id="divMediaLibrary">
|
||||
<p>
|
||||
<button type="button" data-mini="true" data-icon="plus" onclick="MediaLibraryPage.addVirtualFolder();">${ButtonAddMediaFolder}</button>
|
||||
|
|
|
@ -9,16 +9,31 @@
|
|||
<div data-role="content">
|
||||
|
||||
<div class="ui-corner-all ui-shadow wizardContent">
|
||||
<form class="wizardStartForm">
|
||||
<h2>
|
||||
<img src="css/images/mblogoicon.png" />${WelcomeToMediaBrowser}</h2>
|
||||
|
||||
<p>${ThisWizardWillGuideYou}</p>
|
||||
|
||||
<ul data-role="listview" class="ulForm">
|
||||
<li>
|
||||
<label for="selectLocalizationLanguage">${LabelPreferredDisplayLanguage}</label>
|
||||
<select id="selectLocalizationLanguage" data-mini="true">
|
||||
</select>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="wizardNavigation">
|
||||
<button type="button" data-iconpos="right" data-icon="arrow-r" data-inline="true" onclick="WizardStartPage.gotoNextPage();">${LabelNext}</button>
|
||||
<button type="submit" data-iconpos="right" data-icon="arrow-r" data-inline="true">${LabelNext}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$('.wizardStartForm').off('submit', WizardStartPage.onSubmit).on('submit', WizardStartPage.onSubmit);
|
||||
</script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue