Skip to content

Commit

Permalink
feat: locale - fullfill missing pieces of translations (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
ramiroaisen authored Jun 25, 2023
2 parents d8b4e75 + d5cc5e7 commit a7688c3
Show file tree
Hide file tree
Showing 32 changed files with 338 additions and 116 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@
{#if now_playing.start_on_connect}
<div class="now-playing-sub">
{#if now_playing.external_relay_url != null}
<!-- TODO: locale -->
Relay
{$locale.misc.Relay}
{:else}
{$locale.pages["account/dashboard"].station_item.playlist}
{/if}
Expand All @@ -126,8 +125,7 @@
{:else if now_playing.kind === "playlist"}
{$locale.pages["account/dashboard"].station_item.playlist}
{:else if now_playing.kind === "external-relay"}
<!-- TODO: locale -->
Relay
{$locale.misc.Relay}
{/if}
</div>
{/if}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,12 @@
{#if data.now_playing.kind === "playlist"}
{$locale.pages["station/dashboard"].playlist}
{:else if data.now_playing.kind === "external-relay"}
<!-- TODO: locale -->
Relay
{$locale.misc.Relay}
{:else if data.now_playing.kind === "live"}
{$locale.pages["station/dashboard"].live}
{:else if data.now_playing.kind === "none"}
{#if data.now_playing.external_relay_url != null}
<!-- TODO: locale -->
Relay
{$locale.misc.Relay}
{:else}
{$locale.pages["station/dashboard"].playlist}
{/if}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@
}
await _patch(`/api/stations/${data.station._id}`, payload);
// TODO: locale
_message("Settings updated");
_message($locale.misc.Settings_updated);
saving_relay = false;
} catch(e) {
Expand Down Expand Up @@ -265,18 +264,16 @@
<div class="page-title">{$locale.pages["station/settings"].title}</div>

<div class="section">
<!-- TODO: locale -->
<h2>Master relay</h2>

<h2>{$locale.misc.Master_relay}</h2>

<Formy action={save_external_relay} let:submit>
<form class="section-box relay-box" on:submit={submit}>
<div class="relay-switch">
<!-- TODO: locale -->
<BooleanField bind:value={external_relay_enabled} label="Enable master relay" />
<BooleanField bind:value={external_relay_enabled} label={$locale.misc.Enable_master_relay} />
</div>
<div class="relay-field">
<!-- TODO: locale -->
<TextField label="Master Relay URL" disabled={!external_relay_enabled} bind:value={external_relay_url} />
<TextField label={$locale.misc.Master_Relay_URL} disabled={!external_relay_enabled} bind:value={external_relay_url} />
<Validator value={external_relay_url} fn={_validate_external_relay_url} />
</div>

Expand All @@ -285,8 +282,7 @@
<!-- <div class="invite-dialog-send-icon">
<Icon d={mdiAccountPlusOutline} />
</div> -->
<!-- TODO: locale -->
Save
{$locale.misc.Save}
</div>
{#if saving_relay}
<div class="relay-send-sending" transition:scale|local={{ duration: 300 }}>
Expand Down Expand Up @@ -356,18 +352,16 @@
</Formy>
{:else}
<div class="delete-no-owner-message">
<!-- TODO: locale -->
Only account administrators can delete stations. <br/> <br/>
Contact the account administrators if you want to delete this station.

{@html $locale.misc.delete_station_not_owner_message_html}

<div class="delete-dialog-btns">
<button
class="delete-dialog-btn-cancel ripple-container"
use:ripple
on:click={() => (delete_open = false)}
>
<!-- TODO: locale -->
OK
{@html $locale.misc.delete_station_not_owner_OK}
</button>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
export let data: import("./$types").PageData;
import Page from "$lib/components/Page.svelte";
import { ripple } from "$share/ripple";
import { locale } from "$lib/locale";
</script>

<style>
Expand Down Expand Up @@ -37,17 +38,22 @@
</style>

<svelte:head>
<title>Welcome</title>
<title>{$locale.misc.Welcome}</title>
</svelte:head>

<Page>
<h1>Hello <b>{data.user.first_name}</b></h1>
<p>Welcome to <b>openstream</b></p>
<p>You are now the owner of your newly created account</p>
<p>To start broadcasting right away, add your first station to your account</p>

<h1>
{@html $locale.misc.account_welcome_title_html.replace("@name", data.user.first_name)}
</h1>

<p>{@html $locale.misc.account_welcome_message_1_html.replace("@brand", $locale.brand_name)}</p>
<p>{@html $locale.misc.account_welcome_message_2_html}</p>
<p>{@html $locale.misc.account_welcome_message_3_html}</p>

<div class="btn-out">
<a class="na btn ripple-container" href="/accounts/{data.account._id}/stations/create-station" use:ripple>
Create my first station
{$locale.misc.Create_my_first_station}
</a>
</div>
</Page>
7 changes: 4 additions & 3 deletions front/server/src/locale/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ while (true) {
break;
}

const kinds = ["studio", "admin", "wip", "countries", "stats-map", "validate", "type-of-content", "analytics", "payments"];
const kinds = ["studio", "admin", "misc", "wip", "countries", "stats-map", "validate", "type-of-content", "analytics", "payments"];
let selected_kinds: string[];

while (true) {
Expand Down Expand Up @@ -82,6 +82,7 @@ for (const iso of isos) {
const dir = kind === "studio" ? "studio" :
kind === "admin" ? "admin" :
kind === "wip" ? "wip" :
kind === "misc" ? "misc" :
`share/${kind}`;

const src = `${__dirname}/${dir}/${kind}.${base}.ts`;
Expand Down Expand Up @@ -114,7 +115,7 @@ for (const iso of isos) {
}))

const createChatCompletion = async function* (params: {
model: "gpt-4" | "gpt-3.5-turbo",
model: "gpt-4" | "gpt-3.5-turbo" | "gpt-3.5-turbo-16k",
messages: ChatCompletionRequestMessage[]
}) {
const res = await client.createChatCompletion({
Expand Down Expand Up @@ -188,7 +189,7 @@ for (const iso of isos) {
}

const stream = createChatCompletion({
model: "gpt-4",
model: "gpt-3.5-turbo-16k",
messages
})

Expand Down
21 changes: 21 additions & 0 deletions front/server/src/locale/misc/misc.ar.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const locale = {
Relay: "ريلي",
Settings_updated: "تم تحديث الإعدادات",
Master_relay: "ريلي رئيسي",
Enable_master_relay: "تمكين الريلي الرئيسي",
Master_Relay_URL: "عنوان URL للريلي الرئيسي",
Save: "حفظ",
delete_station_not_owner_message_html: "يمكن لمسؤولي الحساب فقط حذف المحطات.<br/><br/>اتصل بمسؤولي الحساب إذا كنت ترغب في حذف هذه المحطة.",
delete_station_not_owner_OK: "موافق",

Welcome: "مرحبًا",

account_welcome_title_html: "مرحبًا <b>@name</b>",
account_welcome_message_1_html: "مرحبًا بك في <b>@brand</b>",
account_welcome_message_2_html: "أنت الآن صاحب حسابك الجديد",
account_welcome_message_3_html: "للبدء في البث الآن، أضف أول محطة إلى حسابك",

Create_my_first_station: "إنشاء أول محطة لي",
}

export default locale;
21 changes: 21 additions & 0 deletions front/server/src/locale/misc/misc.de.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const locale = {
Relay: "Relais",
Settings_updated: "Einstellungen aktualisiert",
Master_relay: "Hauptrelais",
Enable_master_relay: "Hauptrelais aktivieren",
Master_Relay_URL: "URL des Hauptrelais",
Save: "Speichern",
delete_station_not_owner_message_html: "Nur Kontoadministratoren können Stationen löschen.<br/><br/>Wenn Sie diese Station löschen möchten, wenden Sie sich bitte an die Kontoadministratoren.",
delete_station_not_owner_OK: "OK",

Welcome: "Willkommen",

account_welcome_title_html: "Hallo <b>@name</b>",
account_welcome_message_1_html: "Willkommen bei <b>@brand</b>",
account_welcome_message_2_html: "Sie sind jetzt der Besitzer Ihres neuen Kontos",
account_welcome_message_3_html: "Um jetzt mit dem Streamen zu beginnen, fügen Sie Ihre erste Station zu Ihrem Konto hinzu",

Create_my_first_station: "Meine erste Station erstellen",
}

export default locale;
21 changes: 21 additions & 0 deletions front/server/src/locale/misc/misc.en.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const locale = {
Relay: "Relay",
Settings_updated: "Settings updated",
Master_relay: "Master relay",
Enable_master_relay: "Enable_master_relay",
Master_Relay_URL: "Master Relay URL",
Save: "Save",
delete_station_not_owner_message_html: "Only account administrators can delete stations.<br/><br/>Contact the account administrators if you want to delete this station.",
delete_station_not_owner_OK: "OK",

Welcome: "Welcome",

account_welcome_title_html: "Hello <b>@name</b>",
account_welcome_message_1_html: "Welcome to <b>@brand</b>",
account_welcome_message_2_html: "You are now the owner of your newly created account",
account_welcome_message_3_html: "To start broadcasting right away, add your first station to your account",

Create_my_first_station: "Create my first station",
}

export default locale;
22 changes: 22 additions & 0 deletions front/server/src/locale/misc/misc.es-AR.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/// file: wip.es.ts
const locale = {
Relay: "Relay",
Settings_updated: "Configuración actualizada",
Master_relay: "Relay maestro",
Enable_master_relay: "Habilitar relay maestro",
Master_Relay_URL: "URL del relay maestro",
Save: "Guardar",
delete_station_not_owner_message_html: "Solo los administradores de la cuenta pueden eliminar estaciones.<br/><br/>Contacta a los administradores de la cuenta si deseas eliminar esta estación.",
delete_station_not_owner_OK: "Aceptar",

Welcome: "Bienvenido",

account_welcome_title_html: "Hola <b>@name</b>",
account_welcome_message_1_html: "Bienvenido a <b>@brand</b>",
account_welcome_message_2_html: "Desde ahora sos el dueño de tu nueva cuenta",
account_welcome_message_3_html: "Para empezar a transmitir ahora, agregá tu primera estación a tu cuenta",

Create_my_first_station: "Crear mi primera estación",
}

export default locale;
22 changes: 22 additions & 0 deletions front/server/src/locale/misc/misc.es.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/// file: wip.es.ts
const locale = {
Relay: "Relay",
Settings_updated: "Configuración actualizada",
Master_relay: "Relay maestro",
Enable_master_relay: "Habilitar relay maestro",
Master_Relay_URL: "URL del relay maestro",
Save: "Guardar",
delete_station_not_owner_message_html: "Solo los administradores de la cuenta pueden eliminar estaciones.<br/><br/>Contacta a los administradores de la cuenta si deseas eliminar esta estación.",
delete_station_not_owner_OK: "Aceptar",

Welcome: "Bienvenido",

account_welcome_title_html: "Hola <b>@name</b>",
account_welcome_message_1_html: "Bienvenido a <b>@brand</b>",
account_welcome_message_2_html: "Desde ahora eres el dueño de tu nueva cuenta",
account_welcome_message_3_html: "Para empezar a transmitir ahora, agregá tu primera estación a tu cuenta",

Create_my_first_station: "Crear mi primera estación",
}

export default locale;
21 changes: 21 additions & 0 deletions front/server/src/locale/misc/misc.fr.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const locale = {
Relay: "Relais",
Settings_updated: "Paramètres mis à jour",
Master_relay: "Relais maître",
Enable_master_relay: "Activer le relais maître",
Master_Relay_URL: "URL du relais maître",
Save: "Enregistrer",
delete_station_not_owner_message_html: "Seuls les administrateurs du compte peuvent supprimer des stations.<br/><br/>Contactez les administrateurs du compte si vous souhaitez supprimer cette station.",
delete_station_not_owner_OK: "OK",

Welcome: "Bienvenue",

account_welcome_title_html: "Bonjour <b>@name</b>",
account_welcome_message_1_html: "Bienvenue sur <b>@brand</b>",
account_welcome_message_2_html: "Vous êtes maintenant le propriétaire de votre nouveau compte",
account_welcome_message_3_html: "Pour commencer à diffuser maintenant, ajoutez votre première station à votre compte",

Create_my_first_station: "Créer ma première station",
}

export default locale;
21 changes: 21 additions & 0 deletions front/server/src/locale/misc/misc.it.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const locale = {
Relay: "Relè",
Settings_updated: "Impostazioni aggiornate",
Master_relay: "Relè principale",
Enable_master_relay: "Abilita relè principale",
Master_Relay_URL: "URL relè principale",
Save: "Salva",
delete_station_not_owner_message_html: "Solo gli amministratori dell'account possono eliminare le stazioni.<br/><br/>Contatta gli amministratori dell'account se desideri eliminare questa stazione.",
delete_station_not_owner_OK: "OK",

Welcome: "Benvenuto",

account_welcome_title_html: "Ciao <b>@name</b>",
account_welcome_message_1_html: "Benvenuto su <b>@brand</b>",
account_welcome_message_2_html: "Da ora sei il proprietario del tuo nuovo account",
account_welcome_message_3_html: "Per iniziare a trasmettere, aggiungi la tua prima stazione al tuo account",

Create_my_first_station: "Crea la mia prima stazione",
}

export default locale;
21 changes: 21 additions & 0 deletions front/server/src/locale/misc/misc.pt.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const locale = {
Relay: "Relé",
Settings_updated: "Configuração atualizada",
Master_relay: "Relé mestre",
Enable_master_relay: "Habilitar relé mestre",
Master_Relay_URL: "URL do relé mestre",
Save: "Salvar",
delete_station_not_owner_message_html: "Apenas os administradores da conta podem excluir estações.<br/><br/>Entre em contato com os administradores da conta se você deseja excluir esta estação.",
delete_station_not_owner_OK: "Aceitar",

Welcome: "Bem-vindo",

account_welcome_title_html: "Olá <b>@name</b>",
account_welcome_message_1_html: "Bem-vindo ao <b>@brand</b>",
account_welcome_message_2_html: "A partir de agora, você é o proprietário da sua nova conta",
account_welcome_message_3_html: "Para começar a transmitir agora, adicione sua primeira estação à sua conta",

Create_my_first_station: "Criar minha primeira estação",
}

export default locale;
21 changes: 21 additions & 0 deletions front/server/src/locale/misc/misc.zh.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const locale = {
Relay: "中继",
Settings_updated: "设置已更新",
Master_relay: "主中继",
Enable_master_relay: "启用主中继",
Master_Relay_URL: "主中继URL",
Save: "保存",
delete_station_not_owner_message_html: "只有账户管理员才能删除电台。<br/><br/>如果您想删除此电台,请联系账户管理员。",
delete_station_not_owner_OK: "确定",

Welcome: "欢迎",

account_welcome_title_html: "你好<b>@name</b>",
account_welcome_message_1_html: "欢迎来到<b>@brand</b>",
account_welcome_message_2_html: "你现在是你的新账户的所有者",
account_welcome_message_3_html: "要开始现在进行广播,请将你的第一个电台添加到你的账户中",

Create_my_first_station: "创建我的第一个电台",
}

export default locale;
Loading

0 comments on commit a7688c3

Please sign in to comment.