Locale tweak
This commit is contained in:
1 parent
75c965fd8b
commit
3375ce9f4f
5 files changed
+20
-5
No files matched your search
+3
-2
@@ -3,13 +3,14 @@ import "pkg:/components/Services/Invidious/InvidiousService.bs"
|
||||
import "pkg:/source/utils/FocusManagement.bs"
|
||||
import "pkg:/source/utils/StringUtils.bs"
|
||||
import "pkg:/source/utils/Types.bs"
|
||||
import "pkg:/source/utils/Locale.bs"
|
||||
|
||||
function Init()
|
||||
m.top.focusable = true
|
||||
m.top.itemSpacings = [8]
|
||||
|
||||
m.button = m.top.findNode("button")
|
||||
m.button.text = Invidious.DEFAULT_INSTANCE_NAME
|
||||
m.button.text = Tr(Locale.Settings.PlayletBuiltinBackend)
|
||||
AdjustButtonLabel(m.button)
|
||||
|
||||
m.button.observeField("buttonSelected", FuncName(OpenInvidiousInstanceSettings))
|
||||
@@ -81,7 +82,7 @@ function OnValueChange() as void
|
||||
m.preferences[m.key] = value
|
||||
|
||||
if StringUtils.IsNullOrEmpty(value)
|
||||
m.button.text = Invidious.DEFAULT_INSTANCE_NAME
|
||||
m.button.text = Tr(Locale.Settings.PlayletBuiltinBackend)
|
||||
else
|
||||
m.button.text = value
|
||||
end if
|
||||
|
||||
@@ -14,7 +14,6 @@ namespace Invidious
|
||||
const INSTANCES_API = "https://api.invidious.io/instances.json?sort_by=type,users"
|
||||
|
||||
const DEFAULT_INSTANCE = "http://127.0.0.1:8888/playlet-invidious-backend"
|
||||
const DEFAULT_INSTANCE_NAME = "Playlet built-in backend"
|
||||
const INSTANCE_EXAMPLE = "https://invidious.example.com"
|
||||
|
||||
const TOKEN_CALLBACK = "/invidious/token_callback"
|
||||
|
||||
@@ -756,6 +756,10 @@
|
||||
<source>Instance</source>
|
||||
<translation>Instance</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Playlet built-in backend</source>
|
||||
<translation>Playlet built-in backend</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Invidious instance to use. Example: https://example.com</source>
|
||||
<translation>Invidious instance to use. Example: https://example.com</translation>
|
||||
|
||||
@@ -249,6 +249,7 @@ namespace Locale
|
||||
' Invidious = "Invidious"
|
||||
InvidiousPreferences = "Invidious preferences"
|
||||
Instance = "Instance"
|
||||
PlayletBuiltinBackend = "Playlet built-in backend"
|
||||
InstanceDescriptionTV = "Invidious instance to use. Example: https://example.com"
|
||||
ProxyVideos = "Proxy videos"
|
||||
ProxyVideosDescription = "Proxy videos through the Invidious server. This is useful if videos are geoblocked."
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
import { playletStateStore, translate } from "lib/Stores";
|
||||
import { PlayletApi } from "./Api/PlayletApi";
|
||||
import { get } from "svelte/store";
|
||||
import { getHost } from "./Api/Host";
|
||||
|
||||
const host = () => `http://${getHost()}`;
|
||||
|
||||
export function show() {
|
||||
modal.showModal();
|
||||
@@ -23,12 +26,19 @@
|
||||
|
||||
let authUrl;
|
||||
let currentInstance;
|
||||
let currentInstanceName;
|
||||
|
||||
let accordionState = null;
|
||||
|
||||
playletStateStore.subscribe((value) => {
|
||||
authUrl = value?.invidious?.auth_url;
|
||||
currentInstance = value?.invidious?.current_instance;
|
||||
currentInstance = value?.invidious?.current_instance || "";
|
||||
if (currentInstance === `${host()}/playlet-invidious-backend`) {
|
||||
const trFn = get(translate);
|
||||
currentInstanceName = trFn("Playlet built-in backend");
|
||||
} else {
|
||||
currentInstanceName = currentInstance;
|
||||
}
|
||||
profiles = value?.profiles?.profiles ?? [];
|
||||
currentProfile = profiles.find(
|
||||
(p) => p.id === value?.profiles?.currentProfile
|
||||
@@ -126,7 +136,7 @@
|
||||
<button class="btn btn-primary" on:click={login}>
|
||||
<div class="">
|
||||
<div class="text-m">{$translate("Login to Invidious")}</div>
|
||||
<div class="text-xs font-light">{currentInstance}</div>
|
||||
<div class="text-xs font-light">{currentInstanceName}</div>
|
||||
</div>
|
||||
</button>
|
||||
<button class="btn m-6">{$translate("Close")}</button>
|
||||
|
||||
Reference in new issue
Block a user