Implement typesafe-i18n
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { gameManager } from "../../Phaser/Game/GameManager";
|
||||
import { onMount } from "svelte";
|
||||
import { _ } from "../../Translator/Translator";
|
||||
import LL from "../../i18n/i18n-svelte";
|
||||
|
||||
let gameScene = gameManager.getCurrentGameScene();
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
let mapName: string = "";
|
||||
let mapLink: string = "";
|
||||
let mapDescription: string = "";
|
||||
let mapCopyright: string = _("menu.about.copyrights.map.empty");
|
||||
let mapCopyright: string = $LL.menu.about.copyrights.map.empty();
|
||||
let tilesetCopyright: string[] = [];
|
||||
let audioCopyright: string[] = [];
|
||||
|
||||
@@ -63,37 +63,37 @@
|
||||
</script>
|
||||
|
||||
<div class="about-room-main">
|
||||
<h2>{_("menu.about.map-info")}</h2>
|
||||
<h2>{$LL.menu.about.mapInfo()}</h2>
|
||||
<section class="container-overflow">
|
||||
<h3>{mapName}</h3>
|
||||
<p class="string-HTML">{mapDescription}</p>
|
||||
{#if mapLink}
|
||||
<p class="string-HTML">
|
||||
> <a href={mapLink} target="_blank">{_("menu.about.map-link")}</a> <
|
||||
> <a href={mapLink} target="_blank">{$LL.menu.about.mapLink()}</a> <
|
||||
</p>
|
||||
{/if}
|
||||
<h3 class="nes-pointer hoverable" on:click={() => (expandedMapCopyright = !expandedMapCopyright)}>
|
||||
{_("menu.about.copyrights.map.title")}
|
||||
{$LL.menu.about.copyrights.map.title()}
|
||||
</h3>
|
||||
<p class="string-HTML" hidden={!expandedMapCopyright}>{mapCopyright}</p>
|
||||
<h3 class="nes-pointer hoverable" on:click={() => (expandedTilesetCopyright = !expandedTilesetCopyright)}>
|
||||
{_("menu.about.copyrights.tileset.title")}
|
||||
{$LL.menu.about.copyrights.tileset.title()}
|
||||
</h3>
|
||||
<section hidden={!expandedTilesetCopyright}>
|
||||
{#each tilesetCopyright as copyright}
|
||||
<p class="string-HTML">{copyright}</p>
|
||||
{:else}
|
||||
<p>{_("menu.about.copyrights.tileset.empty")}</p>
|
||||
<p>{$LL.menu.about.copyrights.tileset.empty()}</p>
|
||||
{/each}
|
||||
</section>
|
||||
<h3 class="nes-pointer hoverable" on:click={() => (expandedAudioCopyright = !expandedAudioCopyright)}>
|
||||
{_("menu.about.copyrights.audio.title")}
|
||||
{$LL.menu.about.copyrights.audio.title()}
|
||||
</h3>
|
||||
<section hidden={!expandedAudioCopyright}>
|
||||
{#each audioCopyright as copyright}
|
||||
<p class="string-HTML">{copyright}</p>
|
||||
{:else}
|
||||
<p>{_("menu.about.copyrights.audio.empty")}</p>
|
||||
<p>{$LL.menu.about.copyrights.audio.empty()}</p>
|
||||
{/each}
|
||||
</section>
|
||||
</section>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import { AdminMessageEventTypes } from "../../Connexion/AdminMessagesService";
|
||||
import uploadFile from "../images/music-file.svg";
|
||||
import type { PlayGlobalMessageInterface } from "../../Connexion/ConnexionModels";
|
||||
import { _ } from "../../Translator/Translator";
|
||||
import LL from "../../i18n/i18n-svelte";
|
||||
|
||||
interface EventTargetFiles extends EventTarget {
|
||||
files: Array<File>;
|
||||
@@ -77,7 +77,7 @@
|
||||
<img
|
||||
class="nes-pointer"
|
||||
src={uploadFile}
|
||||
alt={_("menu.global-audio.upload-info")}
|
||||
alt={$LL.menu.globalAudio.uploadInfo()}
|
||||
on:click|preventDefault={() => {
|
||||
fileInput.click();
|
||||
}}
|
||||
@@ -86,7 +86,7 @@
|
||||
<p>{fileName} : {fileSize}</p>
|
||||
{/if}
|
||||
{#if errorFile}
|
||||
<p class="err">{_("menu.global-audio.error")}</p>
|
||||
<p class="err">{$LL.menu.globalAudio.error()}</p>
|
||||
{/if}
|
||||
<input
|
||||
type="file"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import LL from "../../i18n/i18n-svelte";
|
||||
import { contactPageStore } from "../../Stores/MenuStore";
|
||||
import { _ } from "../../Translator/Translator";
|
||||
|
||||
function goToGettingStarted() {
|
||||
const sparkHost = "https://workadventu.re/getting-started";
|
||||
@@ -16,18 +16,18 @@
|
||||
<div class="create-map-main">
|
||||
<section class="container-overflow">
|
||||
<section>
|
||||
<h3>{_("menu.contact.getting-started.title")}</h3>
|
||||
<p>{_("menu.contact.getting-started.description")}</p>
|
||||
<h3>{$LL.menu.contact.gettingStarted.title()}</h3>
|
||||
<p>{$LL.menu.contact.gettingStarted.description()}</p>
|
||||
<button type="button" class="nes-btn is-primary" on:click={goToGettingStarted}
|
||||
>{_("menu.contact.getting-started.title")}</button
|
||||
>{$LL.menu.contact.gettingStarted.title()}</button
|
||||
>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h3>{_("menu.contact.create-map.title")}</h3>
|
||||
<p>{_("menu.contact.create-map.description")}</p>
|
||||
<h3>{$LL.menu.contact.createMap.title()}</h3>
|
||||
<p>{$LL.menu.contact.createMap.description()}</p>
|
||||
<button type="button" class="nes-btn" on:click={goToBuildingMap}
|
||||
>{_("menu.contact.create-map.title")}</button
|
||||
>{$LL.menu.contact.createMap.title()}</button
|
||||
>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import TextGlobalMessage from "./TextGlobalMessage.svelte";
|
||||
import AudioGlobalMessage from "./AudioGlobalMessage.svelte";
|
||||
import { _ } from "../../Translator/Translator";
|
||||
import LL from "../../i18n/i18n-svelte";
|
||||
|
||||
let handleSendText: { sendTextMessage(broadcast: boolean): void };
|
||||
let handleSendAudio: { sendAudioMessage(broadcast: boolean): Promise<void> };
|
||||
@@ -36,14 +36,14 @@
|
||||
<button
|
||||
type="button"
|
||||
class="nes-btn {inputSendTextActive ? 'is-disabled' : ''}"
|
||||
on:click|preventDefault={activateInputText}>{_("menu.global-message.text")}</button
|
||||
on:click|preventDefault={activateInputText}>{$LL.menu.globalMessage.text()}</button
|
||||
>
|
||||
</section>
|
||||
<section>
|
||||
<button
|
||||
type="button"
|
||||
class="nes-btn {uploadAudioActive ? 'is-disabled' : ''}"
|
||||
on:click|preventDefault={activateUploadAudio}>{_("menu.global-message.audio")}</button
|
||||
on:click|preventDefault={activateUploadAudio}>{$LL.menu.globalMessage.audio()}</button
|
||||
>
|
||||
</section>
|
||||
</div>
|
||||
@@ -58,10 +58,10 @@
|
||||
<div class="global-message-footer">
|
||||
<label>
|
||||
<input type="checkbox" class="nes-checkbox is-dark nes-pointer" bind:checked={broadcastToWorld} />
|
||||
<span>{_("menu.global-message.warning")}</span>
|
||||
<span>{$LL.menu.globalMessage.warning()}</span>
|
||||
</label>
|
||||
<section>
|
||||
<button class="nes-btn is-primary" on:click|preventDefault={send}>{_("menu.global-message.send")}</button>
|
||||
<button class="nes-btn is-primary" on:click|preventDefault={send}>{$LL.menu.globalMessage.send()}</button>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { _ } from "../../Translator/Translator";
|
||||
import LL from "../../i18n/i18n-svelte";
|
||||
|
||||
function copyLink() {
|
||||
const input: HTMLInputElement = document.getElementById("input-share-link") as HTMLInputElement;
|
||||
@@ -23,14 +23,14 @@
|
||||
<div class="guest-main">
|
||||
<section class="container-overflow">
|
||||
<section class="share-url not-mobile">
|
||||
<h3>{_("menu.invite.description")}</h3>
|
||||
<h3>{$LL.menu.invite.description()}</h3>
|
||||
<input type="text" readonly id="input-share-link" value={location.toString()} />
|
||||
<button type="button" class="nes-btn is-primary" on:click={copyLink}>{_("menu.invite.copy")}</button>
|
||||
<button type="button" class="nes-btn is-primary" on:click={copyLink}>{$LL.menu.invite.copy()}</button>
|
||||
</section>
|
||||
<section class="is-mobile">
|
||||
<h3>{_("menu.invite.description")}</h3>
|
||||
<h3>{$LL.menu.invite.description()}</h3>
|
||||
<input type="hidden" readonly id="input-share-link" value={location.toString()} />
|
||||
<button type="button" class="nes-btn is-primary" on:click={shareLink}>{_("menu.invite.share")}</button>
|
||||
<button type="button" class="nes-btn is-primary" on:click={shareLink}>{$LL.menu.invite.share()}</button>
|
||||
</section>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
@@ -14,27 +14,27 @@
|
||||
SubMenusInterface,
|
||||
subMenusStore,
|
||||
} from "../../Stores/MenuStore";
|
||||
import type { MenuItem } from "../../Stores/MenuStore";
|
||||
import { onDestroy, onMount } from "svelte";
|
||||
import { get } from "svelte/store";
|
||||
import type { Unsubscriber } from "svelte/store";
|
||||
import { sendMenuClickedEvent } from "../../Api/iframe/Ui/MenuItem";
|
||||
import { _ } from "../../Translator/Translator";
|
||||
import LL from "../../i18n/i18n-svelte";
|
||||
|
||||
let activeSubMenu: string = SubMenusInterface.profile;
|
||||
let activeSubMenu: MenuItem = $subMenusStore[0];
|
||||
let activeComponent: typeof ProfileSubMenu | typeof CustomSubMenu = ProfileSubMenu;
|
||||
let props: { url: string; allowApi: boolean };
|
||||
let unsubscriberSubMenuStore: Unsubscriber;
|
||||
|
||||
onMount(() => {
|
||||
unsubscriberSubMenuStore = subMenusStore.subscribe(() => {
|
||||
if (!get(subMenusStore).includes(activeSubMenu)) {
|
||||
switchMenu(SubMenusInterface.profile);
|
||||
if (!$subMenusStore.includes(activeSubMenu)) {
|
||||
switchMenu($subMenusStore[0]);
|
||||
}
|
||||
});
|
||||
|
||||
checkSubMenuToShow();
|
||||
|
||||
switchMenu(SubMenusInterface.profile);
|
||||
switchMenu($subMenusStore[0]);
|
||||
});
|
||||
|
||||
onDestroy(() => {
|
||||
@@ -43,10 +43,10 @@
|
||||
}
|
||||
});
|
||||
|
||||
function switchMenu(menu: string) {
|
||||
if (get(subMenusStore).find((subMenu) => subMenu === menu)) {
|
||||
function switchMenu(menu: MenuItem) {
|
||||
if (menu.type === "translated") {
|
||||
activeSubMenu = menu;
|
||||
switch (menu) {
|
||||
switch (menu.key) {
|
||||
case SubMenusInterface.settings:
|
||||
activeComponent = SettingsSubMenu;
|
||||
break;
|
||||
@@ -65,19 +65,17 @@
|
||||
case SubMenusInterface.contact:
|
||||
activeComponent = ContactSubMenu;
|
||||
break;
|
||||
default: {
|
||||
const customMenu = customMenuIframe.get(menu);
|
||||
if (customMenu !== undefined) {
|
||||
props = { url: customMenu.url, allowApi: customMenu.allowApi };
|
||||
activeComponent = CustomSubMenu;
|
||||
} else {
|
||||
sendMenuClickedEvent(menu);
|
||||
menuVisiblilityStore.set(false);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else throw new Error("There is no menu called " + menu);
|
||||
} else {
|
||||
const customMenu = customMenuIframe.get(menu.label);
|
||||
if (customMenu !== undefined) {
|
||||
props = { url: customMenu.url, allowApi: customMenu.allowApi };
|
||||
activeComponent = CustomSubMenu;
|
||||
} else {
|
||||
sendMenuClickedEvent(menu.label);
|
||||
menuVisiblilityStore.set(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function closeMenu() {
|
||||
@@ -90,11 +88,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
function translateMenuName(menuName: string) {
|
||||
const nameFormatted = "menu.sub." + menuName.toLowerCase().replaceAll(" ", "-");
|
||||
const translation = _(nameFormatted);
|
||||
function translateMenuName(menu: MenuItem) {
|
||||
if (menu.type === "scripting") {
|
||||
return menu.label;
|
||||
}
|
||||
|
||||
return translation === nameFormatted ? menuName : translation;
|
||||
// Bypass the proxy of typesafe for getting the menu name : https://github.com/ivanhofer/typesafe-i18n/issues/156
|
||||
const getMenuName = $LL.menu.sub[menu.key];
|
||||
|
||||
return getMenuName();
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -102,7 +104,7 @@
|
||||
|
||||
<div class="menu-container-main">
|
||||
<div class="menu-nav-sidebar nes-container is-rounded" transition:fly={{ x: -1000, duration: 500 }}>
|
||||
<h2>{_("menu.title")}</h2>
|
||||
<h2>{$LL.menu.title()}</h2>
|
||||
<nav>
|
||||
{#each $subMenusStore as submenu}
|
||||
<button
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
import { get } from "svelte/store";
|
||||
import { ADMIN_URL } from "../../Enum/EnvironmentVariable";
|
||||
import { showShareLinkMapModalStore } from "../../Stores/ModalStore";
|
||||
import { _ } from "../../Translator/Translator";
|
||||
import LL from "../../i18n/i18n-svelte";
|
||||
|
||||
function showMenu() {
|
||||
menuVisiblilityStore.set(!get(menuVisiblilityStore));
|
||||
@@ -32,19 +32,19 @@
|
||||
{#if $limitMapStore}
|
||||
<img
|
||||
src={logoInvite}
|
||||
alt={_("menu.icon.open.invite")}
|
||||
alt={$LL.menu.icon.open.invite()}
|
||||
class="nes-pointer"
|
||||
on:click|preventDefault={showInvite}
|
||||
/>
|
||||
<img
|
||||
src={logoRegister}
|
||||
alt={_("menu.icon.open.register")}
|
||||
alt={$LL.menu.icon.open.register()}
|
||||
class="nes-pointer"
|
||||
on:click|preventDefault={register}
|
||||
/>
|
||||
{:else}
|
||||
<img src={logoWA} alt={_("menu.icon.open.menu")} class="nes-pointer" on:click|preventDefault={showMenu} />
|
||||
<img src={logoTalk} alt={_("menu.icon.open.chat")} class="nes-pointer" on:click|preventDefault={showChat} />
|
||||
<img src={logoWA} alt={$LL.menu.icon.open.menu()} class="nes-pointer" on:click|preventDefault={showMenu} />
|
||||
<img src={logoTalk} alt={$LL.menu.icon.open.chat()} class="nes-pointer" on:click|preventDefault={showChat} />
|
||||
{/if}
|
||||
</main>
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
import btnProfileSubMenuCompanion from "../images/btn-menu-profile-companion.svg";
|
||||
import Woka from "../Woka/Woka.svelte";
|
||||
import Companion from "../Companion/Companion.svelte";
|
||||
import { _ } from "../../Translator/Translator";
|
||||
import LL from "../../i18n/i18n-svelte";
|
||||
|
||||
function disableMenuStores() {
|
||||
menuVisiblilityStore.set(false);
|
||||
@@ -63,20 +63,20 @@
|
||||
<div class="submenu">
|
||||
<section>
|
||||
<button type="button" class="nes-btn" on:click|preventDefault={openEditNameScene}>
|
||||
<img src={btnProfileSubMenuIdentity} alt={_("menu.profile.edit.name")} />
|
||||
<span class="btn-hover">{_("menu.profile.edit.name")}</span>
|
||||
<img src={btnProfileSubMenuIdentity} alt={$LL.menu.profile.edit.name()} />
|
||||
<span class="btn-hover">{$LL.menu.profile.edit.name()}</span>
|
||||
</button>
|
||||
<button type="button" class="nes-btn" on:click|preventDefault={openEditSkinScene}>
|
||||
<Woka userId={-1} placeholderSrc="" width="26px" height="26px" />
|
||||
<span class="btn-hover">{_("menu.profile.edit.woka")}</span>
|
||||
<span class="btn-hover">{$LL.menu.profile.edit.woka()}</span>
|
||||
</button>
|
||||
<button type="button" class="nes-btn" on:click|preventDefault={openEditCompanionScene}>
|
||||
<Companion userId={-1} placeholderSrc={btnProfileSubMenuCompanion} width="26px" height="26px" />
|
||||
<span class="btn-hover">{_("menu.profile.edit.companion")}</span>
|
||||
<span class="btn-hover">{$LL.menu.profile.edit.companion()}</span>
|
||||
</button>
|
||||
<button type="button" class="nes-btn" on:click|preventDefault={openEnableCameraScene}>
|
||||
<img src={btnProfileSubMenuCamera} alt={_("menu.profile.edit.camera")} />
|
||||
<span class="btn-hover">{_("menu.profile.edit.camera")}</span>
|
||||
<img src={btnProfileSubMenuCamera} alt={$LL.menu.profile.edit.camera()} />
|
||||
<span class="btn-hover">{$LL.menu.profile.edit.camera()}</span>
|
||||
</button>
|
||||
</section>
|
||||
</div>
|
||||
@@ -90,12 +90,12 @@
|
||||
</section>
|
||||
<section>
|
||||
<button type="button" class="nes-btn" on:click|preventDefault={logOut}
|
||||
>{_("menu.profile.logout")}</button
|
||||
>{$LL.menu.profile.logout()}</button
|
||||
>
|
||||
</section>
|
||||
{:else}
|
||||
<section>
|
||||
<a type="button" class="nes-btn" href="/login">{_("menu.profile.login")}</a>
|
||||
<a type="button" class="nes-btn" href="/login">{$LL.menu.profile.login()}</a>
|
||||
</section>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
import { HtmlUtils } from "../../WebRtc/HtmlUtils";
|
||||
import { isMobile } from "../../Enum/EnvironmentVariable";
|
||||
import { menuVisiblilityStore } from "../../Stores/MenuStore";
|
||||
import { languages, translator, _ } from "../../Translator/Translator";
|
||||
import LL, { locale } from "../../i18n/i18n-svelte";
|
||||
import type { Locales } from "../../i18n/i18n-types";
|
||||
import { displayableLocales, setCurrentLocale } from "../../i18n/locales";
|
||||
|
||||
let fullscreen: boolean = localUserStore.getFullscreen();
|
||||
let notification: boolean = localUserStore.getNotification() === "granted";
|
||||
@@ -12,18 +14,17 @@
|
||||
let ignoreFollowRequests: boolean = localUserStore.getIgnoreFollowRequests();
|
||||
let valueGame: number = localUserStore.getGameQualityValue();
|
||||
let valueVideo: number = localUserStore.getVideoQualityValue();
|
||||
let valueLanguage: string = translator.getStringByLanguage(translator.getCurrentLanguage()) ?? "en-US";
|
||||
let valueLocale: string = $locale;
|
||||
let previewValueGame = valueGame;
|
||||
let previewValueVideo = valueVideo;
|
||||
let previewValueLanguage = valueLanguage;
|
||||
let previewValueLocale = valueLocale;
|
||||
|
||||
function saveSetting() {
|
||||
let change = false;
|
||||
|
||||
if (valueLanguage !== previewValueLanguage) {
|
||||
previewValueLanguage = valueLanguage;
|
||||
translator.switchLanguage(previewValueLanguage);
|
||||
change = true;
|
||||
if (valueLocale !== previewValueLocale) {
|
||||
previewValueLocale = valueLocale;
|
||||
setCurrentLocale(valueLocale as Locales);
|
||||
}
|
||||
|
||||
if (valueVideo !== previewValueVideo) {
|
||||
@@ -88,74 +89,73 @@
|
||||
|
||||
<div class="settings-main" on:submit|preventDefault={saveSetting}>
|
||||
<section>
|
||||
<h3>{_("menu.settings.game-quality.title")}</h3>
|
||||
<h3>{$LL.menu.settings.gameQuality.title()}</h3>
|
||||
<div class="nes-select is-dark">
|
||||
<select bind:value={valueGame}>
|
||||
<option value={120}
|
||||
>{isMobile()
|
||||
? _("menu.settings.game-quality.short.high")
|
||||
: _("menu.settings.game-quality.long.high")}</option
|
||||
? $LL.menu.settings.gameQuality.short.high()
|
||||
: $LL.menu.settings.gameQuality.long.high()}</option
|
||||
>
|
||||
<option value={60}
|
||||
>{isMobile()
|
||||
? _("menu.settings.game-quality.short.medium")
|
||||
: _("menu.settings.game-quality.long.medium")}</option
|
||||
? $LL.menu.settings.gameQuality.short.medium()
|
||||
: $LL.menu.settings.gameQuality.long.medium()}</option
|
||||
>
|
||||
<option value={40}
|
||||
>{isMobile()
|
||||
? _("menu.settings.game-quality.short.minimum")
|
||||
: _("menu.settings.game-quality.long.minimum")}</option
|
||||
? $LL.menu.settings.gameQuality.short.minimum()
|
||||
: $LL.menu.settings.gameQuality.long.minimum()}</option
|
||||
>
|
||||
<option value={20}
|
||||
>{isMobile()
|
||||
? _("menu.settings.game-quality.short.small")
|
||||
: _("menu.settings.game-quality.long.small")}</option
|
||||
? $LL.menu.settings.gameQuality.short.small()
|
||||
: $LL.menu.settings.gameQuality.long.small()}</option
|
||||
>
|
||||
</select>
|
||||
</div>
|
||||
</section>
|
||||
<section>
|
||||
<h3>{_("menu.settings.video-quality.title")}</h3>
|
||||
<h3>{$LL.menu.settings.videoQuality.title()}</h3>
|
||||
<div class="nes-select is-dark">
|
||||
<select bind:value={valueVideo}>
|
||||
<option value={30}
|
||||
>{isMobile()
|
||||
? _("menu.settings.video-quality.short.high")
|
||||
: _("menu.settings.video-quality.long.high")}</option
|
||||
? $LL.menu.settings.videoQuality.short.high()
|
||||
: $LL.menu.settings.videoQuality.long.high()}</option
|
||||
>
|
||||
<option value={20}
|
||||
>{isMobile()
|
||||
? _("menu.settings.video-quality.short.medium")
|
||||
: _("menu.settings.video-quality.long.medium")}</option
|
||||
? $LL.menu.settings.videoQuality.short.medium()
|
||||
: $LL.menu.settings.videoQuality.long.medium()}</option
|
||||
>
|
||||
<option value={10}
|
||||
>{isMobile()
|
||||
? _("menu.settings.video-quality.short.minimum")
|
||||
: _("menu.settings.video-quality.long.minimum")}</option
|
||||
? $LL.menu.settings.videoQuality.short.minimum()
|
||||
: $LL.menu.settings.videoQuality.long.minimum()}</option
|
||||
>
|
||||
<option value={5}
|
||||
>{isMobile()
|
||||
? _("menu.settings.video-quality.short.small")
|
||||
: _("menu.settings.video-quality.long.small")}</option
|
||||
? $LL.menu.settings.videoQuality.short.small()
|
||||
: $LL.menu.settings.videoQuality.long.small()}</option
|
||||
>
|
||||
</select>
|
||||
</div>
|
||||
</section>
|
||||
<section>
|
||||
<h3>{_("menu.settings.language.title")}</h3>
|
||||
<h3>{$LL.menu.settings.language.title()}</h3>
|
||||
<div class="nes-select is-dark">
|
||||
<select class="languages-switcher" bind:value={valueLanguage}>
|
||||
<!-- svelte-ignore missing-declaration -->
|
||||
{#each languages as language}
|
||||
<option value={language.id}>{`${language.language} (${language.country})`}</option>
|
||||
<select class="languages-switcher" bind:value={valueLocale}>
|
||||
{#each displayableLocales as locale (locale.id)}
|
||||
<option value={locale.id}>{`${locale.language} (${locale.country})`}</option>
|
||||
{/each}
|
||||
</select>
|
||||
</div>
|
||||
</section>
|
||||
<section class="settings-section-save">
|
||||
<p>{_("menu.settings.save.warning")}</p>
|
||||
<p>{$LL.menu.settings.save.warning()}</p>
|
||||
<button type="button" class="nes-btn is-primary" on:click|preventDefault={saveSetting}
|
||||
>{_("menu.settings.save.button")}</button
|
||||
>{$LL.menu.settings.save.button()}</button
|
||||
>
|
||||
</section>
|
||||
<section class="settings-section-noSaveOption">
|
||||
@@ -166,7 +166,7 @@
|
||||
bind:checked={fullscreen}
|
||||
on:change={changeFullscreen}
|
||||
/>
|
||||
<span>{_("menu.settings.fullscreen")}</span>
|
||||
<span>{$LL.menu.settings.fullscreen()}</span>
|
||||
</label>
|
||||
<label>
|
||||
<input
|
||||
@@ -175,7 +175,7 @@
|
||||
bind:checked={notification}
|
||||
on:change={changeNotification}
|
||||
/>
|
||||
<span>{_("menu.settings.notifications")}</span>
|
||||
<span>{$LL.menu.settings.notifications()}</span>
|
||||
</label>
|
||||
<label>
|
||||
<input
|
||||
@@ -184,7 +184,7 @@
|
||||
bind:checked={forceCowebsiteTrigger}
|
||||
on:change={changeForceCowebsiteTrigger}
|
||||
/>
|
||||
<span>{_("menu.settings.cowebsite-trigger")}</span>
|
||||
<span>{$LL.menu.settings.cowebsiteTrigger()}</span>
|
||||
</label>
|
||||
<label>
|
||||
<input
|
||||
@@ -193,7 +193,7 @@
|
||||
bind:checked={ignoreFollowRequests}
|
||||
on:change={changeIgnoreFollowRequests}
|
||||
/>
|
||||
<span>{_("menu.settings.ignore-follow-request")}</span>
|
||||
<span>{$LL.menu.settings.ignoreFollowRequest()}</span>
|
||||
</label>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import { AdminMessageEventTypes } from "../../Connexion/AdminMessagesService";
|
||||
import type { Quill } from "quill";
|
||||
import type { PlayGlobalMessageInterface } from "../../Connexion/ConnexionModels";
|
||||
import { _ } from "../../Translator/Translator";
|
||||
import LL from "../../i18n/i18n-svelte";
|
||||
|
||||
//toolbar
|
||||
const toolbarOptions = [
|
||||
@@ -59,7 +59,7 @@
|
||||
const { default: Quill } = await import("quill"); // eslint-disable-line @typescript-eslint/no-explicit-any
|
||||
|
||||
quill = new Quill(QUILL_EDITOR, {
|
||||
placeholder: _("menu.global-message.enter"),
|
||||
placeholder: $LL.menu.globalMessage.enter(),
|
||||
theme: "snow",
|
||||
modules: {
|
||||
toolbar: toolbarOptions,
|
||||
|
||||
Reference in New Issue
Block a user