Refactoring translator to use "_" instead of "translator._".
This is shorter and pollutes less the code.
This commit is contained in:
parent
1789f36a63
commit
51c3f1d972
34 changed files with 174 additions and 190 deletions
|
@ -2,7 +2,7 @@
|
|||
import { blackListManager } from "../../WebRtc/BlackListManager";
|
||||
import { showReportScreenStore, userReportEmpty } from "../../Stores/ShowReportScreenStore";
|
||||
import { onMount } from "svelte";
|
||||
import { translator } from "../../Translator/Translator";
|
||||
import { _ } from "../../Translator/Translator";
|
||||
|
||||
export let userUUID: string | undefined;
|
||||
export let userName: string;
|
||||
|
@ -30,10 +30,10 @@
|
|||
</script>
|
||||
|
||||
<div class="block-container">
|
||||
<h3>{translator._("report.block.title")}</h3>
|
||||
<p>{translator._("report.block.content", { userName })}</p>
|
||||
<h3>{_("report.block.title")}</h3>
|
||||
<p>{_("report.block.content", { userName })}</p>
|
||||
<button type="button" class="nes-btn is-error" on:click|preventDefault={blockUser}>
|
||||
{userIsBlocked ? translator._("report.block.unblock") : translator._("report.block.block")}
|
||||
{userIsBlocked ? _("report.block.unblock") : _("report.block.block")}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
import { playersStore } from "../../Stores/PlayersStore";
|
||||
import { connectionManager } from "../../Connexion/ConnectionManager";
|
||||
import { get } from "svelte/store";
|
||||
import { translator } from "../../Translator/Translator";
|
||||
import { _ } from "../../Translator/Translator";
|
||||
|
||||
let blockActive = true;
|
||||
let reportActive = !blockActive;
|
||||
|
@ -60,7 +60,7 @@
|
|||
|
||||
<div class="report-menu-main nes-container is-rounded">
|
||||
<section class="report-menu-title">
|
||||
<h2>{translator._("moderate.title", { userName })}</h2>
|
||||
<h2>{_("moderate.title", { userName })}</h2>
|
||||
<section class="justify-center">
|
||||
<button type="button" class="nes-btn" on:click|preventDefault={close}>X</button>
|
||||
</section>
|
||||
|
@ -70,14 +70,14 @@
|
|||
<button
|
||||
type="button"
|
||||
class="nes-btn {blockActive ? 'is-disabled' : ''}"
|
||||
on:click|preventDefault={activateBlock}>{translator._("moderate.block")}</button
|
||||
on:click|preventDefault={activateBlock}>{_("moderate.block")}</button
|
||||
>
|
||||
</section>
|
||||
<section class="justify-center">
|
||||
<button
|
||||
type="button"
|
||||
class="nes-btn {reportActive ? 'is-disabled' : ''}"
|
||||
on:click|preventDefault={activateReport}>{translator._("moderate.report")}</button
|
||||
on:click|preventDefault={activateReport}>{_("moderate.report")}</button
|
||||
>
|
||||
</section>
|
||||
</section>
|
||||
|
@ -87,7 +87,7 @@
|
|||
{:else if reportActive}
|
||||
<ReportSubMenu {userUUID} />
|
||||
{:else}
|
||||
<p>{translator._("moderate.no-select")}</p>
|
||||
<p>{_("moderate.no-select")}</p>
|
||||
{/if}
|
||||
</section>
|
||||
</div>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script lang="ts">
|
||||
import { showReportScreenStore, userReportEmpty } from "../../Stores/ShowReportScreenStore";
|
||||
import { gameManager } from "../../Phaser/Game/GameManager";
|
||||
import { translator } from "../../Translator/Translator";
|
||||
import { _ } from "../../Translator/Translator";
|
||||
|
||||
export let userUUID: string | undefined;
|
||||
let reportMessage: string;
|
||||
|
@ -23,20 +23,18 @@
|
|||
</script>
|
||||
|
||||
<div class="report-container-main">
|
||||
<h3>{translator._("report.title")}</h3>
|
||||
<p>{translator._("report.message")}</p>
|
||||
<h3>{_("report.title")}</h3>
|
||||
<p>{_("report.message")}</p>
|
||||
<form>
|
||||
<section>
|
||||
<label>
|
||||
<span>{translator._("report.message.title")}</span>
|
||||
<span>{_("report.message.title")}</span>
|
||||
<textarea type="text" class="nes-textarea" bind:value={reportMessage} />
|
||||
</label>
|
||||
<p hidden={hiddenError}>{translator._("report.message.empty")}</p>
|
||||
<p hidden={hiddenError}>{_("report.message.empty")}</p>
|
||||
</section>
|
||||
<section>
|
||||
<button type="submit" class="nes-btn is-error" on:click={submitReport}
|
||||
>{translator._("report.submit")}</button
|
||||
>
|
||||
<button type="submit" class="nes-btn is-error" on:click={submitReport}>{_("report.submit")}</button>
|
||||
</section>
|
||||
</form>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue