locale for web app (#334)
* locale for web app * more translations * Rename profiles service to avoid locale conflict * More translation work * Lint fix --------- Co-authored-by: github-action linter <githubaction@githubaction.com>
This commit is contained in:
1 parent
019fde1e67
commit
42dadec020
54 files changed
+538
-151
No files matched your search
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import VideoListRow from "lib/VideoFeed/VideoListRow.svelte";
|
||||
import { bookmarksStore } from "lib/Stores";
|
||||
import { bookmarksStore, tr } from "lib/Stores";
|
||||
|
||||
export let visibility: boolean;
|
||||
</script>
|
||||
@@ -10,12 +10,13 @@
|
||||
<div
|
||||
class="flex flex-col items-center justify-start h-screen w-2/3 mx-auto"
|
||||
>
|
||||
<div class="text-2xl font-bold text-gray-500">No Bookmarks</div>
|
||||
<div class="text-2xl font-bold text-gray-500">{$tr("No Bookmarks")}</div>
|
||||
<div class="text-gray-500 text-center">
|
||||
You currently have no bookmarks.<br />
|
||||
To add bookmarks, select a video, playlist or channel, and add a bookmark.<br
|
||||
/>
|
||||
Please note that Bookmarks is an experimental feature.
|
||||
{$tr("You currently have no bookmarks.")}<br />
|
||||
{$tr(
|
||||
"To add bookmarks, select a video, playlist or channel, and add a bookmark."
|
||||
)}<br />
|
||||
{$tr("Please note that Bookmarks is an experimental feature.")}
|
||||
</div>
|
||||
</div>
|
||||
{:else}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { getHost } from "lib/Api/Host";
|
||||
import { playletStateStore } from "lib/Stores";
|
||||
import { playletStateStore, tr } from "lib/Stores";
|
||||
|
||||
export let visibility: boolean;
|
||||
|
||||
@@ -87,6 +87,8 @@
|
||||
const feedbackTitle = encodeURIComponent("[Feedback] Playlet");
|
||||
let githubUrlIssue = "https://github.com/iBicha/playlet/issues/new";
|
||||
let mailToUrl = "mailto:brahim.hadriche@gmail.com";
|
||||
const feedbackMessageRaw =
|
||||
"You have feedback? Let us know by %IssueStart%creating an issue on Github%IssueEnd% or by %EmailStart%sending an email%EmailEnd%.";
|
||||
|
||||
playletStateStore.subscribe((value) => {
|
||||
appInfo = value.app || {};
|
||||
@@ -141,17 +143,17 @@ ${JSON.stringify(profilesInfo, null, 2)}
|
||||
|
||||
<div class={visibility ? "" : "hidden"}>
|
||||
<div class="text-base text-center m-8">
|
||||
Thank you for using Playlet.<br /> You have feedback? Let us know by
|
||||
<a
|
||||
class="link"
|
||||
href={githubUrlIssue}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer">creating an issue on Github</a
|
||||
>
|
||||
or by
|
||||
<a class="link" href={mailToUrl} target="_blank" rel="noopener noreferrer"
|
||||
>sending an email</a
|
||||
>.
|
||||
{@html $tr(feedbackMessageRaw)
|
||||
.replace(
|
||||
"%IssueStart%",
|
||||
`<a class="link" href="${githubUrlIssue}" target="_blank" rel="noopener noreferrer">`
|
||||
)
|
||||
.replace("%IssueEnd%", "</a>")
|
||||
.replace(
|
||||
"%EmailStart%",
|
||||
`<a class="link" href="${mailToUrl}" target="_blank" rel="noopener noreferrer">`
|
||||
)
|
||||
.replace("%EmailEnd%", "</a>")}
|
||||
</div>
|
||||
<div class="overflow-x-auto">
|
||||
<table class="table">
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
<script lang="ts">
|
||||
import { tr } from "lib/Stores";
|
||||
|
||||
let modal;
|
||||
|
||||
export let label = "Filters";
|
||||
export let label = $tr("Filters");
|
||||
|
||||
export const filters = {
|
||||
date: "",
|
||||
@@ -28,7 +30,7 @@
|
||||
count += filters.features.length;
|
||||
count += filters.sort_by ? 1 : 0;
|
||||
|
||||
label = `Filters` + `${count > 0 ? ` (${count})` : ""}`;
|
||||
label = $tr("Filters") + `${count > 0 ? ` (${count})` : ""}`;
|
||||
}
|
||||
|
||||
const options = {
|
||||
@@ -239,12 +241,12 @@
|
||||
<button
|
||||
class="btn btn-outline"
|
||||
type="button"
|
||||
on:click={() => modal.close()}>Close</button
|
||||
on:click={() => modal.close()}>{$tr("Close")}</button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<form method="dialog" class="modal-backdrop">
|
||||
<button>Close</button>
|
||||
<button>{$tr("Close")}</button>
|
||||
</form>
|
||||
</dialog>
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import { InvidiousApi } from "lib/Api/InvidiousApi";
|
||||
import { PlayletApi } from "lib/Api/PlayletApi";
|
||||
import { playletStateStore, searchHistoryStore } from "lib/Stores";
|
||||
import { playletStateStore, searchHistoryStore, tr } from "lib/Stores";
|
||||
import VideoCell from "lib/VideoFeed/VideoCell.svelte";
|
||||
import PlaylistCell from "lib/VideoFeed/PlaylistCell.svelte";
|
||||
import ChannelCell from "lib/VideoFeed/ChannelCell.svelte";
|
||||
@@ -125,7 +125,7 @@
|
||||
<input
|
||||
type="search"
|
||||
dir="auto"
|
||||
placeholder="Search..."
|
||||
placeholder="{$tr('Search')}..."
|
||||
class="join-item input w-full border border-neutral rounded-full"
|
||||
bind:this={searchBox}
|
||||
bind:value={searchBoxText}
|
||||
@@ -205,7 +205,7 @@
|
||||
await searchVideos();
|
||||
}}
|
||||
>
|
||||
Load more
|
||||
{$tr("Load more")}
|
||||
</button>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { PlayletApi } from "lib/Api/PlayletApi";
|
||||
import { userPreferencesStore } from "lib/Stores";
|
||||
import { tr, userPreferencesStore } from "lib/Stores";
|
||||
|
||||
const textSizes = ["text-2xl", "text-lg", "text-base", "text-sm", "text-xs"];
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
<div class="form-control m-5">
|
||||
<label class="label p-0 cursor-pointer">
|
||||
<div class="label-text {textSizes[level]}">{displayText}</div>
|
||||
<div class="label-text {textSizes[level]}">{$tr(displayText)}</div>
|
||||
<input
|
||||
type="checkbox"
|
||||
name={key}
|
||||
@@ -32,5 +32,5 @@
|
||||
class="checkbox"
|
||||
/>
|
||||
</label>
|
||||
<div class="text-xs text-gray-500">{@html description}</div>
|
||||
<div class="text-xs text-gray-500">{@html $tr(description)}</div>
|
||||
</div>
|
||||
+7
-5
@@ -1,6 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { PlayletApi } from "lib/Api/PlayletApi";
|
||||
import { searchHistoryStore } from "lib/Stores";
|
||||
import { searchHistoryStore, tr } from "lib/Stores";
|
||||
import { get } from "svelte/store";
|
||||
|
||||
const textSizes = ["text-2xl", "text-lg", "text-base", "text-sm", "text-xs"];
|
||||
|
||||
@@ -13,14 +14,15 @@
|
||||
async function clearSeachHistory() {
|
||||
await PlayletApi.clearSearchHistory();
|
||||
searchHistoryStore.set([]);
|
||||
alert("Search history cleared.");
|
||||
|
||||
alert(get(tr)("Search history cleared."));
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="m-5">
|
||||
<div class={textSizes[level]}>{displayText}</div>
|
||||
<div class="text-xs text-gray-500">{@html description}</div>
|
||||
<div class={textSizes[level]}>{$tr(displayText)}</div>
|
||||
<div class="text-xs text-gray-500">{@html $tr(description)}</div>
|
||||
<button class="btn m-1" on:click={clearSeachHistory}
|
||||
>Clear search history</button
|
||||
>{$tr("Clear search history")}</button
|
||||
>
|
||||
</div>
|
||||
@@ -2,6 +2,7 @@
|
||||
import {
|
||||
homeLayoutFileStore,
|
||||
homeLayoutStore,
|
||||
tr,
|
||||
userPreferencesStore,
|
||||
} from "lib/Stores";
|
||||
import ArrowUpIcon from "assets/remote-control/arrow-up.svg.svelte";
|
||||
@@ -84,10 +85,10 @@
|
||||
</script>
|
||||
|
||||
<div class="m-5">
|
||||
<div class={textSizes[level]}>{displayText}</div>
|
||||
<div class="text-xs text-gray-500">{@html description}</div>
|
||||
<div class={textSizes[level]}>{$tr(displayText)}</div>
|
||||
<div class="text-xs text-gray-500">{@html $tr(description)}</div>
|
||||
<button class="btn m-1" on:click={openHomeScreenEditor}
|
||||
>Edit home screen</button
|
||||
>{$tr("Edit home screen")}</button
|
||||
>
|
||||
</div>
|
||||
|
||||
@@ -110,7 +111,7 @@
|
||||
</td>
|
||||
<td>
|
||||
<label class="label p-0 cursor-pointer">
|
||||
<div class="label-text">{homeLayout[item.id].title}</div>
|
||||
<div class="label-text">{$tr(homeLayout[item.id].title)}</div>
|
||||
<input
|
||||
type="checkbox"
|
||||
name={item.id}
|
||||
@@ -134,12 +135,12 @@
|
||||
{/each}
|
||||
</table>
|
||||
<form method="dialog" class="flex justify-center space-x-2">
|
||||
<button class="btn btn-primary" on:click={save}>Save</button>
|
||||
<button class="btn btn-primary">Close</button>
|
||||
<button class="btn btn-primary" on:click={save}>{$tr("Save")}</button>
|
||||
<button class="btn btn-primary">{$tr("Close")}</button>
|
||||
</form>
|
||||
{/if}
|
||||
</div>
|
||||
<form method="dialog" class="modal-backdrop">
|
||||
<button>Close</button>
|
||||
<button>{$tr("Close")}</button>
|
||||
</form>
|
||||
</dialog>
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { PlayletApi } from "lib/Api/PlayletApi";
|
||||
import { userPreferencesStore } from "lib/Stores";
|
||||
import { tr, userPreferencesStore } from "lib/Stores";
|
||||
const textSizes = ["text-2xl", "text-lg", "text-base", "text-sm", "text-xs"];
|
||||
export let displayText: string = "";
|
||||
export let key: string = "";
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
<div class="form-control m-5">
|
||||
<label class="label p-0 cursor-pointer">
|
||||
<div class="label-text {textSizes[level]}">{displayText}</div>
|
||||
<div class="label-text {textSizes[level]}">{$tr(displayText)}</div>
|
||||
<div class="join mt-2 mb-2">
|
||||
<button
|
||||
class="join-item btn btn-sm btn-primary"
|
||||
@@ -52,5 +52,5 @@
|
||||
</button>
|
||||
</div>
|
||||
</label>
|
||||
<div class="text-xs text-gray-500">{@html description}</div>
|
||||
<div class="text-xs text-gray-500">{@html $tr(description)}</div>
|
||||
</div>
|
||||
+18
-9
@@ -1,8 +1,9 @@
|
||||
<script lang="ts">
|
||||
import { onMount } from "svelte";
|
||||
import { PlayletApi } from "lib/Api/PlayletApi";
|
||||
import { playletStateStore } from "lib/Stores";
|
||||
import { playletStateStore, tr } from "lib/Stores";
|
||||
import { ExternalControlProtocol } from "lib/Api/ExternalControlProtocol";
|
||||
import { get } from "svelte/store";
|
||||
|
||||
let selectedRelease = "";
|
||||
let releases = [];
|
||||
@@ -65,23 +66,31 @@
|
||||
if (version === "") {
|
||||
version = "latest";
|
||||
}
|
||||
|
||||
const trFn = get(tr);
|
||||
|
||||
if (
|
||||
confirm(
|
||||
`Are you sure you want to change the Playlet Library version to "${version}"?\nThis will restart Playlet.`
|
||||
)
|
||||
trFn(
|
||||
"Are you sure you want to change the Playlet Library version to %1"
|
||||
).replace("%1", version)
|
||||
) +
|
||||
`\n` +
|
||||
trFn("This will restart Playlet.")
|
||||
) {
|
||||
await PlayletApi.setPlayletLibVersion(selectedRelease);
|
||||
alert("Playlet Library version set. Playlet will now restart.");
|
||||
alert(trFn("Playlet Library version changed. Playlet will now restart."));
|
||||
await ExternalControlProtocol.restartApp(appId);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="m-5">
|
||||
<div class="text-lg">Playlet Library version</div>
|
||||
<div class="text-lg">{$tr("Playlet Library version")}</div>
|
||||
<div class="text-xs text-gray-500">
|
||||
The version of Playlet Lib to use. These correspond to tagged releases on
|
||||
Github. Releases that do not have a playlet-lib.zip file are disabled.
|
||||
{$tr(
|
||||
"The version of Playlet Lib to use. These correspond to tagged releases on Github. Releases that do not have a playlet-lib.zip file are disabled."
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div class="join w-full m-1">
|
||||
@@ -89,13 +98,13 @@
|
||||
bind:value={selectedRelease}
|
||||
class="select select-bordered join-item w-full mr-1"
|
||||
>
|
||||
<option selected value="">latest (default)</option>
|
||||
<option selected value=""></option>
|
||||
{#each releases as release}
|
||||
<option disabled={!release.enabled} value={release.name}
|
||||
>{release.name}</option
|
||||
>
|
||||
{/each}
|
||||
</select>
|
||||
<button class="join-item btn" on:click={apply}>Apply</button>
|
||||
<button class="join-item btn" on:click={apply}>{$tr("Apply")}</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { PlayletApi } from "lib/Api/PlayletApi";
|
||||
import { userPreferencesStore } from "lib/Stores";
|
||||
import { tr, userPreferencesStore } from "lib/Stores";
|
||||
|
||||
const textSizes = ["text-2xl", "text-lg", "text-base", "text-sm", "text-xs"];
|
||||
|
||||
@@ -24,13 +24,13 @@
|
||||
</script>
|
||||
|
||||
<div class="m-5">
|
||||
<div class={textSizes[level]}>{displayText}</div>
|
||||
<div class="text-xs text-gray-500">{@html description}</div>
|
||||
<div class={textSizes[level]}>{$tr(displayText)}</div>
|
||||
<div class="text-xs text-gray-500">{@html $tr(description)}</div>
|
||||
|
||||
{#each options as option}
|
||||
<div class="form-control">
|
||||
<label class="label cursor-pointer">
|
||||
<span class="label-text">{option.displayText}</span>
|
||||
<span class="label-text">{$tr(option.displayText)}</span>
|
||||
<input
|
||||
type="radio"
|
||||
name={key}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
<script lang="ts">
|
||||
import { PlayletApi } from "lib/Api/PlayletApi";
|
||||
import { userPreferencesStore } from "lib/Stores";
|
||||
import { tr, userPreferencesStore } from "lib/Stores";
|
||||
|
||||
const textSizes = ["text-2xl", "text-lg", "text-base", "text-sm", "text-xs"];
|
||||
const invidiousPublicInstancesLink = `<a class="link" href="https://api.invidious.io" target="_blank" rel="noopener noreferrer">https://api.invidious.io</a>`;
|
||||
|
||||
export let displayText: string = "";
|
||||
export let key: string = "";
|
||||
@@ -26,8 +27,14 @@
|
||||
</script>
|
||||
|
||||
<div class="m-5">
|
||||
<div class={textSizes[level]}>{displayText}</div>
|
||||
<div class="text-xs text-gray-500">{@html description}</div>
|
||||
<div class={textSizes[level]}>{$tr(displayText)}</div>
|
||||
<div class="text-xs text-gray-500">
|
||||
<!-- TODO:P2 this should not be hardcoded here -->
|
||||
{@html $tr(description).replace(
|
||||
"$INVIDIOUS_PUBLIC_INSTANCES",
|
||||
invidiousPublicInstancesLink
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div class="join w-full m-1">
|
||||
<input
|
||||
@@ -38,7 +45,7 @@
|
||||
class="join-item input w-full mr-1"
|
||||
/>
|
||||
{#if inputValue !== currentValue}
|
||||
<button class="join-item btn" on:click={save}>Save</button>
|
||||
<button class="join-item btn" on:click={save}>{$tr("Save")}</button>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
@@ -6,6 +6,7 @@
|
||||
import RadioControl from "lib/Screens/Settings/SettingControls/RadioControl.svelte";
|
||||
import StringControl from "lib/Screens/Settings/SettingControls/StringControl.svelte";
|
||||
import NumberControl from "./SettingControls/NumberControl.svelte";
|
||||
import { tr } from "lib/Stores";
|
||||
|
||||
const textSizes = ["text-2xl", "text-lg", "text-base", "text-sm", "text-xs"];
|
||||
|
||||
@@ -53,8 +54,8 @@
|
||||
/>
|
||||
{:else}
|
||||
<div class="m-5">
|
||||
<div class={textSizes[level]}>{displayText}</div>
|
||||
<div class="text-xs text-gray-500">{description}</div>
|
||||
<div class={textSizes[level]}>{$tr(displayText)}</div>
|
||||
<div class="text-xs text-gray-500">{$tr(description)}</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
|
||||
Reference in new issue
Block a user