mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Onboarding lang switch; more localizable strings; enhance ru-ru translation
This commit is contained in:
@ -126,16 +126,17 @@ export function applyLocale(root = document) {
|
||||
|
||||
|
||||
function addLanguagesToDropdown() {
|
||||
const uiLanguageSelects = $('#ui_language_select, #onboarding_ui_language_select');
|
||||
for (const langObj of langs) { // Set the value to the language code
|
||||
const option = document.createElement('option');
|
||||
option.value = langObj['lang']; // Set the value to the language code
|
||||
option.innerText = langObj['display']; // Set the display text to the language name
|
||||
$('#ui_language_select').append(option);
|
||||
uiLanguageSelects.append(option);
|
||||
}
|
||||
|
||||
const selectedLanguage = localStorage.getItem(storageKey);
|
||||
if (selectedLanguage) {
|
||||
$('#ui_language_select').val(selectedLanguage);
|
||||
uiLanguageSelects.val(selectedLanguage);
|
||||
}
|
||||
}
|
||||
|
||||
@ -144,7 +145,7 @@ export function initLocales() {
|
||||
addLanguagesToDropdown();
|
||||
updateSecretDisplay();
|
||||
|
||||
$('#ui_language_select').on('change', async function () {
|
||||
$('#ui_language_select, #onboarding_ui_language_select').on('change', async function () {
|
||||
const language = String($(this).val());
|
||||
|
||||
if (language) {
|
||||
|
Reference in New Issue
Block a user