commit fdcf5efab7584916ffb86491ab344c2b53671d21 parent e26ef4fbe08fefffb1fcd3bcbe51fb16a8ab56a9 Author: triesap <137732411+triesap@users.noreply.github.com> Date: Sat, 7 Dec 2024 19:28:04 +0000 Update localised string translation function. Edit `/settings/profile` layout, styles. Diffstat:
25 files changed, 537 insertions(+), 519 deletions(-)
diff --git a/src/lib/components/image_upload_add_photo.svelte b/src/lib/components/image_upload_add_photo.svelte @@ -1,6 +1,6 @@ <script lang="ts"> import { dialog } from "$lib/client"; - import { Glyph, t } from "@radroots/svelte-lib"; + import { Glyph, ls } from "@radroots/svelte-lib"; export let photo_path: string; @@ -35,7 +35,7 @@ <p class={`font-arch font-[600] text-sm text-layer-0-glyph capitalize`} > - {`${$t(`icu.add_*`, { value: `${$t(`common.photo`)}` })}`} + {`${$ls(`icu.add_*`, { value: `${$ls(`common.photo`)}` })}`} </p> </div> </button> diff --git a/src/lib/components/image_upload_control.svelte b/src/lib/components/image_upload_control.svelte @@ -1,6 +1,6 @@ <script lang="ts"> import { dialog, fs } from "$lib/client"; - import { app_layout, Glyph, ImageBlob, t } from "@radroots/svelte-lib"; + import { app_layout, Glyph, ImageBlob, ls } from "@radroots/svelte-lib"; import { list_assign } from "@radroots/utils"; import { fade } from "svelte/transition"; @@ -256,7 +256,7 @@ <p class={`font-sans font-[500] text-[0.9rem] text-layer-0-glyph/80 scale-y-[94%]`} > - {`${$t(`icu.primary_*`, { value: `${$t(`common.photo`)}` })}`} + {`${$ls(`icu.primary_*`, { value: `${$ls(`common.photo`)}` })}`} </p> </div> </div> diff --git a/src/lib/components/image_upload_edit_envelope.svelte b/src/lib/components/image_upload_edit_envelope.svelte @@ -5,7 +5,7 @@ envelope_visible, EnvelopeLower, ImageBlob, - t, + ls, time_iso, } from "@radroots/svelte-lib"; import { @@ -18,14 +18,6 @@ export let photo_paths: string[]; export let photo_edit: { index: number; file_path: string } | undefined; - /*export let basis: { - close: CallbackPromise; - callback_move: CallbackPromiseGeneric<number>; - photo_edit: { index: number; file_path: string } | undefined; - }; - $: basis = basis; - */ - $: envelope_visible.set(!!photo_edit); onMount(async () => { @@ -91,9 +83,9 @@ > <p class={`font-sans font-[600] text-lg text-white`}> {#if photo_edit.index === 0} - {`${$t(`icu.primary_*`, { value: `${$t(`common.photo`)}`.toLowerCase() })}`} + {`${$ls(`icu.primary_*`, { value: `${$ls(`common.photo`)}`.toLowerCase() })}`} {:else} - {`${$t(`common.make_primary`)}`} + {`${$ls(`common.make_primary`)}`} {/if} </p> </button> @@ -108,7 +100,7 @@ <p class={`col-span-8 font-sans font-[400] text-[1.05rem] text-layer-0-glyph`} > - {`${$t(`common.file_name`)}:`} + {`${$ls(`common.file_name`)}:`} </p> <p class={`col-span-8 font-sans font-[400] text-[1.05rem] text-layer-0-glyph`} @@ -122,7 +114,7 @@ <p class={`col-span-8 font-sans font-[400] text-[1.05rem] text-layer-0-glyph`} > - {`${$t(`common.file_size`)}:`} + {`${$ls(`common.file_size`)}:`} </p> <p class={`col-span-8 font-sans font-[400] text-[1.05rem] text-layer-0-glyph`} @@ -136,12 +128,12 @@ <p class={`col-span-8 font-sans font-[400] text-[1.05rem] text-layer-0-glyph`} > - {`${$t(`common.date_created`)}:`} + {`${$ls(`common.date_created`)}:`} </p> <p class={`col-span-8 font-sans font-[400] text-[1.05rem] text-layer-0-glyph`} > - {`${time_iso(fs_info.birthtime?.toISOString(), `file_info`).replaceAll(`,`, ` ${`${$t(`common.at`)}`.toLowerCase()}`)}`} + {`${time_iso(fs_info.birthtime?.toISOString(), `file_info`).replaceAll(`,`, ` ${`${$ls(`common.at`)}`.toLowerCase()}`)}`} </p> </div> <div @@ -150,12 +142,12 @@ <p class={`col-span-8 font-sans font-[400] text-[1.05rem] text-layer-0-glyph`} > - {`${$t(`common.date_modified`)}:`} + {`${$ls(`common.date_modified`)}:`} </p> <p class={`col-span-8 font-sans font-[400] text-[1.05rem] text-layer-0-glyph`} > - {`${time_iso(fs_info.mtime?.toISOString(), `file_info`).replaceAll(`,`, ` ${`${$t(`common.at`)}`.toLowerCase()}`)}`} + {`${time_iso(fs_info.mtime?.toISOString(), `file_info`).replaceAll(`,`, ` ${`${$ls(`common.at`)}`.toLowerCase()}`)}`} </p> </div> </div> diff --git a/src/lib/components/map_point_select_envelope.svelte b/src/lib/components/map_point_select_envelope.svelte @@ -8,7 +8,7 @@ envelope_visible, EnvelopeLower, Glyph, - t, + ls, type CallbackPromise, } from "@radroots/svelte-lib"; import { MapLibre, Marker } from "@radroots/svelte-maplibre"; @@ -144,7 +144,7 @@ <p class={`font-sans font-[400] text-layer-0-glyph text-[1rem] capitalize`} > - {`${$t(`common.back`)}`} + {`${$ls(`common.back`)}`} </p> </button> </div> diff --git a/src/lib/components/trade_product_list_card.svelte b/src/lib/components/trade_product_list_card.svelte @@ -11,8 +11,8 @@ Glyph, ImagePath, locale, + ls, route, - t, } from "@radroots/svelte-lib"; import { fmt_currency_price, @@ -97,7 +97,7 @@ }} > <p class={`font-sans font-[500] text-layer-0-glyph`}> - {`${$t(`common.view`)}`} + {`${$ls(`common.view`)}`} </p> </button> </div> @@ -178,7 +178,7 @@ <p class={`font-sans font-[500] text-[1rem] text-layer-0-glyph group-active:text-layer-0-glyph_a el-re`} > - {`${$t(`icu.no_*`, { value: `${$t(`common.photos`)}`.toLowerCase() })}`} + {`${$ls(`icu.no_*`, { value: `${$ls(`common.photos`)}`.toLowerCase() })}`} </p> </div> </div> @@ -211,7 +211,7 @@ basis={{ classes: `col-span-12`, label: { - value: `${$t(`common.origin`)}`, + value: `${$ls(`common.origin`)}`, }, data: { value: `${fmt_geol_latitude( @@ -239,10 +239,10 @@ basis={{ classes: `col-span-12`, label: { - value: `${$t(`common.price`)}`, + value: `${$ls(`common.price`)}`, }, data: { - value: `${price ? fmt_currency_price(price) : ``} / ${`${$t(`measurement.mass.unit.${trade_product.price_qty_unit}_ab`)}`}`, + value: `${price ? fmt_currency_price(price) : ``} / ${`${$ls(`measurement.mass.unit.${trade_product.price_qty_unit}_ab`)}`}`, }, }} /> @@ -251,10 +251,10 @@ basis={{ classes: `col-span-12`, label: { - value: `${$t(`icu.*_order`, { value: `${$t(`common.quantity`)}` })}`, + value: `${$ls(`icu.*_order`, { value: `${$ls(`common.quantity`)}` })}`, }, data: { - value: `${trade_product.qty_amt} / ${`${$t(`measurement.mass.unit.${trade_product.qty_unit}_ab`)}`}`, + value: `${trade_product.qty_amt} / ${`${$ls(`measurement.mass.unit.${trade_product.qty_unit}_ab`)}`}`, }, }} /> @@ -262,10 +262,10 @@ basis={{ classes: `col-span-12`, label: { - value: `${$t(`icu.*_available`, { value: `${$t(`common.quantity`)}` })}`, + value: `${$ls(`icu.*_available`, { value: `${$ls(`common.quantity`)}` })}`, }, data: { - value: `${tradeproduct_qty_avail} ${trade_product.qty_label || fmt_plural_agreement(tradeproduct_qty_avail, `${$t(`common.bag`)}`, `${$t(`common.bags`)}`)}`, + value: `${tradeproduct_qty_avail} ${trade_product.qty_label || fmt_plural_agreement(tradeproduct_qty_avail, `${$ls(`common.bag`)}`, `${$ls(`common.bags`)}`)}`, }, }} /> @@ -273,10 +273,10 @@ basis={{ classes: `col-span-12`, label: { - value: `${$t(`icu.*_sold`, { value: `${$t(`common.quantity`)}` })}`, + value: `${$ls(`icu.*_sold`, { value: `${$ls(`common.quantity`)}` })}`, }, data: { - value: `${tradeproduct_qty_sold} ${trade_product.qty_label || fmt_plural_agreement(tradeproduct_qty_sold, `${$t(`common.bag`)}`, `${$t(`common.bags`)}`)}`, + value: `${tradeproduct_qty_sold} ${trade_product.qty_label || fmt_plural_agreement(tradeproduct_qty_sold, `${$ls(`common.bag`)}`, `${$ls(`common.bags`)}`)}`, }, }} /> @@ -284,7 +284,7 @@ basis={{ classes: `col-span-12`, label: { - value: `${$t(`common.lot`)}`, + value: `${$ls(`common.lot`)}`, }, data: { classes: `capitalize`, @@ -296,7 +296,7 @@ basis={{ classes: `col-span-12`, label: { - value: `${$t(`common.process`)}`, + value: `${$ls(`common.process`)}`, }, data: { classes: `capitalize`, @@ -308,7 +308,7 @@ basis={{ classes: `col-span-12`, label: { - value: `${$t(`common.profile`)}`, + value: `${$ls(`common.profile`)}`, }, data: { classes: `capitalize`, @@ -320,7 +320,7 @@ basis={{ classes: `col-span-12`, label: { - value: `${$t(`common.year`)}`, + value: `${$ls(`common.year`)}`, }, data: { value: `${trade_product.year}`, @@ -334,10 +334,10 @@ basis={{ classes: `col-span-12`, label: { - value: `${$t(`icu.total_*`, { value: `${$t(`common.value`)}` })}`, + value: `${$ls(`icu.total_*`, { value: `${$ls(`common.value`)}` })}`, }, data: { - value: `${price ? fmt_currency_price(price) : ``} / ${`${$t(`measurement.mass.unit.${trade_product.price_qty_unit}_ab`)}`}`, + value: `${price ? fmt_currency_price(price) : ``} / ${`${$ls(`measurement.mass.unit.${trade_product.price_qty_unit}_ab`)}`}`, }, }} /> diff --git a/src/lib/util/fetch-radroots-profile.ts b/src/lib/util/fetch-radroots-profile.ts @@ -1,15 +1,14 @@ import { PUBLIC_RADROOTS_URL } from "$env/static/public"; import { http, nostr } from "$lib/client"; import { cfg } from "$lib/conf"; -import { get_store, t } from "@radroots/svelte-lib"; +import { get_store, ls, } from "@radroots/svelte-lib"; import { err_msg, type ErrorMessage } from "@radroots/utils"; import { catch_err, throw_err } from "./error"; -const $t = get_store(t); - export const fetch_radroots_profile_validate = async (opts: { profile_name: string; }): Promise<{ profile_name: string } | ErrorMessage<string>> => { + const $ls = get_store(ls); try { const res = await http.fetch({ url: `${PUBLIC_RADROOTS_URL}/public/accounts/list`, @@ -27,14 +26,14 @@ export const fetch_radroots_profile_validate = async (opts: { ); if (existing_profile) return err_msg( - `${`${$t(`icu.the_*_is_registered`, { value: `${$t(`common.profile_name`)}`.toLowerCase() })} `}`, + `${`${$ls(`icu.the_*_is_registered`, { value: `${$ls(`common.profile_name`)}`.toLowerCase() })} `}`, ); return { profile_name: opts.profile_name }; } - return err_msg(`${$t(`error.client.request_failure`)}`); + return err_msg(`${$ls(`error.client.request_failure`)}`); } catch (e) { await catch_err(e, "fetch_radroots_profile_validate"); - return err_msg(`${$t(`error.client.network_failure`)}`); + return err_msg(`${$ls(`error.client.network_failure`)}`); } }; @@ -43,6 +42,7 @@ export const fetch_radroots_profile_init = async (opts: { secret_key: string; nostr_relays?: string[]; }): Promise<{ tok: string } | ErrorMessage<string>> => { + const $ls = get_store(ls); try { const res = await http.fetch({ url: `${PUBLIC_RADROOTS_URL}/public/accounts/add/init`, @@ -65,18 +65,19 @@ export const fetch_radroots_profile_init = async (opts: { return { tok: res.data.tok }; } else if (res.data && `message` in res.data) return err_msg( - `${$t(`radroots-org.error.${res.data.message}`)}`, + `${$ls(`radroots-org.error.${res.data.message}`)}`, ); - return err_msg(`${$t(`error.client.request_failure`)}`); + return err_msg(`${$ls(`error.client.request_failure`)}`); } catch (e) { await catch_err(e, "fetch_radroots_profile_init"); - return err_msg(`${$t(`error.client.network_failure`)}`); + return err_msg(`${$ls(`error.client.network_failure`)}`); } }; export const fetch_radroots_profile_confirm = async ( authorization: string, ): Promise<{ pass: true } | ErrorMessage<string>> => { + const $ls = get_store(ls); try { const res = await http.fetch({ url: `${PUBLIC_RADROOTS_URL}/public/accounts/add/conf`, @@ -87,7 +88,7 @@ export const fetch_radroots_profile_confirm = async ( return { pass: true }; } catch (e) { await catch_err(e, "fetch_radroots_profile_confirm"); - return err_msg(`${$t(`error.client.network_failure`)}`); + return err_msg(`${$ls(`error.client.network_failure`)}`); } }; @@ -97,6 +98,7 @@ export const fetch_radroots_profile_status = async ( | { active: { public_key: string; nip_05?: string } } | ErrorMessage<string> > => { + const $ls = get_store(ls); try { const res = await http.fetch({ url: `${PUBLIC_RADROOTS_URL}/public/accounts/add/status`, @@ -118,9 +120,9 @@ export const fetch_radroots_profile_status = async ( : undefined, }, }; - return err_msg(`${$t(`error.client.network_failure`)}`); + return err_msg(`${$ls(`error.client.network_failure`)}`); } catch (e) { await catch_err(e, "fetch_radroots_profile_status"); - return err_msg(`${$t(`error.client.network_failure`)}`); + return err_msg(`${$ls(`error.client.network_failure`)}`); } }; \ No newline at end of file diff --git a/src/lib/util/fetch.ts b/src/lib/util/fetch.ts @@ -2,11 +2,9 @@ import { db, fs, http, keystore } from "$lib/client"; import { cfg, ks } from "$lib/conf"; import type { IClientHttpResponseError } from "@radroots/client"; import { parse_nostr_relay_form_keys, type NostrRelayFormFields } from "@radroots/models"; -import { app_nostr_key, get_store, nostr_relays_connected, nostr_relays_poll_documents, nostr_relays_poll_documents_count, t } from "@radroots/svelte-lib"; +import { app_nostr_key, get_store, nostr_relays_connected, nostr_relays_poll_documents, nostr_relays_poll_documents_count } from "@radroots/svelte-lib"; import { err_msg, err_res, nostr_event_sign_attest, parse_nostr_relay_information_document_fields, type ErrorMessage, type ErrorResponse, type FilePath } from "@radroots/utils"; -const $t = get_store(t); - export const fetch_put_upload = async (opts: { url: string; file_path: FilePath; diff --git a/src/lib/util/models-media-upload.ts b/src/lib/util/models-media-upload.ts @@ -2,16 +2,17 @@ import { PUBLIC_RADROOTS_URL } from "$env/static/public"; import { db } from "$lib/client"; import type { IDialogAlert, IDialogConfirm } from "$lib/types"; import type { IClientHttpResponseError } from "@radroots/client"; -import { t } from "@radroots/svelte-lib"; +import { ls } from "@radroots/svelte-lib"; import { parse_file_path, type FilePath, type ResultsList } from "@radroots/utils"; import { get } from "svelte/store"; import { fetch_put_upload } from "./fetch"; -const $t = get(t); export const model_media_upload_add_list = async (opts: { photo_paths: string[]; }): Promise<IDialogAlert | IDialogConfirm | ResultsList<string>> => { + const $ls = get(ls); + try { if (!opts.photo_paths.length) { return { @@ -59,13 +60,13 @@ export const model_media_upload_add_list = async (opts: { if (photo_path_uploads_error.length) { return { confirm: { - message: `${$t(photo_path_uploads_error[0].message)}`, //@todo + message: `${$ls(photo_path_uploads_error[0].message)}`, //@todo ok_label: photo_path_uploads_error[0].label_ok - ? `${$t(photo_path_uploads_error[0].label_ok)}` || + ? `${$ls(photo_path_uploads_error[0].label_ok)}` || undefined : undefined, cancel_label: photo_path_uploads_error[0].label_cancel - ? `${$t(photo_path_uploads_error[0].label_cancel)}` || + ? `${$ls(photo_path_uploads_error[0].label_cancel)}` || undefined : undefined, } @@ -74,12 +75,12 @@ export const model_media_upload_add_list = async (opts: { } if (photo_path_uploads_err.length) { return { - alert: `${$t(`icu.there_was_a_failure_while_*`, { - value: `${$t(`icu.uploading_*_photos`, { + alert: `${$ls(`icu.there_was_a_failure_while_*`, { + value: `${$ls(`icu.uploading_*_photos`, { value: photo_path_uploads_err.length === opts.photo_paths.length - ? `${$t(`common.all`)}` + ? `${$ls(`common.all`)}` : `${photo_path_uploads_err.length}`, })}`.toLowerCase(), })}` diff --git a/src/lib/util/nostr-sync.ts b/src/lib/util/nostr-sync.ts @@ -2,7 +2,9 @@ import { db, device, dialog } from "$lib/client"; import { err, nostr_client, root_symbol } from "$lib/conf"; import { NDKKind } from "@nostr-dev-kit/ndk"; import type { NostrRelay } from "@radroots/models"; -import { app_nostr_key, ndk, ndk_user, nostr_sync_prevent, t } from "@radroots/svelte-lib"; +import { + app_nostr_key, ls, ndk, ndk_user, nostr_sync_prevent +} from "@radroots/svelte-lib"; import { fmt_tags_basis_nip99, ndk_event, ndk_event_metadata, nevent_encode, num_str } from "@radroots/utils"; import { get as get_store } from "svelte/store"; import { throw_err } from "./error"; @@ -108,12 +110,12 @@ export const nostr_sync_classified = async (nostr_relays: NostrRelay[]): Promise export const nostr_sync = async (): Promise<void> => { const $nostr_sync_prevent = get_store(nostr_sync_prevent); - const $t = get_store(t); + const $ls = get_store(ls); const $app_nostr_key = get_store(app_nostr_key); try { if ($nostr_sync_prevent) { const confirm = await dialog.confirm({ - message: `${$t(`error.client.nostr_sync_disabled`)}`, + message: `${$ls(`error.client.nostr_sync_disabled`)}`, }); if (confirm) { nostr_sync_prevent.set(false); diff --git a/src/routes/(app)/+page.svelte b/src/routes/(app)/+page.svelte @@ -7,9 +7,9 @@ Glyph, LayoutView, LogoCircleSm, + ls, nav_prev, route, - t, TabsFloat, } from "@radroots/svelte-lib"; import { onMount } from "svelte"; @@ -62,7 +62,7 @@ > <div class={`flex flex-row w-full justify-start items-center`}> <p class={`font-sansd font-[600] text-2xl text-layer-0-glyph`}> - {`${$t(`common.general`)}`} + {`${$ls(`common.general`)}`} </p> </div> <div class={`flex flex-col w-full gap-5 justify-center items-center`}> @@ -75,7 +75,7 @@ <p class={`font-sans font-[700] text-xl text-layer-0-glyph capitalize tracking-wider opacity-active`} > - {`${$t(`common.profile`)}`} + {`${$ls(`common.profile`)}`} </p> </button> </div> diff --git a/src/routes/(app)/models/location-gcs/+page.svelte b/src/routes/(app)/models/location-gcs/+page.svelte @@ -5,8 +5,8 @@ app_notify, LayoutTrellis, LayoutView, + ls, Nav, - t, Trellis, } from "@radroots/svelte-lib"; import { onMount } from "svelte"; @@ -34,7 +34,7 @@ list: [`all`], }); if (`err` in location_gcss) { - app_notify.set(`${$t(`error.client.page.load`)}`); + app_notify.set(`${$ls(`error.client.page.load`)}`); return; } return { @@ -65,7 +65,7 @@ args: { layer: 1, title: { - value: `${$t(`icu.your_*`, { value: `${$t(`common.locations`)}` })}`, + value: `${$ls(`icu.your_*`, { value: `${$ls(`common.locations`)}` })}`, }, list: [ { @@ -138,19 +138,19 @@ <Nav basis={{ prev: { - label: `${$t(`common.home`)}`, + label: `${$ls(`common.home`)}`, route: `/`, }, title: { label: { - value: `${$t(`common.locations`)}`, + value: `${$ls(`common.locations`)}`, }, }, option: ld && ld?.location_gcss?.length > 0 ? { label: { - value: `${$t(`common.add`)}`, + value: `${$ls(`common.add`)}`, classes: `tap-color`, }, callback: async () => { diff --git a/src/routes/(app)/models/nostr-profile/+page.svelte b/src/routes/(app)/models/nostr-profile/+page.svelte @@ -9,11 +9,11 @@ type ISelectOption, LayoutTrellis, LayoutView, + ls, Nav, nav_prev, route, SelectMenu, - t, TrellisTitle, } from "@radroots/svelte-lib"; import { onMount } from "svelte"; @@ -30,23 +30,23 @@ options_list: [ { value: `view-key`, - label: `${$t(`icu.view_*`, { value: `${$t(`common.details`)}`.toLowerCase() })}`, + label: `${$ls(`icu.view_*`, { value: `${$ls(`common.details`)}`.toLowerCase() })}`, }, { value: `edit-profile-name`, - label: `${$t(`icu.edit_*`, { value: `${$t(`common.profile_name`)}`.toLowerCase() })}`, + label: `${$ls(`icu.edit_*`, { value: `${$ls(`common.profile_name`)}`.toLowerCase() })}`, }, { value: `add-profile-name`, - label: `${$t(`icu.add_*`, { value: `${$t(`common.profile_name`)}`.toLowerCase() })}`, + label: `${$ls(`icu.add_*`, { value: `${$ls(`common.profile_name`)}`.toLowerCase() })}`, }, { value: `set-key-active`, - label: `${$t(`icu.set_as_*`, { value: `${$t(`common.active`)}`.toLowerCase() })}`, + label: `${$ls(`icu.set_as_*`, { value: `${$ls(`common.active`)}`.toLowerCase() })}`, }, { value: `delete-key`, - label: `${$t(`icu.delete_*`, { value: `${$t(`common.key`)}`.toLowerCase() })}`, + label: `${$ls(`icu.delete_*`, { value: `${$ls(`common.key`)}`.toLowerCase() })}`, }, ], }; @@ -78,7 +78,7 @@ `nostr_profiles`, ); if (`err` in nostr_profiles) { - app_notify.set(`${$t(`error.client.page.load`)}`); + app_notify.set(`${$ls(`error.client.page.load`)}`); return; } const data: LoadData = { @@ -152,7 +152,7 @@ <TrellisTitle layer={0} basis={{ - value: `${$t(`icu.*_list`, { value: `${$t(`common.profile`)}`.toLowerCase() })}`, + value: `${$ls(`icu.*_list`, { value: `${$ls(`common.profile`)}`.toLowerCase() })}`, }} /> {#if ld.nostr_profiles.length} @@ -168,7 +168,7 @@ on:click|preventDefault={async () => { $nav_prev.push({ route: `/models/nostr-profile`, - label: `${$t(`common.profiles`)}`, + label: `${$ls(`common.profiles`)}`, }); await route( `/models/nostr-profile/view`, @@ -184,7 +184,7 @@ > {li.name ? li.name - : `(${`${$t(`icu.no_*`, { value: `${$t(`common.profile`)}` })}`})`} + : `(${`${$ls(`icu.no_*`, { value: `${$ls(`common.profile`)}` })}`})`} </p> {#if li.public_key === $app_nostr_key} <div class={`flex flex-row`}> @@ -194,7 +194,7 @@ <p class={`font-mono font-[900] text-[0.7rem] text-white text-ellipsis overflow-hidden`} > - {`${$t(`common.active`)}`} + {`${$ls(`common.active`)}`} </p> </div> </div> @@ -212,7 +212,7 @@ <p class={`font-mono font-[600] text-[0.9rem] text-layer-2-glyph lowercase line-clamp-1`} > - {`${$t(`common.key`)}`} + {`${$ls(`common.key`)}`} </p> </div> </div> @@ -312,18 +312,18 @@ <Nav basis={{ prev: { - label: `${$t(`common.back`)}`, + label: `${$ls(`common.back`)}`, route: `/`, }, title: { label: { - value: `${$t(`common.profiles`)}`, + value: `${$ls(`common.profiles`)}`, }, }, option: ld?.nostr_profiles?.length ? { label: { - value: `${$t(`common.add`)}`, + value: `${$ls(`common.add`)}`, classes: `tap-color`, }, callback: async () => { diff --git a/src/routes/(app)/models/nostr-profile/edit/field/+page.svelte b/src/routes/(app)/models/nostr-profile/edit/field/+page.svelte @@ -14,13 +14,13 @@ kv, LayoutTrellis, LayoutView, + ls, Nav, qp_nostr_pk, qp_rkey, route, route_prev, sleep, - t, Trellis, } from "@radroots/svelte-lib"; import { onDestroy, onMount } from "svelte"; @@ -38,7 +38,7 @@ try { if (!$qp_rkey || !$qp_nostr_pk) { app_notify.set( - `${$t(`icu.error_loading_*`, { value: `${$t(`common.page`)}` })}`, + `${$ls(`icu.error_loading_*`, { value: `${$ls(`common.page`)}` })}`, ); return; } @@ -61,7 +61,7 @@ let val_field_valid = false; $: translated_field_key = ld?.field_key - ? `${$t(`models.nostr_profile.fields.${ld.field_key}.label`)}`.toLowerCase() + ? `${$ls(`models.nostr_profile.fields.${ld.field_key}.label`)}`.toLowerCase() : ``; $: if (el_input_loaded && el_input) { @@ -74,19 +74,19 @@ }); if (`err` in nostr_profiles) { app_notify.set( - `${$t(`icu.error_loading_*`, { value: `${$t(`common.profile`)}` })}`, + `${$ls(`icu.error_loading_*`, { value: `${$ls(`common.profile`)}` })}`, ); return; } else if (!nostr_profiles.results.length) { app_notify.set( - `${$t(`icu.error_loading_*`, { value: `${$t(`common.page`)}` })}`, + `${$ls(`icu.error_loading_*`, { value: `${$ls(`common.page`)}` })}`, ); return; } const field_key = parse_nostr_profile_form_keys($qp_rkey); if (!field_key) { - app_notify.set(`${$t(`error.client.page.load`)}`); + app_notify.set(`${$ls(`error.client.page.load`)}`); return; } @@ -113,7 +113,7 @@ nostr_profile_form_fields[ld?.field_key].validation.test(val); if (!validated) { dialog.alert( - `${$t(`icu.invalid_*_entry`, { value: translated_field_key })}`, + `${$ls(`icu.invalid_*_entry`, { value: translated_field_key })}`, ); return; } @@ -128,7 +128,7 @@ fields, }); if (`err` in update_res) { - await dialog.alert(`${$t(`error.client.unhandled`)}`); + await dialog.alert(`${$ls(`error.client.unhandled`)}`); return; } @@ -155,8 +155,8 @@ layer: 1, title: { value: ld?.nostr_profile[ld?.field_key] - ? `${$t(`icu.edit_*`, { value: translated_field_key })}` - : `${$t(`icu.add_a_*`, { value: translated_field_key.toLowerCase() })}`, + ? `${$ls(`icu.edit_*`, { value: translated_field_key })}` + : `${$ls(`icu.add_a_*`, { value: translated_field_key.toLowerCase() })}`, }, list: [ { @@ -177,8 +177,8 @@ placeholder: ld?.nostr_profile[ ld?.field_key ] - ? `${$t(`icu.enter_new_*`, { value: translated_field_key.toLowerCase() })}` - : `${$t(`icu.add_a_*`, { value: translated_field_key.toLowerCase() })}`, + ? `${$ls(`icu.enter_new_*`, { value: translated_field_key.toLowerCase() })}` + : `${$ls(`icu.add_a_*`, { value: translated_field_key.toLowerCase() })}`, field: { charset: nostr_profile_form_fields[ @@ -221,7 +221,7 @@ <Nav basis={{ prev: { - label: `${$t(`common.back`)}`, + label: `${$ls(`common.back`)}`, route: `/models/nostr-profile`, }, title: { @@ -234,8 +234,8 @@ label: { classes: val_field_valid ? `` : `opacity-60`, value: ld?.nostr_profile[ld?.field_key] - ? `${$t(`common.update`)}` - : `${$t(`common.add`)}`, + ? `${$ls(`common.update`)}` + : `${$ls(`common.add`)}`, }, callback: async () => { if (val_field_valid) await submit(); diff --git a/src/routes/(app)/models/nostr-profile/view/+page.svelte b/src/routes/(app)/models/nostr-profile/view/+page.svelte @@ -10,13 +10,13 @@ clipboard_copy, LayoutTrellis, LayoutView, + ls, Nav, nav_prev, nostr_relays_connected, qp_nostr_pk, route, show_toast, - t, Trellis, type ITrellisKindTouch, } from "@radroots/svelte-lib"; @@ -37,7 +37,7 @@ onMount(async () => { try { if (!$qp_nostr_pk) - app_notify.set(`${$t(`error.client.page.load`)}`); + app_notify.set(`${$ls(`error.client.page.load`)}`); ld = await load_data(); } catch (e) { } finally { @@ -54,10 +54,10 @@ `nostr_profiles`, ); if (`err` in nostr_profiles) { - app_notify.set(`${$t(`error.client.page.load`)}`); + app_notify.set(`${$ls(`error.client.page.load`)}`); return; } else if (nostr_profiles.results) { - app_notify.set(`${$t(`error.client.page.load`)}`); + app_notify.set(`${$ls(`error.client.page.load`)}`); return; } @@ -177,7 +177,7 @@ args: { layer: 1, title: { - value: `${$t(`common.profile_name`)}`, + value: `${$ls(`common.profile_name`)}`, }, list: [ { @@ -191,7 +191,7 @@ : `text-layer-1-glyph-shade`, value: ld.nostr_profile.name || - `${$t(`icu.no_*_published`, { value: `${$t(`common.profile`)}`.toLowerCase() })}`, + `${$ls(`icu.no_*_published`, { value: `${$ls(`common.profile`)}`.toLowerCase() })}`, }, ], }, @@ -243,17 +243,17 @@ args: { layer: 1, title: { - value: `${$t(`common.public_key`)}`, + value: `${$ls(`common.public_key`)}`, link: { label: { swap: { on: { classes: `pl-1 text-trellisTitleNote uppercase -translate-y-[1px] -translate-x-[2px] text-layer-0-glyph-shade`, - value: `${$t(`common.npub`)}`, + value: `${$ls(`common.npub`)}`, }, off: { classes: `pl-1 text-trellisTitleNote uppercase -translate-y-[1px] -translate-x-[6px] text-layer-0-glyph-shade`, - value: `${$t(`common.hex`)}`, + value: `${$ls(`common.hex`)}`, }, toggle: show_public_key_hex, }, @@ -288,19 +288,19 @@ args: { position: `bottom-center`, label: { - value: `${`${$t( + value: `${`${$ls( `icu.*_as`, { - value: `${$t( + value: `${$ls( `icu.*_copied`, { - value: `${$t( + value: `${$ls( `common.public_key`, )}`, }, )}`, }, - )}`} ${show_public_key_hex ? `${$t(`common.hex`)}`.toLowerCase() : `${$t(`common.npub`)}`.toLowerCase()}.`, + )}`} ${show_public_key_hex ? `${$ls(`common.hex`)}`.toLowerCase() : `${$ls(`common.npub`)}`.toLowerCase()}.`, }, }, callback: async () => { @@ -328,17 +328,17 @@ args: { layer: 1, title: { - value: `${$t(`common.secret_key`)}`, + value: `${$ls(`common.secret_key`)}`, link: { label: { swap: { on: { classes: `pl-1 text-trellisTitleNote uppercase -translate-y-[1px] -translate-x-[2px] text-layer-0-glyph-shade`, - value: `${$t(`common.nsec`)}`, + value: `${$ls(`common.nsec`)}`, }, off: { classes: `pl-1 text-trellisTitleNote uppercase -translate-y-[1px] -translate-x-[6px] text-layer-0-glyph-shade`, - value: `${$t(`common.hex`)}`, + value: `${$ls(`common.hex`)}`, }, toggle: vl_secret_key_unlock ? show_secret_key_hex @@ -375,19 +375,19 @@ args: { position: `bottom-center`, label: { - value: `${`${$t( + value: `${`${$ls( `icu.*_as`, { - value: `${$t( + value: `${$ls( `icu.*_copied`, { - value: `${$t( + value: `${$ls( `common.secret_key`, )}`, }, )}`, }, - )}`} ${show_secret_key_hex ? `${$t(`common.hex`)}`.toLowerCase() : `${$t(`common.nsec`)}`.toLowerCase()}.`, + )}`} ${show_secret_key_hex ? `${$ls(`common.hex`)}`.toLowerCase() : `${$ls(`common.nsec`)}`.toLowerCase()}.`, }, }, callback: async () => { @@ -413,7 +413,7 @@ args: { layer: 1, title: { - value: `${$t(`common.status`)}`, + value: `${$ls(`common.status`)}`, }, list: [ { @@ -430,8 +430,8 @@ value: $app_nostr_key === ld.nostr_profile.public_key - ? `${$t(`common.active`)}` - : `${$t( + ? `${$ls(`common.active`)}` + : `${$ls( `common.public_key`, )}`, }, @@ -448,7 +448,7 @@ args: { layer: 1, title: { - value: `${$t(`icu.connected_*`, { value: `${$t(`common.relays`)}` })}`, + value: `${$ls(`icu.connected_*`, { value: `${$ls(`common.relays`)}` })}`, }, list: tr_nostr_relays.length ? tr_nostr_relays @@ -463,7 +463,7 @@ .name ? `` : `text-layer-1-glyph-shade`, - value: `${$t(`icu.no_*_published`, { value: `${$t(`common.relays`)}`.toLowerCase() })}`, + value: `${$ls(`icu.no_*_published`, { value: `${$ls(`common.relays`)}`.toLowerCase() })}`, }, ], }, @@ -479,23 +479,23 @@ <Nav basis={{ prev: { - label: `${$t(`common.back`)}`, + label: `${$ls(`common.back`)}`, route: `/models/nostr-profile`, }, title: { label: { classes: `capitalize`, - value: `${$t(`common.profile`)}`, + value: `${$ls(`common.profile`)}`, }, }, option: { label: { swap: { on: { - value: `${$t(`common.done`)}`, + value: `${$ls(`common.done`)}`, }, off: { - value: `${$t(`common.unlock`)}`, + value: `${$ls(`common.unlock`)}`, }, toggle: vl_secret_key_unlock, }, diff --git a/src/routes/(app)/models/nostr-relay/+page.svelte b/src/routes/(app)/models/nostr-relay/+page.svelte @@ -7,11 +7,11 @@ GlyphCircle, LayoutTrellis, LayoutView, + ls, Nav, nav_prev, nostr_relays_connected, route, - t, Trellis, type ITrellisKindTouch, } from "@radroots/svelte-lib"; @@ -41,7 +41,7 @@ sort: `oldest`, }); if (`err` in nostr_relays) { - app_notify.set(`${$t(`error.client.page.load`)}`); + app_notify.set(`${$ls(`error.client.page.load`)}`); return; } @@ -50,7 +50,7 @@ sort: `oldest`, }); if (`err` in nostr_relays_other) { - app_notify.set(`${$t(`error.client.page.load`)}`); + app_notify.set(`${$ls(`error.client.page.load`)}`); return; } @@ -178,7 +178,7 @@ args: { layer: 1, title: { - value: `${$t(`icu.nostr_*`, { value: `${$t(`common.relays`)}` })}`, + value: `${$ls(`icu.nostr_*`, { value: `${$ls(`common.relays`)}` })}`, }, list: tr_list_relays, }, @@ -190,23 +190,23 @@ <Nav basis={{ prev: { - label: `${$t(`common.back`)}`, + label: `${$ls(`common.back`)}`, route: `/models/nostr-profile`, }, title: { label: { classes: `capitalize`, - value: `${$t(`common.relays`)}`, + value: `${$ls(`common.relays`)}`, }, }, option: { label: { swap: { on: { - value: `${$t(`common.done`)}`, + value: `${$ls(`common.done`)}`, }, off: { - value: `${$t(`common.edit`)}`, + value: `${$ls(`common.edit`)}`, }, toggle: show_edit, }, diff --git a/src/routes/(app)/models/nostr-relay/view/+page.svelte b/src/routes/(app)/models/nostr-relay/view/+page.svelte @@ -7,10 +7,10 @@ EnvelopeButtons, LayoutTrellis, LayoutView, + ls, Nav, nostr_relays_connected, qp_id, - t, Trellis, } from "@radroots/svelte-lib"; import { onMount } from "svelte"; @@ -25,7 +25,7 @@ onMount(async () => { try { - if (!$qp_id) app_notify.set(`${$t(`error.client.page.load`)}`); + if (!$qp_id) app_notify.set(`${$ls(`error.client.page.load`)}`); ld = await load_data(); } catch (e) { } finally { @@ -38,10 +38,10 @@ id: $qp_id, }); if (`err` in nostr_relays) { - app_notify.set(`${$t(`error.client.page.load`)}`); + app_notify.set(`${$ls(`error.client.page.load`)}`); return; } else if (!nostr_relays.results.length) { - app_notify.set(`${$t(`error.client.page.load`)}`); + app_notify.set(`${$ls(`error.client.page.load`)}`); return; } @@ -98,7 +98,7 @@ args: { layer: 1, title: { - value: `${$t(`common.url`)}`, + value: `${$ls(`common.url`)}`, }, list: [ { @@ -123,7 +123,7 @@ args: { layer: 1, title: { - value: `${$t(`common.status`)}`, + value: `${$ls(`common.status`)}`, }, list: [ { @@ -142,7 +142,7 @@ }, { classes: `text-success font-[500]`, - value: `${$t(`common.connected`)}`, + value: `${$ls(`common.connected`)}`, }, ] : [ @@ -154,7 +154,7 @@ }, { classes: `text-yellow-700/80 font-[500] capitalize`, - value: `${$t(`common.not_connected`)}`, + value: `${$ls(`common.not_connected`)}`, }, ], }, @@ -169,7 +169,7 @@ args: { layer: 1, title: { - value: `${$t(`models.nostr_relay.fields.pubkey.label`)}`, + value: `${$ls(`models.nostr_relay.fields.pubkey.label`)}`, }, list: [ { @@ -184,7 +184,7 @@ ld.nostr_relay.pubkey, true, ) - : `${$t(`icu.no_*_published`, { value: `${$t(`pubkey`)}`.toLowerCase() })}`, + : `${$ls(`icu.no_*_published`, { value: `${$ls(`pubkey`)}`.toLowerCase() })}`, }, ], }, @@ -199,7 +199,7 @@ args: { layer: 1, title: { - value: `${$t(`models.nostr_relay.fields.description.label`)}`, + value: `${$ls(`models.nostr_relay.fields.description.label`)}`, }, list: [ { @@ -212,7 +212,7 @@ value: ld.nostr_relay .description || - `${$t(`icu.no_*_published`, { value: `${$t(`models.nostr_relay.fields.description.label`)}`.toLowerCase() })}`, + `${$ls(`icu.no_*_published`, { value: `${$ls(`models.nostr_relay.fields.description.label`)}`.toLowerCase() })}`, }, ], }, @@ -227,7 +227,7 @@ args: { layer: 1, title: { - value: `${$t(`models.nostr_relay.fields.software.label`)}`, + value: `${$ls(`models.nostr_relay.fields.software.label`)}`, }, list: [ { @@ -239,7 +239,7 @@ classes: `text-layer-1-glyph`, value: ld.nostr_relay.software || - `${$t(`icu.no_*_published`, { value: `${$t(`models.fields.nostr_relay.software.label`)}`.toLowerCase() })}`, + `${$ls(`icu.no_*_published`, { value: `${$ls(`models.fields.nostr_relay.software.label`)}`.toLowerCase() })}`, }, ], }, @@ -254,7 +254,7 @@ args: { layer: 1, title: { - value: `${$t(`models.nostr_relay.fields.version.label`)}`, + value: `${$ls(`models.nostr_relay.fields.version.label`)}`, }, list: [ { @@ -266,7 +266,7 @@ classes: `text-layer-1-glyph`, value: ld.nostr_relay.version || - `${$t(`icu.no_*_published`, { value: `${$t(`models.nostr_relay.fields.version.label`)}`.toLowerCase() })}`, + `${$ls(`icu.no_*_published`, { value: `${$ls(`models.nostr_relay.fields.version.label`)}`.toLowerCase() })}`, }, ], }, @@ -281,7 +281,7 @@ args: { layer: 1, title: { - value: `${$t(`models.nostr_relay.fields.supported_nips.label`)}`, + value: `${$ls(`models.nostr_relay.fields.supported_nips.label`)}`, }, list: [ { @@ -294,7 +294,7 @@ value: ld.nostr_relay .supported_nips || - `${$t(`icu.no_*_published`, { value: `${$t(`models.nostr_relay.fields.supported_nips.label`)}`.toLowerCase() })}`, + `${$ls(`icu.no_*_published`, { value: `${$ls(`models.nostr_relay.fields.supported_nips.label`)}`.toLowerCase() })}`, }, ], }, @@ -310,23 +310,23 @@ <Nav basis={{ prev: { - label: `${$t(`common.back`)}`, + label: `${$ls(`common.back`)}`, route: `/models/nostr-relay`, }, title: { label: { classes: `capitalize`, - value: `${$t(`common.relay`)}`, + value: `${$ls(`common.relay`)}`, }, }, option: { label: { swap: { on: { - value: `${$t(`common.done`)}`, + value: `${$ls(`common.done`)}`, }, off: { - value: `${$t(`common.edit`)}`, + value: `${$ls(`common.edit`)}`, }, toggle: show_edit, }, @@ -344,7 +344,7 @@ buttons: [ { classes: `text-envelopeButtonCancel text-layer-1-glyph-hl`, - label: `${$t(`common.cancel`)}`, + label: `${$ls(`common.cancel`)}`, callback: async () => { show_edit = false; }, @@ -354,8 +354,8 @@ ? `text-envelopeButtonLabel text-red-400` : `text-envelopeButtonLabel text-success`, label: $nostr_relays_connected.includes(ld.nostr_relay.id) - ? `${$t(`icu.disconnect_*`, { value: `${$t(`common.relay`)}` })}` - : `${$t(`icu.connect_*`, { value: `${$t(`common.relay`)}` })}`, + ? `${$ls(`icu.disconnect_*`, { value: `${$ls(`common.relay`)}` })}` + : `${$ls(`icu.connect_*`, { value: `${$ls(`common.relay`)}` })}`, callback: async () => { if (!ld) return; if ($nostr_relays_connected.includes(ld.nostr_relay.id)) diff --git a/src/routes/(app)/models/trade-product/+page.svelte b/src/routes/(app)/models/trade-product/+page.svelte @@ -6,9 +6,9 @@ app_notify, LayoutTrellis, LayoutView, + ls, Nav, route, - t, } from "@radroots/svelte-lib"; import { onMount } from "svelte"; @@ -32,7 +32,7 @@ }); if (`err` in trade_products) { app_notify.set( - `${$t(`icu.error_loading_*`, { value: `${$t(`common.page`)}` })}`, + `${$ls(`icu.error_loading_*`, { value: `${$ls(`common.page`)}` })}`, ); return; } @@ -92,19 +92,19 @@ <Nav basis={{ prev: { - label: `${$t(`common.home`)}`, + label: `${$ls(`common.home`)}`, route: `/`, }, title: { label: { - value: `${$t(`common.products`)}`, + value: `${$ls(`common.products`)}`, }, }, option: ld && ld?.results?.length > 0 ? { label: { - value: `${$t(`common.add_new`)}`, + value: `${$ls(`common.add_new`)}`, classes: `tap-color capitalize`, }, callback: async () => { diff --git a/src/routes/(app)/models/trade-product/add/+page.svelte b/src/routes/(app)/models/trade-product/add/+page.svelte @@ -45,11 +45,11 @@ LayoutView, Loading, locale, + ls, Nav, route, SelectElement, sleep, - t, view_effect, } from "@radroots/svelte-lib"; import { @@ -91,13 +91,13 @@ [ 0, { - label_next: `${$t(`common.add`)}`, + label_next: `${$ls(`common.add`)}`, }, ], [ 1, { - label_next: `${$t(`common.add`)}`, + label_next: `${$ls(`common.add`)}`, }, ], [ @@ -293,7 +293,7 @@ const kv_curr = await kv.get(fmt_id(`key`)); if (kv_curr) { const confirm = await dialog.confirm({ - message: `${$t(`icu.the_current_entry_*_will_be_deleted`, { value: kv_curr })}. ${$t(`common.do_you_want_to_continue_q`)}`, + message: `${$ls(`icu.the_current_entry_*_will_be_deleted`, { value: kv_curr })}. ${$ls(`common.do_you_want_to_continue_q`)}`, }); if (!confirm) return; } @@ -311,7 +311,7 @@ const kv_curr = await kv.get(fmt_id(`process`)); if (kv_curr) { const confirm = await dialog.confirm({ - message: `${$t(`icu.the_current_entry_*_will_be_deleted`, { value: kv_curr })}. ${$t(`common.do_you_want_to_continue_q`)}`, + message: `${$ls(`icu.the_current_entry_*_will_be_deleted`, { value: kv_curr })}. ${$ls(`common.do_you_want_to_continue_q`)}`, }); if (!confirm) return; } @@ -333,7 +333,7 @@ if (kv_curr) { const kv_curr_unit = await kv.get(fmt_id(`qty_unit`)); const confirm = await dialog.confirm({ - message: `${$t(`icu.the_current_entry_*_will_be_deleted`, { value: `${kv_curr}${kv_curr_unit ? ` ${kv_curr_unit}` : `${$t(`measurement.mass.unit.${kv_curr_unit}_ab`)}`}` })}. ${$t(`common.do_you_want_to_continue_q`)}`, + message: `${$ls(`icu.the_current_entry_*_will_be_deleted`, { value: `${kv_curr}${kv_curr_unit ? ` ${kv_curr_unit}` : `${$ls(`measurement.mass.unit.${kv_curr_unit}_ab`)}`}` })}. ${$ls(`common.do_you_want_to_continue_q`)}`, }); if (!confirm) return; await kv.delete(fmt_id(`qty_amt`)); @@ -350,7 +350,7 @@ const geolc = await geol.current(); if (`err` in geolc) { await dialog.alert( - `${$t(`icu.failure_*`, { value: `${$t(`icu.reading_*`, { value: `${$t(`common.geocode`)}`.toLowerCase() })}` })}`, + `${$ls(`icu.failure_*`, { value: `${$ls(`icu.reading_*`, { value: `${$ls(`common.geocode`)}`.toLowerCase() })}` })}`, ); return; } @@ -403,7 +403,7 @@ }); if (`err` in validate_fields) { await dialog.alert( - `${$t(`icu.enter_the_*`, { value: `${$t(`models.trade_product.fields.${validate_fields.err}.label`)}`.toLowerCase() })}`, + `${$ls(`icu.enter_the_*`, { value: `${$ls(`models.trade_product.fields.${validate_fields.err}.label`)}`.toLowerCase() })}`, ); return; } @@ -423,7 +423,7 @@ }); if (`err` in validate_fields) { await dialog.alert( - `${$t(`icu.enter_the_*`, { value: `${$t(`models.trade_product.fields.${validate_fields.err}.label`)}`.toLowerCase() })}`, + `${$ls(`icu.enter_the_*`, { value: `${$ls(`models.trade_product.fields.${validate_fields.err}.label`)}`.toLowerCase() })}`, ); return; } @@ -445,9 +445,9 @@ load_submit = true; if (!tradepr_photo_paths.length) { const confirm = await dialog.confirm({ - message: `${`${$t(`icu.the_listing_will_be_created_without_a_*`, { value: `${$t(`common.photo`)}`.toLowerCase() })}`}. ${$t(`common.do_you_want_to_continue_q`)}`, - cancel_label: `${$t(`icu.add_*`, { value: `${$t(`common.photo`)}` })}`, - ok_label: `${$t(`common.continue`)}`, + message: `${`${$ls(`icu.the_listing_will_be_created_without_a_*`, { value: `${$ls(`common.photo`)}`.toLowerCase() })}`}. ${$ls(`common.do_you_want_to_continue_q`)}`, + cancel_label: `${$ls(`icu.add_*`, { value: `${$ls(`common.photo`)}` })}`, + ok_label: `${$ls(`common.continue`)}`, }); if (!confirm) { await el_focus( @@ -478,9 +478,9 @@ await dialog.alert( `err` in location_gcs_add_geocode ? err_system(location_gcs_add_geocode.err) - ? `${$t(`error.client.database_read_failure`)}` - : `${$t(`icu.the_*_is_incomplete`, { value: `${$t(`models.location_gcs.fields.${location_gcs_add_geocode.err}.label`)}`.toLowerCase() })}` - : `${$t(`${location_gcs_add_geocode.err_s[0]}`)}`, + ? `${$ls(`error.client.database_read_failure`)}` + : `${$ls(`icu.the_*_is_incomplete`, { value: `${$ls(`models.location_gcs.fields.${location_gcs_add_geocode.err}.label`)}`.toLowerCase() })}` + : `${$ls(`${location_gcs_add_geocode.err_s[0]}`)}`, ); return; } @@ -492,8 +492,8 @@ }); if (`err` in location_gcs_get_c) { const confirm = await dialog.confirm({ - message: `${$t(`icu.a_*_is_required`, { value: `${$t(`common.location`)}`.toLowerCase() })}`, - ok_label: `${$t(`icu.add_*`, { value: `${$t(`common.location`)}` })}`, + message: `${$ls(`icu.a_*_is_required`, { value: `${$ls(`common.location`)}`.toLowerCase() })}`, + ok_label: `${$ls(`icu.add_*`, { value: `${$ls(`common.location`)}` })}`, }); if (confirm) { await el_focus( @@ -543,13 +543,13 @@ } if (photo_path_uploads_error.length) { const confirm = await dialog.confirm({ - message: `${$t(photo_path_uploads_error[0].message)}`, //@todo + message: `${$ls(photo_path_uploads_error[0].message)}`, //@todo ok_label: photo_path_uploads_error[0].label_ok - ? `${$t(photo_path_uploads_error[0].label_ok)}` || + ? `${$ls(photo_path_uploads_error[0].label_ok)}` || undefined : undefined, cancel_label: photo_path_uploads_error[0].label_cancel - ? `${$t(photo_path_uploads_error[0].label_cancel)}` || + ? `${$ls(photo_path_uploads_error[0].label_cancel)}` || undefined : undefined, }); @@ -560,12 +560,12 @@ } if (photo_path_uploads_err.length) { await dialog.alert( - `${$t(`icu.there_was_a_failure_while_*`, { - value: `${$t(`icu.uploading_*_photos`, { + `${$ls(`icu.there_was_a_failure_while_*`, { + value: `${$ls(`icu.uploading_*_photos`, { value: photo_path_uploads_err.length === tradepr_photo_paths.length - ? `${$t(`common.all`)}` + ? `${$ls(`common.all`)}` : `${photo_path_uploads_err.length}`, })}`.toLowerCase(), })}`, @@ -596,7 +596,7 @@ }); if (`err` in trade_product_fields) { await dialog.alert( - `${$t(`icu.the_*_is_incomplete`, { value: `${$t(`models.trade_product.fields.${trade_product_fields.err}.label`)}`.toLowerCase() })}`, + `${$ls(`icu.the_*_is_incomplete`, { value: `${$ls(`models.trade_product.fields.${trade_product_fields.err}.label`)}`.toLowerCase() })}`, ); return; } @@ -605,8 +605,8 @@ if (`err` in trade_product_add || `err_s` in trade_product_add) { await dialog.alert( `err` in trade_product_add - ? `${$t(`icu.the_*_is_incomplete`, { value: `${$t(`models.trade_product.fields.${trade_product_add.err}.label`)}`.toLowerCase() })}` - : `${$t(`${trade_product_add.err_s[0]}`)}`, + ? `${$ls(`icu.the_*_is_incomplete`, { value: `${$ls(`models.trade_product.fields.${trade_product_add.err}.label`)}`.toLowerCase() })}` + : `${$ls(`${trade_product_add.err_s[0]}`)}`, ); return; } @@ -685,7 +685,7 @@ <LayoutTrellisLine basis={{ label: { - value: `${$t(`icu.listing_*`, { value: `${$t(`common.title`)}` })}`, + value: `${$ls(`icu.listing_*`, { value: `${$ls(`common.title`)}` })}`, }, }} > @@ -700,7 +700,7 @@ layer: 1, sync: true, classes: `fade-in-long`, - placeholder: `${$t(`icu.enter_*`, { value: `${$t(`common.title`)}`.toLowerCase() })}`, + placeholder: `${$ls(`icu.enter_*`, { value: `${$ls(`common.title`)}`.toLowerCase() })}`, field: { charset: trade_product_form_fields.title @@ -717,12 +717,12 @@ <LayoutTrellisLine basis={{ label: { - value: `${$t(`common.product`)}`, + value: `${$ls(`common.product`)}`, }, notify: tradepr_key_sel_toggle ? { label: { - value: `${$t(`common.close`)}`, + value: `${$ls(`common.close`)}`, }, callback: async () => { await handle_tradepr_key_toggle( @@ -750,18 +750,18 @@ entries: [ { value: ``, - label: `${$t(`icu.choose_*`, { value: `${$t(`common.product`)}`.toLowerCase() })}`, + label: `${$ls(`icu.choose_*`, { value: `${$ls(`common.product`)}`.toLowerCase() })}`, disabled: true, }, ...trade_keys.map( (i) => ({ value: i, - label: `${$t(`trade.product.key.${i}.name`)}`, + label: `${$ls(`trade.product.key.${i}.name`)}`, }), ), { value: ``, - label: `${$t(`common.other`)}`, + label: `${$ls(`common.other`)}`, }, ], }, @@ -797,7 +797,7 @@ layer: 1, sync: true, classes: `fade-in-long`, - placeholder: `${$t(`icu.enter_the_*`, { value: `${$t(`icu.*_name`, { value: `${$t(`common.product`)}` })}`.toLowerCase() })}`, + placeholder: `${$ls(`icu.enter_the_*`, { value: `${$ls(`icu.*_name`, { value: `${$ls(`common.product`)}` })}`.toLowerCase() })}`, field: { charset: trade_product_form_fields @@ -815,12 +815,12 @@ <LayoutTrellisLine basis={{ label: { - value: `${$t(`common.process`)}`, + value: `${$ls(`common.process`)}`, }, notify: tradepr_process_sel_toggle ? { label: { - value: `${$t(`common.close`)}`, + value: `${$ls(`common.close`)}`, }, callback: async () => { await handle_tradepr_process_toggle( @@ -850,30 +850,30 @@ ? [ { value: ``, - label: `${$t(`icu.choose_*`, { value: `${$t(`common.process`)}`.toLowerCase() })}`, + label: `${$ls(`icu.choose_*`, { value: `${$ls(`common.process`)}`.toLowerCase() })}`, disabled: true, }, ...tradepr_process_list.map( (i) => ({ value: i, - label: `${$t(`trade.product.key.${tradepr_key_parsed}.process.${i}`)}`, + label: `${$ls(`trade.product.key.${tradepr_key_parsed}.process.${i}`)}`, }), ), { value: ``, - label: `${$t(`common.other`)}`, + label: `${$ls(`common.other`)}`, }, ] : [ { value: ``, - label: `${$t(`icu.choose_*`, { value: `${$t(`common.process`)}`.toLowerCase() })}`, + label: `${$ls(`icu.choose_*`, { value: `${$ls(`common.process`)}`.toLowerCase() })}`, disabled: true, }, { value: `*choose-product`, - label: `${$t(`icu.choose_*`, { value: `${$t(`common.product`)}`.toLowerCase() })}`, + label: `${$ls(`icu.choose_*`, { value: `${$ls(`common.product`)}`.toLowerCase() })}`, }, ], }, @@ -905,7 +905,7 @@ layer: 1, sync: true, classes: `fade-in-long`, - placeholder: `${$t(`icu.enter_the_*`, { value: `${$t(`common.process`)}`.toLowerCase() })}`, + placeholder: `${$ls(`icu.enter_the_*`, { value: `${$ls(`common.process`)}`.toLowerCase() })}`, field: { charset: trade_product_form_fields @@ -923,7 +923,7 @@ <LayoutTrellisLine basis={{ label: { - value: `${$t(`common.location`)}`, + value: `${$ls(`common.location`)}`, }, }} > @@ -944,12 +944,12 @@ ? [ { value: ``, - label: `${$t(`icu.choose_*`, { value: `${$t(`common.location`)}`.toLowerCase() })}`, + label: `${$ls(`icu.choose_*`, { value: `${$ls(`common.location`)}`.toLowerCase() })}`, disabled: true, }, { value: `*map`, - label: `${$t(`icu.choose_on_*`, { value: `${$t(`common.map`)}`.toLowerCase() })}`, + label: `${$ls(`icu.choose_on_*`, { value: `${$ls(`common.map`)}`.toLowerCase() })}`, }, { value: `*geoc`, @@ -965,12 +965,12 @@ : [ { value: ``, - label: `${$t(`icu.choose_*`, { value: `${$t(`common.location`)}`.toLowerCase() })}`, + label: `${$ls(`icu.choose_*`, { value: `${$ls(`common.location`)}`.toLowerCase() })}`, disabled: true, }, { value: `*map`, - label: `${$t(`icu.choose_on_*`, { value: `${$t(`common.map`)}`.toLowerCase() })}`, + label: `${$ls(`icu.choose_on_*`, { value: `${$ls(`common.map`)}`.toLowerCase() })}`, }, ...tradepr_lgc_list.map( (i) => ({ @@ -1014,7 +1014,7 @@ <p class={`font-sans font-[400] text-[1.05rem] text-layer-1-glyph_d`} > - {`${$t(`common.listing`)}`} + {`${$ls(`common.listing`)}`} </p> </div> <div @@ -1026,10 +1026,10 @@ <TradeFieldDisplayKv basis={{ visible: $carousel_index === 1, - label: `${$t(`common.title`)}`, + label: `${$ls(`common.title`)}`, display: { kv: `title`, - undef: `${$t(`icu.no_*`, { value: `${$t(`common.title`)}`.toLowerCase() })}`, + undef: `${$ls(`icu.no_*`, { value: `${$ls(`common.title`)}`.toLowerCase() })}`, }, handle_back: async () => { await handle_back(1); @@ -1039,10 +1039,10 @@ <TradeFieldDisplayKv basis={{ visible: $carousel_index === 1, - label: `${$t(`common.product`)}`, + label: `${$ls(`common.product`)}`, display: { kv: `key`, - undef: `${$t(`icu.no_*`, { value: `${$t(`common.product`)}`.toLowerCase() })}`, + undef: `${$ls(`icu.no_*`, { value: `${$ls(`common.product`)}`.toLowerCase() })}`, }, handle_back: async () => { await handle_back(1); @@ -1052,10 +1052,10 @@ <TradeFieldDisplayKv basis={{ visible: $carousel_index === 1, - label: `${$t(`common.process`)}`, + label: `${$ls(`common.process`)}`, display: { kv: `process`, - undef: `${$t(`icu.no_*`, { value: `${$t(`common.process`)}`.toLowerCase() })}`, + undef: `${$ls(`icu.no_*`, { value: `${$ls(`common.process`)}`.toLowerCase() })}`, }, handle_back: async () => { await handle_back(1); @@ -1066,12 +1066,12 @@ basis={{ visible: $carousel_index === 1, kv_wrap: `tradepr_location_wrap`, - label: `${$t(`common.location`)}`, + label: `${$ls(`common.location`)}`, display: { value: tradepr_lgc_sel_geoc ? `${tradepr_lgc_sel_geoc.name}, ${tradepr_lgc_sel_geoc.admin1_name}, ${tradepr_lgc_sel_geoc.country_id}` : ``, - undef: `${$t(`icu.no_*`, { value: `${$t(`common.location`)}`.toLowerCase() })}`, + undef: `${$ls(`icu.no_*`, { value: `${$ls(`common.location`)}`.toLowerCase() })}`, }, handle_back: async () => { await handle_back(1); @@ -1085,7 +1085,7 @@ <LayoutTrellisLine basis={{ label: { - value: `${$t(`common.lot`)}`, + value: `${$ls(`common.lot`)}`, }, }} > @@ -1099,7 +1099,7 @@ id: fmt_id(`lot`), layer: 1, sync: true, - placeholder: `${$t(`icu.enter_the_*`, { value: `${$t(`icu.*_name`, { value: `${$t(`common.lot`)}` })}`.toLowerCase() })}`, + placeholder: `${$ls(`icu.enter_the_*`, { value: `${$ls(`icu.*_name`, { value: `${$ls(`common.lot`)}` })}`.toLowerCase() })}`, field: { charset: trade_product_form_fields.lot @@ -1116,7 +1116,7 @@ <LayoutTrellisLine basis={{ label: { - value: `${$t(`icu.*_price`, { value: `${$t(`common.product`)}` })} (${tradepr_price_curr_sel}/${`${$t(`measurement.mass.unit.${tradepr_price_qty_unit_sel}_ab`)}`})`, + value: `${$ls(`icu.*_price`, { value: `${$ls(`common.product`)}` })} (${tradepr_price_curr_sel}/${`${$ls(`measurement.mass.unit.${tradepr_price_qty_unit_sel}_ab`)}`})`, }, }} > @@ -1159,7 +1159,7 @@ id: fmt_id(`price_amt`), layer: 1, sync: true, - placeholder: `${$t(`icu.enter_the_*`, { value: `${$t(`common.price`)}`.toLowerCase() })}`, + placeholder: `${$ls(`icu.enter_the_*`, { value: `${$ls(`common.price`)}`.toLowerCase() })}`, field: { charset: trade_product_form_fields @@ -1223,7 +1223,7 @@ entries: mass_units.map( (i) => ({ value: i, - label: `${$t(`measurement.mass.unit.${i}_ab`)}`.toLowerCase(), + label: `${$ls(`measurement.mass.unit.${i}_ab`)}`.toLowerCase(), }), ), }, @@ -1236,12 +1236,12 @@ <LayoutTrellisLine basis={{ label: { - value: `${$t(`icu.*_quantity`, { value: `${$t(`common.order`)}` })}`, + value: `${$ls(`icu.*_quantity`, { value: `${$ls(`common.order`)}` })}`, }, notify: tradepr_qty_tup_sel_toggle ? { label: { - value: `${$t(`common.close`)}`, + value: `${$ls(`common.close`)}`, }, callback: async () => { await handle_tradepr_qty_amt_toggle( @@ -1267,7 +1267,7 @@ entries: [ { value: ``, - label: `${$t(`icu.choose_*`, { value: `${$t(`common.quantity`)}`.toLowerCase() })}`, + label: `${$ls(`icu.choose_*`, { value: `${$ls(`common.quantity`)}`.toLowerCase() })}`, disabled: true, }, ...tradepr_key_quantities_list.map( @@ -1275,12 +1275,12 @@ value: fmt_trade_quantity_tup( i, ), - label: `${i.mass} ${$t(`measurement.mass.unit.${i.mass_unit}_ab`)} ${i.label}`, + label: `${i.mass} ${$ls(`measurement.mass.unit.${i.mass_unit}_ab`)} ${i.label}`, }), ), { value: ``, - label: `${$t(`common.other`)}`, + label: `${$ls(`common.other`)}`, }, ], }, @@ -1312,7 +1312,7 @@ id: fmt_id(`qty_amt`), sync: true, layer: 1, - placeholder: `${$t(`icu.enter_*_per_order`, { value: `${$t(`measurement.mass.unit.${tradepr_qty_unit_sel}_ab`)}`.toLowerCase() })}`, + placeholder: `${$ls(`icu.enter_*_per_order`, { value: `${$ls(`measurement.mass.unit.${tradepr_qty_unit_sel}_ab`)}`.toLowerCase() })}`, field: { charset: trade_product_form_fields @@ -1340,7 +1340,7 @@ entries: mass_units.map( (i) => ({ value: i, - label: `${$t(`measurement.mass.unit.${i}_ab`)}`, + label: `${$ls(`measurement.mass.unit.${i}_ab`)}`, }), ), }, @@ -1354,7 +1354,7 @@ <LayoutTrellisLine basis={{ label: { - value: `${$t(`common.description`)}`, + value: `${$ls(`common.description`)}`, }, }} > @@ -1367,7 +1367,7 @@ classes: `h-[7rem]`, id: fmt_id(`summary`), sync: true, - placeholder: `${$t(`icu.enter_the_*`, { value: `${$t(`icu.*_description`, { value: `${$t(`common.listing`)}` })}`.toLowerCase() })}`, + placeholder: `${$ls(`icu.enter_the_*`, { value: `${$ls(`icu.*_description`, { value: `${$ls(`common.listing`)}` })}`.toLowerCase() })}`, field: { charset: trade_product_form_fields @@ -1400,7 +1400,7 @@ <p class={`font-sans font-[400] text-[1.05rem] text-layer-1-glyph_d`} > - {`${$t(`common.listing`)}`} + {`${$ls(`common.listing`)}`} </p> </div> <div @@ -1412,10 +1412,10 @@ <TradeFieldDisplayKv basis={{ visible: $carousel_index === 2, - label: `${$t(`common.title`)}`, + label: `${$ls(`common.title`)}`, display: { kv: `title`, - undef: `${$t(`icu.no_*`, { value: `${$t(`common.title`)}`.toLowerCase() })}`, + undef: `${$ls(`icu.no_*`, { value: `${$ls(`common.title`)}`.toLowerCase() })}`, }, handle_back: async () => { await handle_back(2); @@ -1425,10 +1425,10 @@ <TradeFieldDisplayKv basis={{ visible: $carousel_index === 2, - label: `${$t(`common.product`)}`, + label: `${$ls(`common.product`)}`, display: { kv: `key`, - undef: `${$t(`icu.no_*`, { value: `${$t(`common.product`)}`.toLowerCase() })}`, + undef: `${$ls(`icu.no_*`, { value: `${$ls(`common.product`)}`.toLowerCase() })}`, }, handle_back: async () => { await handle_back(2); @@ -1438,10 +1438,10 @@ <TradeFieldDisplayKv basis={{ visible: $carousel_index === 2, - label: `${$t(`common.process`)}`, + label: `${$ls(`common.process`)}`, display: { kv: `process`, - undef: `${$t(`icu.no_*`, { value: `${$t(`common.process`)}`.toLowerCase() })}`, + undef: `${$ls(`icu.no_*`, { value: `${$ls(`common.process`)}`.toLowerCase() })}`, }, handle_back: async () => { await handle_back(2); @@ -1452,12 +1452,12 @@ basis={{ visible: $carousel_index === 2, kv_wrap: `tradepr_location_wrap`, - label: `${$t(`common.location`)}`, + label: `${$ls(`common.location`)}`, display: { value: tradepr_lgc_sel_geoc ? `${tradepr_lgc_sel_geoc.name}, ${tradepr_lgc_sel_geoc.admin1_name}, ${tradepr_lgc_sel_geoc.country_id}` : ``, - undef: `${$t(`icu.no_*`, { value: `${$t(`common.location`)}`.toLowerCase() })}`, + undef: `${$ls(`icu.no_*`, { value: `${$ls(`common.location`)}`.toLowerCase() })}`, }, handle_back: async () => { await handle_back(2); @@ -1467,10 +1467,10 @@ <TradeFieldDisplayKv basis={{ visible: $carousel_index === 2, - label: `${$t(`common.lot`)}`, + label: `${$ls(`common.lot`)}`, display: { kv: `lot`, - undef: `${$t(`icu.no_*`, { value: `${$t(`common.lot`)}`.toLowerCase() })}`, + undef: `${$ls(`icu.no_*`, { value: `${$ls(`common.lot`)}`.toLowerCase() })}`, }, handle_back: async () => { await handle_back(1); @@ -1480,10 +1480,10 @@ <TradeFieldDisplayKv basis={{ visible: $carousel_index === 2, - label: `${$t(`common.description`)}`, + label: `${$ls(`common.description`)}`, display: { kv: `summary`, - undef: `${$t(`icu.no_*`, { value: `${$t(`common.description`)}`.toLowerCase() })}`, + undef: `${$ls(`icu.no_*`, { value: `${$ls(`common.description`)}`.toLowerCase() })}`, }, handle_back: async () => { await handle_back(1); @@ -1497,15 +1497,15 @@ <TradeFieldDisplayKv basis={{ visible: $carousel_index === 2, - label: `${$t(`common.price`)}`, + label: `${$ls(`common.price`)}`, kv_wrap: `price_wrap`, display: { value: tradepr_cprice_amt && tradepr_price_qty_unit_sel - ? `${fmt_currency_price(tradepr_cprice_amt)} / ${`${$t(`measurement.mass.unit.${tradepr_price_qty_unit_sel}_ab`)}`.toLowerCase()}` + ? `${fmt_currency_price(tradepr_cprice_amt)} / ${`${$ls(`measurement.mass.unit.${tradepr_price_qty_unit_sel}_ab`)}`.toLowerCase()}` : ``, - undef: `${$t(`icu.no_*`, { value: `${$t(`common.price`)}`.toLowerCase() })}`, + undef: `${$ls(`icu.no_*`, { value: `${$ls(`common.price`)}`.toLowerCase() })}`, nostyle: true, }, handle_back: async () => { @@ -1516,12 +1516,12 @@ <TradeFieldDisplayKv basis={{ visible: $carousel_index === 2, - label: `${$t(`icu.*_quantity`, { value: `${$t(`common.order`)}` })}`, + label: `${$ls(`icu.*_quantity`, { value: `${$ls(`common.order`)}` })}`, display: { value: tradepr_parsed_quantity - ? `${tradepr_parsed_quantity.mass} ${`${$t(`measurement.mass.unit.${tradepr_parsed_quantity.mass_unit}_ab`)}`.toLowerCase()} ${tradepr_parsed_quantity.label || `${$t(`common.bag`)}`}` + ? `${tradepr_parsed_quantity.mass} ${`${$ls(`measurement.mass.unit.${tradepr_parsed_quantity.mass_unit}_ab`)}`.toLowerCase()} ${tradepr_parsed_quantity.label || `${$ls(`common.bag`)}`}` : ``, - undef: `${$t(`icu.no_*`, { value: `${$t(`icu.*_quantity`, { value: `${$t(`common.order`)}` })}` })}`, + undef: `${$ls(`icu.no_*`, { value: `${$ls(`icu.*_quantity`, { value: `${$ls(`common.order`)}` })}` })}`, nostyle: !!tradepr_parsed_quantity, }, @@ -1534,7 +1534,7 @@ <TradeFieldDisplayEl basis={{ visible: $carousel_index === 2, - label: `${$t(`icu.*_available`, { value: `${$t(`common.quantity`)}` })}${tradepr_parsed_quantity ? ` (${$tradepr_qty_avail})` : ``}`, + label: `${$ls(`icu.*_available`, { value: `${$ls(`common.quantity`)}` })}${tradepr_parsed_quantity ? ` (${$tradepr_qty_avail})` : ``}`, display: { classes: tradepr_parsed_quantity @@ -1597,7 +1597,7 @@ <TradeFieldDisplayEl basis={{ visible: $carousel_index === 2, - label: `${$t(`icu.*_total`, { value: `${$t(`common.quantity`)}` })}`, + label: `${$ls(`icu.*_total`, { value: `${$ls(`common.quantity`)}` })}`, display: { classes: tradepr_parsed_quantity @@ -1609,7 +1609,7 @@ tradepr_parsed_quantity.mass, ).toFixed( 2, - )} ${`${$t(`measurement.mass.unit.${tradepr_parsed_quantity.mass_unit}_ab`)}`.toLowerCase()}` + )} ${`${$ls(`measurement.mass.unit.${tradepr_parsed_quantity.mass_unit}_ab`)}`.toLowerCase()}` : ``, undef: ascii.dash, nostyle: true, @@ -1623,7 +1623,7 @@ <TradeFieldDisplayEl basis={{ visible: $carousel_index === 2, - label: `${$t(`icu.*_total`, { value: `${$t(`common.order`)}` })}`, + label: `${$ls(`icu.*_total`, { value: `${$ls(`common.order`)}` })}`, display: { classes: tradepr_parsed_quantity && @@ -1650,7 +1650,7 @@ {#if load_submit} <Loading /> {:else} - {`${$t(`common.post`)}`} + {`${$ls(`common.post`)}`} {/if} </button> </LayoutTrellis> @@ -1689,7 +1689,7 @@ <p class={`font-sans font-[400] text-[1.3rem] text-layer-0-glyph`} > - {`${$t(`common.complete`)}`} + {`${$ls(`common.complete`)}`} </p> </div> <div @@ -1713,7 +1713,7 @@ <p class={`font-sans font-[400] text-[1.1rem] text-layer-0-glyph`} > - {`${$t(`icu.click_to_*`, { value: `${$t(`icu.view_the_*`, { value: `${$t(`common.product`)}` })}`.toLowerCase() })}`} + {`${$ls(`icu.click_to_*`, { value: `${$ls(`icu.view_the_*`, { value: `${$ls(`common.product`)}` })}`.toLowerCase() })}`} </p> </button> </div> @@ -1730,8 +1730,8 @@ prev: { label: view === `success` - ? `${$t(`common.home`)}` - : `${$t(`common.back`)}`, + ? `${$ls(`common.home`)}` + : `${$ls(`common.back`)}`, route: view === `success` ? `/` : `/models/trade-product`, prevent_route: (view === `c_1` && $carousel_index === 0) || view === `success` @@ -1750,7 +1750,7 @@ value: view === `success` ? `` - : `${$t(`icu.new_*`, { value: `${$t(`common.product`)}` })}`, + : `${$ls(`icu.new_*`, { value: `${$ls(`common.product`)}` })}`, }, callback: async () => {}, }, @@ -1758,7 +1758,7 @@ label: { value: $carousel_num > 1 - ? `${$t(`common.back`)}` + ? `${$ls(`common.back`)}` : page_param.carousel[view].get($carousel_index) ?.label_next || ``, glyph: diff --git a/src/routes/(app)/models/trade-product/view/+page.svelte b/src/routes/(app)/models/trade-product/view/+page.svelte @@ -5,9 +5,9 @@ app_notify, LayoutTrellis, LayoutView, + ls, Nav, qp_id, - t, } from "@radroots/svelte-lib"; import { onMount } from "svelte"; @@ -16,7 +16,7 @@ onMount(async () => { try { - if (!$qp_id) app_notify.set(`${$t(`error.client.page.load`)}`); + if (!$qp_id) app_notify.set(`${$ls(`error.client.page.load`)}`); ld = await load_data(); } catch (e) { } finally { @@ -29,7 +29,7 @@ id: $qp_id, }); if (`err` in _trade_product) { - app_notify.set(`${$t(`error.client.page.load`)}`); //@todo + app_notify.set(`${$ls(`error.client.page.load`)}`); //@todo return; } const { result: trade_product } = _trade_product; @@ -66,12 +66,12 @@ <Nav basis={{ prev: { - label: `${$t(`common.back`)}`, + label: `${$ls(`common.back`)}`, route: `/models/trade-product`, }, title: { label: { - value: `${$t(`common.product`)}`, + value: `${$ls(`common.product`)}`, }, }, }} diff --git a/src/routes/(app)/settings/+page.svelte b/src/routes/(app)/settings/+page.svelte @@ -6,9 +6,9 @@ app_thc, LayoutTrellis, LayoutView, + ls, Nav, route, - t, Trellis, } from "@radroots/svelte-lib"; import { parse_color_mode } from "@radroots/theme"; @@ -30,7 +30,7 @@ label: { left: [ { - value: `${$t(`common.color_mode`)}`, + value: `${$ls(`common.color_mode`)}`, classes: `capitalize`, }, ], @@ -48,16 +48,16 @@ entries: [ { value: ascii.bullet, - label: `${$t(`icu.choose_*`, { value: `${$t(`common.color_mode`)}`.toLowerCase() })}`, + label: `${$ls(`icu.choose_*`, { value: `${$ls(`common.color_mode`)}`.toLowerCase() })}`, disabled: true, }, { value: `light`, - label: `${$t(`common.light`)}`, + label: `${$ls(`common.light`)}`, }, { value: `dark`, - label: `${$t(`common.dark`)}`, + label: `${$ls(`common.dark`)}`, }, ], }, @@ -417,12 +417,12 @@ <Nav basis={{ prev: { - label: `${$t(`common.home`)}`, + label: `${$ls(`common.home`)}`, route: `/`, }, title: { label: { - value: `${$t(`common.settings`)}`, + value: `${$ls(`common.settings`)}`, }, }, }} diff --git a/src/routes/(app)/settings/nostr/+page.svelte b/src/routes/(app)/settings/nostr/+page.svelte @@ -5,8 +5,8 @@ LayoutTrellis, LayoutView, Nav, - t, Trellis, + ls, type ISelectOption, } from "@radroots/svelte-lib"; import { onMount } from "svelte"; @@ -17,7 +17,7 @@ select_options: [ { value: ascii.bullet, - label: `${$t(`icu.choose_*`, { value: `${$t(`common.photo_hosting`)}`.toLowerCase() })}`, + label: `${$ls(`icu.choose_*`, { value: `${$ls(`common.photo_hosting`)}`.toLowerCase() })}`, disabled: true, }, { @@ -26,7 +26,7 @@ }, { value: `*add`, - label: `${$t(`icu.add_*`, { value: `${$t(`common.upload_url`)}`.toLowerCase() })}`, + label: `${$ls(`icu.add_*`, { value: `${$ls(`common.upload_url`)}`.toLowerCase() })}`, }, { value: `*disable`, @@ -129,12 +129,12 @@ <Nav basis={{ prev: { - label: `${$t(`common.settings`)}`, + label: `${$ls(`common.settings`)}`, route: `/settings`, }, title: { label: { - value: `${$t(`common.nostr`)}`, + value: `${$ls(`common.nostr`)}`, }, }, }} diff --git a/src/routes/(app)/settings/profile/+page.svelte b/src/routes/(app)/settings/profile/+page.svelte @@ -11,10 +11,9 @@ Glyph, ImageBlob, ImagePath, - LayoutView, - Nav, + Loading, + ls, route, - t, TabsFloat, } from "@radroots/svelte-lib"; import { onDestroy, onMount } from "svelte"; @@ -83,6 +82,15 @@ } }; + const handle_back = async (): Promise<void> => { + try { + if (opt_photo_path) await handle_profile_photo_add(opt_photo_path); + await route(`/`); + } catch (e) { + console.log(`(error) handle_back `, e); + } + }; + const handle_profile_photo_add = async ( file_path: string, ): Promise<void> => { @@ -130,7 +138,7 @@ }, }); if (`err` in nostr_profile_update) { - await dialog.alert(`${$t(`error.client.unhandled`)}`); + await dialog.alert(`${$ls(`error.client.unhandled`)}`); return; } } @@ -143,204 +151,219 @@ }; </script> -<LayoutView> - <div - class={`relative flex flex-col min-h-[440px] h-[440px] w-full justify-center items-center bg-layer-2-surface fade-in`} - > - {#if ld?.nostr_profile?.picture} - <ImagePath - basis={{ - path: ld.nostr_profile.picture, +<div + class={`relative flex flex-col min-h-[525px] h-[525px] w-full justify-center items-center bg-layer-2-surface fade-in`} +> + {#if ld?.nostr_profile?.picture} + <ImagePath + basis={{ + path: ld.nostr_profile.picture, + }} + /> + <div class={`absolute top-16 left-6 flex flex-row`}> + <button + class={`flex flex-row h-12 w-12 justify-center items-center bg-layer-2-surface rounded-full el-re`} + on:click={async () => { + await handle_back(); }} - /> - <div class={`absolute top-4 right-4 flex flex-row`}> - <button - class={`flex flex-row h-12 w-12 justify-center items-center bg-layer-0-surface rounded-full layer-1-active-surface el-re`} - on:click={async () => { - alert(`@todo!`); - }} - > + > + {#if loading_photo_upload} + <Loading /> + {:else} <Glyph basis={{ - classes: ``, - dim: `sm`, + classes: `text-layer-0-glyph`, + dim: `sm+`, weight: `bold`, - key: `images-square`, + key: `arrow-left`, }} /> - </button> - </div> - {:else if opt_photo_path} - {#await fs.read_bin(opt_photo_path) then file_data} - <ImageBlob + {/if} + </button> + </div> + <div class={`absolute top-16 right-6 flex flex-row`}> + <button + class={`flex flex-row h-12 w-12 justify-center items-center bg-layer-2-surface rounded-full el-re`} + on:click={async () => { + alert(`@todo!`); + }} + > + <Glyph basis={{ - data: file_data, + classes: `text-layer-0-glyph`, + dim: `md-`, + weight: `bold`, + key: `images-square`, }} /> - {/await} - {:else} - <div - class={`flex flex-row justify-start items-center -translate-y-8`} - > - <ImageUploadAddPhoto bind:photo_path={opt_photo_path} /> - </div> - {/if} + </button> + </div> + {:else if opt_photo_path} + {#await fs.read_bin(opt_photo_path) then file_data} + <ImageBlob + basis={{ + data: file_data, + }} + /> + {/await} + {:else} + <div class={`flex flex-row justify-start items-center -translate-y-8`}> + <ImageUploadAddPhoto bind:photo_path={opt_photo_path} /> + </div> + {/if} + <div + class={`absolute bottom-0 left-0 flex flex-col h-[calc(100%-100%/1.618)] w-full px-6 gap-2 justify-end items-center`} + > <div - class={`absolute bottom-0 left-0 flex flex-col h-[calc(100%-100%/1.618)] w-full px-6 gap-2 justify-end items-center`} + class={`flex flex-col w-full gap-[2px] justify-center items-center`} > - <div - class={`flex flex-col w-full gap-[2px] justify-center items-center`} - > - <div - class={`flex flex-row h-10 w-full justify-start items-center`} - > - <button - class={`group flex flex-row justify-center items-center`} - on:click={async () => { - await route(`/settings/profile/edit`, [ - [`nostr_pk`, $app_nostr_key], - [`rkey`, `display_name`], - ]); - }} - > - <p - class={`font-sansd font-[600] text-[2rem] ${classes_photo_overlay_glyph} ${ld?.nostr_profile.display_name ? `` : `capitalize opacity-active`} el-re`} - > - {ld?.nostr_profile.display_name - ? ld.nostr_profile.display_name - : `+ ${`${$t(`icu.add_*`, { value: `${$t(`common.profile_name`)}` })}`}`} - </p> - </button> - </div> - <div - class={`flex flex-row w-full gap-[6px] justify-start items-center`} + <div class={`flex flex-row h-10 w-full justify-start items-center`}> + <button + class={`group flex flex-row justify-center items-center`} + on:click={async () => { + await route(`/settings/profile/edit`, [ + [`nostr_pk`, $app_nostr_key], + [`rkey`, `display_name`], + ]); + }} > - <button - class={`group flex flex-row justify-center items-center`} - on:click={async () => { - const confirm = await dialog.confirm({ - message: `Updating your username will result in public links on your profile being updated. Do you want to continue?`, - }); - if (confirm) - await route(`/settings/profile/edit`, [ - [`nostr_pk`, $app_nostr_key], - [`rkey`, `name`], - ]); - }} - > - <p - class={`font-sansd font-[600] text-[1.1rem] ${classes_photo_overlay_glyph} ${ld?.nostr_profile.name ? `` : `capitalize opacity-active`} el-re`} - > - {ld?.nostr_profile.name - ? `@${ld.nostr_profile.name}` - : `+ ${`${$t(`icu.add_*`, { value: `${$t(`common.username`)}` })}`}`} - </p> - </button> <p - class={`font-sans font-[400] ${classes_photo_overlay_glyph}`} + class={`font-sansd font-[600] text-[2rem] ${classes_photo_overlay_glyph} ${ld?.nostr_profile.display_name ? `` : `capitalize opacity-active`} el-re`} > - {ascii.bullet} + {ld?.nostr_profile.display_name + ? ld.nostr_profile.display_name + : `+ ${`${$ls(`icu.add_*`, { value: `${$ls(`common.profile_name`)}` })}`}`} </p> - <button - class={`flex flex-row justify-center items-center`} - on:click={async () => { - alert(`@todo!`); - }} - > - <Glyph - basis={{ - classes: `${classes_photo_overlay_glyph}`, - dim: `xs`, - weight: `bold`, - key: `link-simple`, - }} - /> - </button> - </div> - <div class={`flex flex-row w-full justify-start items-center`}> - <button - class={`group flex flex-row justify-center items-center`} - on:click={async () => { - await route(`/settings/profile/edit`, [ - [`nostr_pk`, $app_nostr_key], - [`rkey`, `about`], - ]); - }} - > - <p - class={`font-sansd font-[400] text-[1.1rem] ${classes_photo_overlay_glyph} ${ld?.nostr_profile.about ? `` : `capitalize opacity-active`}`} - > - {ld?.nostr_profile.about - ? `@${ld.nostr_profile.about}` - : `+ ${`${$t(`icu.add_*`, { value: `${$t(`common.bio`)}` })}`}`} - </p> - </button> - </div> + </button> </div> <div - class={`flex flex-row w-full pt-2 pb-6 gap-2 justify-start items-center`} + class={`flex flex-row w-full gap-[6px] justify-start items-center`} > <button - class={`flex flex-row justify-center items-center`} + class={`group flex flex-row justify-center items-center`} on:click={async () => { - view_display = `photos`; + const confirm = await dialog.confirm({ + message: `Updating your username will result in public links on your profile being updated. Do you want to continue?`, + }); + if (confirm) + await route(`/settings/profile/edit`, [ + [`nostr_pk`, $app_nostr_key], + [`rkey`, `name`], + ]); }} > <p - class={`font-sans text-[1.1rem] font-[600] capitalize ${view_display === `photos` ? classes_photo_overlay_glyph_opt_selected : classes_photo_overlay_glyph_opt} el-re`} + class={`font-sansd font-[600] text-[1.1rem] ${classes_photo_overlay_glyph} ${ld?.nostr_profile.name ? `` : `capitalize opacity-active`} el-re`} > - {`photos`} + {ld?.nostr_profile.name + ? `@${ld.nostr_profile.name}` + : `+ ${`${$ls(`icu.add_*`, { value: `${$ls(`common.username`)}` })}`}`} </p> </button> + <p + class={`font-sans font-[400] ${classes_photo_overlay_glyph}`} + > + {ascii.bullet} + </p> <button class={`flex flex-row justify-center items-center`} on:click={async () => { - view_display = `following`; + alert(`@todo!`); }} > - <p - class={`font-sans text-[1.1rem] font-[600] capitalize ${view_display === `following` ? classes_photo_overlay_glyph_opt_selected : classes_photo_overlay_glyph_opt} el-re`} - > - {`following`} - </p> + <Glyph + basis={{ + classes: `${classes_photo_overlay_glyph}`, + dim: `xs`, + weight: `bold`, + key: `link-simple`, + }} + /> </button> + </div> + <div class={`flex flex-row w-full justify-start items-center`}> <button - class={`flex flex-row justify-center items-center`} + class={`group flex flex-row justify-center items-center`} on:click={async () => { - view_display = `followers`; + await route(`/settings/profile/edit`, [ + [`nostr_pk`, $app_nostr_key], + [`rkey`, `about`], + ]); }} > <p - class={`font-sans text-[1.1rem] font-[600] capitalize ${view_display === `followers` ? classes_photo_overlay_glyph_opt_selected : classes_photo_overlay_glyph_opt} el-re`} + class={`font-sansd font-[400] text-[1.1rem] ${classes_photo_overlay_glyph} ${ld?.nostr_profile.about ? `` : `capitalize opacity-active`}`} > - {`followers`} + {ld?.nostr_profile.about + ? `@${ld.nostr_profile.about}` + : `+ ${`${$ls(`icu.add_*`, { value: `${$ls(`common.bio`)}` })}`}`} </p> </button> </div> </div> + <div + class={`flex flex-row w-full pt-2 pb-6 gap-2 justify-start items-center`} + > + <button + class={`flex flex-row justify-center items-center`} + on:click={async () => { + view_display = `photos`; + }} + > + <p + class={`font-sans text-[1.1rem] font-[600] capitalize ${view_display === `photos` ? classes_photo_overlay_glyph_opt_selected : classes_photo_overlay_glyph_opt} el-re`} + > + {`photos`} + </p> + </button> + <button + class={`flex flex-row justify-center items-center`} + on:click={async () => { + view_display = `following`; + }} + > + <p + class={`font-sans text-[1.1rem] font-[600] capitalize ${view_display === `following` ? classes_photo_overlay_glyph_opt_selected : classes_photo_overlay_glyph_opt} el-re`} + > + {`following`} + </p> + </button> + <button + class={`flex flex-row justify-center items-center`} + on:click={async () => { + view_display = `followers`; + }} + > + <p + class={`font-sans text-[1.1rem] font-[600] capitalize ${view_display === `followers` ? classes_photo_overlay_glyph_opt_selected : classes_photo_overlay_glyph_opt} el-re`} + > + {`followers`} + </p> + </button> + </div> </div> - <div class={`flex flex-col w-full justify-start items-center`}> - {#if view_display === `photos`} - <p class={`font-sans font-[400] text-layer-0-glyph`}> - {view_display} - </p> - {:else if view_display === `following`} - <p class={`font-sans font-[400] text-layer-0-glyph`}> - {view_display} - </p> - {:else if view_display === `followers`} - <p class={`font-sans font-[400] text-layer-0-glyph`}> - {view_display} - </p> - {/if} - </div> -</LayoutView> +</div> +<div class={`flex flex-col w-full justify-start items-center`}> + {#if view_display === `photos`} + <p class={`font-sans font-[400] text-layer-0-glyph`}> + {view_display} + </p> + {:else if view_display === `following`} + <p class={`font-sans font-[400] text-layer-0-glyph`}> + {view_display} + </p> + {:else if view_display === `followers`} + <p class={`font-sans font-[400] text-layer-0-glyph`}> + {view_display} + </p> + {/if} +</div> <TabsFloat /> -<Nav +<!--<Nav basis={{ prev: { loading: loading_photo_upload, - label: `${$t(`common.home`)}`, + label: `${$ls(`common.home`)}`, route: `/`, prevent_route: opt_photo_path ? { @@ -352,8 +375,8 @@ }, title: { label: { - value: `${$t(`common.profile`)}`, + value: `${$ls(`common.profile`)}`, }, }, }} -/> +/>--> diff --git a/src/routes/(app)/settings/profile/edit/+page.svelte b/src/routes/(app)/settings/profile/edit/+page.svelte @@ -14,11 +14,11 @@ InputElement, kv, LayoutView, + ls, Nav, qp_nostr_pk, qp_rkey, route, - t, TextareaElement, } from "@radroots/svelte-lib"; import { onDestroy, onMount } from "svelte"; @@ -36,7 +36,7 @@ try { if (!$qp_rkey || !$qp_nostr_pk) { app_notify.set( - `${$t(`icu.error_loading_*`, { value: `${$t(`common.page`)}` })}`, + `${$ls(`icu.error_loading_*`, { value: `${$ls(`common.page`)}` })}`, ); return; } @@ -55,7 +55,7 @@ }); $: translated_field_key = ld?.field_key - ? `${$t(`models.nostr_profile.fields.${ld.field_key}.label`)}` + ? `${$ls(`models.nostr_profile.fields.${ld.field_key}.label`)}` : ``; $: input_value_del = page_initial_value !== page_input_value; const load_page = async (): Promise<LoadData | undefined> => { @@ -65,14 +65,14 @@ }); if (`err` in nostr_profile) { app_notify.set( - `${$t(`icu.error_loading_*`, { value: `${$t(`common.profile`)}` })}`, + `${$ls(`icu.error_loading_*`, { value: `${$ls(`common.profile`)}` })}`, ); return; } const field_key = parse_nostr_profile_form_keys($qp_rkey); if (!field_key) { - app_notify.set(`${$t(`error.client.page.load`)}`); + app_notify.set(`${$ls(`error.client.page.load`)}`); return; } @@ -104,7 +104,7 @@ nostr_profile_form_fields[ld.field_key].validation.test(val); if (!validated) { dialog.alert( - `${$t(`icu.invalid_*_entry`, { value: translated_field_key })}`, + `${$ls(`icu.invalid_*_entry`, { value: translated_field_key })}`, ); return; } @@ -117,7 +117,7 @@ fields, }); if (`err` in update_res) { - await dialog.alert(`${$t(`error.client.unhandled`)}`); + await dialog.alert(`${$ls(`error.client.unhandled`)}`); return; } await route(`/settings/profile`); @@ -190,7 +190,7 @@ <Nav basis={{ prev: { - label: `${$t(`common.back`)}`, + label: `${$ls(`common.back`)}`, route: `/settings/profile`, prevent_route: input_value_del ? { @@ -203,15 +203,15 @@ title: { label: { classes: `capitalize`, - value: `${$t(`icu.edit_*`, { value: `${$t(`common.profile`)}` })}`, + value: `${$ls(`icu.edit_*`, { value: `${$ls(`common.profile`)}` })}`, }, }, /*option: { label: { classes: input_value_del ? `` : `opacity-60`, value: ld?.nostr_profile[ld?.field_key] - ? `${$t(`common.update`)}` - : `${$t(`common.add`)}`, + ? `${$ls(`common.update`)}` + : `${$ls(`common.add`)}`, }, callback: async () => { if (input_value_del) await submit(); diff --git a/src/routes/(cfg)/cfg/init/+page.svelte b/src/routes/(cfg)/cfg/init/+page.svelte @@ -30,8 +30,8 @@ LayoutView, Loading, LogoCircle, + ls, sleep, - t, view_effect, } from "@radroots/svelte-lib"; import { regex } from "@radroots/utils"; @@ -160,9 +160,9 @@ return; } const confirm = await dialog.confirm({ - message: `There is an existing configuration in progress${`nip_05` in profile_status.active ? ` for "${profile_status.active.nip_05}".` : `.`} ${`${$t(`common.do_you_want_to_continue_q`)}`}`, //@todo - cancel_label: `${$t(`common.reset`)}`, - ok_label: `${$t(`common.yes`)}`, + message: `There is an existing configuration in progress${`nip_05` in profile_status.active ? ` for "${profile_status.active.nip_05}".` : `.`} ${`${$ls(`common.do_you_want_to_continue_q`)}`}`, //@todo + cancel_label: `${$ls(`common.reset`)}`, + ok_label: `${$ls(`common.yes`)}`, }); if (confirm === false) { @@ -317,7 +317,7 @@ ); if (!kv_nostr_secretkey) { await dialog.alert( - `${$t(`icu.enter_a_*`, { value: `${$t(`icu.valid_*`, { value: `${$t(`common.key`)}` })}`.toLowerCase() })}`, + `${$ls(`icu.enter_a_*`, { value: `${$ls(`icu.valid_*`, { value: `${$ls(`common.key`)}` })}`.toLowerCase() })}`, ); return; } @@ -341,7 +341,7 @@ return; } await dialog.alert( - `${$t(`icu.invalid_*`, { value: `${$t(`common.key`)}`.toLowerCase() })}`, + `${$ls(`icu.invalid_*`, { value: `${$ls(`common.key`)}`.toLowerCase() })}`, ); } break; @@ -360,7 +360,7 @@ ); if (`err` in ks_nostr_secretkey) { await reset_page( - `${$t(`error.device.configuration_failure`)}`, + `${$ls(`error.device.configuration_failure`)}`, ); return; } @@ -369,7 +369,7 @@ ); if (!kv_profile_name) { await dialog.alert( - `${$t(`icu.enter_a_*`, { value: `${$t(`common.profile_name`)}`.toLowerCase() })}`, + `${$ls(`icu.enter_a_*`, { value: `${$ls(`common.profile_name`)}`.toLowerCase() })}`, ); return; } @@ -387,9 +387,9 @@ return; } const confirm = await dialog.confirm({ - message: `${`${$t(`icu.the_*_is_available`, { value: `${$t(`common.profile_name`).toLowerCase()} "${profilename_validated.profile_name}"` })}`}. Would you like to use it?`, //@todo - cancel_label: `${$t(`common.no`)}`, - ok_label: `${$t(`common.yes`)}`, + message: `${`${$ls(`icu.the_*_is_available`, { value: `${$ls(`common.profile_name`).toLowerCase()} "${profilename_validated.profile_name}"` })}`}. Would you like to use it?`, //@todo + cancel_label: `${$ls(`common.no`)}`, + ok_label: `${$ls(`common.yes`)}`, }); if (!confirm) { cfg_main_profilename_loading = false; @@ -448,7 +448,7 @@ ); if (`err` in ks_nostr_secretkey) { await dialog.alert( - `${$t(`error.device.configuration_failure`)}`, + `${$ls(`error.device.configuration_failure`)}`, ); return; //@todo } @@ -461,7 +461,7 @@ ); if (`err` in profile_activated) { await dialog.alert( - `${$t(`icu.*_failure`, { value: `${$t(`common.activation`)}` })}`, + `${$ls(`icu.*_failure`, { value: `${$ls(`common.activation`)}` })}`, ); return; //@todo } @@ -474,7 +474,7 @@ ); if (!nostr_publickey) { await dialog.alert( - `${$t(`error.device.public_key_not_derived`)}`, + `${$ls(`error.device.public_key_not_derived`)}`, ); return; //@todo } @@ -489,7 +489,7 @@ if (`err` in nostr_profile_add || `err_s` in nostr_profile_add) { await dialog.alert( - `${$t(`icu.failure_saving_*_to_the_database`, { value: `${$t(`common.profile`)}`.toLowerCase() })}`, + `${$ls(`icu.failure_saving_*_to_the_database`, { value: `${$ls(`common.profile`)}`.toLowerCase() })}`, ); return; //@todo } @@ -504,7 +504,7 @@ const nostr_relay_add = await db.nostr_relay_add({ url }); if (`err` in nostr_relay_add || `err_s` in nostr_relay_add) { await dialog.alert( - `${$t(`icu.failure_saving_*_to_the_database`, { value: `${$t(`icu.default_*`, { value: `${$t(`common.relays`)}` })}`.toLowerCase() })}`, + `${$ls(`icu.failure_saving_*_to_the_database`, { value: `${$ls(`icu.default_*`, { value: `${$ls(`common.relays`)}` })}`.toLowerCase() })}`, ); return; // @todo } @@ -520,7 +520,7 @@ await reset_ks(); await restart({ route: `/`, - notify_message: `${$t(`app.page.cfg.init.notification.welcome`)}`, + notify_message: `${$ls(`app.page.cfg.init.notification.welcome`)}`, }); } catch (e) { console.log(`(error) submit `, e); @@ -558,13 +558,13 @@ <p class={`font-sans font-[400] text-sm text-layer-0-glyph-label uppercase`} > - {`${$t(`common.setup`)}`} + {`${$ls(`common.setup`)}`} </p> </div> <div class={`grid grid-cols-12 flex flex-col gap-4 w-full justify-start items-center`} > - {#each [`${$t(`common.configure_your_device`)}`, `${$t(`common.choose_a_profile_name`)}`, `${$t(`common.terms_of_use_agreement`)}`] as li, li_i} + {#each [`${$ls(`common.configure_your_device`)}`, `${$ls(`common.choose_a_profile_name`)}`, `${$ls(`common.terms_of_use_agreement`)}`] as li, li_i} <div class={`col-span-12 flex flex-row justify-start items-center`} > @@ -595,7 +595,7 @@ <p class={`font-mono font-[600] text-layer-0-glyph text-3xl`} > - {`${$t(`icu.configure_*`, { value: `${$t(`common.device`)}` })}`} + {`${$ls(`icu.configure_*`, { value: `${$ls(`common.device`)}` })}`} </p> </div> <div @@ -610,7 +610,7 @@ <p class={`font-sans font-[600] text-layer-0-glyph text-xl`} > - {`${$t(`icu.create_new_*`, { value: `${$t(`common.keypair`)}`.toLowerCase() })}`} + {`${$ls(`icu.create_new_*`, { value: `${$ls(`common.keypair`)}`.toLowerCase() })}`} </p> </button> <button @@ -622,8 +622,8 @@ <p class={`font-sans font-[600] text-layer-0-glyph text-xl`} > - {`${$t(`icu.use_existing_*`, { - value: `${$t(`common.keypair`)}`.toLowerCase(), + {`${$ls(`icu.use_existing_*`, { + value: `${$ls(`common.keypair`)}`.toLowerCase(), })}`} </p> </button> @@ -662,14 +662,14 @@ <p class={`font-mono font-[600] text-layer-0-glyph text-3xl`} > - {`${$t(`icu.add_existing_*`, { value: `${$t(`common.key`)}`.toLowerCase() })}`} + {`${$ls(`icu.add_existing_*`, { value: `${$ls(`common.key`)}`.toLowerCase() })}`} </p> <InputElement basis={{ classes: `h-entry_guide w-${$app_layout} bg-layer-1-surface rounded-touch font-mono text-lg placeholder:opacity-60 items-end text-center`, id: fmt_id(`nostr_secretkey`), sync: true, - placeholder: `${$t(`icu.enter_*`, { value: `nostr nsec/hex` })}`, + placeholder: `${$ls(`icu.enter_*`, { value: `nostr nsec/hex` })}`, field: { charset: regex.profile_name_ch, validate: regex.profile_name, @@ -726,7 +726,7 @@ <p class={`font-mono font-[600] text-layer-0-glyph text-3xl`} > - {`${$t(`icu.add_*`, { value: `${$t(`common.profile`)}` })}`} + {`${$ls(`icu.add_*`, { value: `${$ls(`common.profile`)}` })}`} </p> <EntryLine basis={{ @@ -740,7 +740,7 @@ classes: `font-sans text-[1.25rem] text-center placeholder:opacity-60`, id: fmt_id(`nostr_profilename`), sync: true, - placeholder: `${$t(`icu.enter_*`, { value: `${$t(`common.profile_name`)}`.toLowerCase() })}`, + placeholder: `${$ls(`icu.enter_*`, { value: `${$ls(`common.profile_name`)}`.toLowerCase() })}`, field: { charset: regex.profile_name_ch, validate: regex.profile_name, @@ -777,7 +777,7 @@ <p class={`font-mono font-[600] text-layer-0-glyph text-3xl`} > - {`${$t(`common.setup_for_farmer`)}`} + {`${$ls(`common.setup_for_farmer`)}`} </p> </div> <div @@ -792,7 +792,7 @@ <p class={`font-sans font-[600] text-layer-0-glyph text-xl`} > - {`${$t(`common.yes`)}`} + {`${$ls(`common.yes`)}`} </p> </button> <button @@ -804,7 +804,7 @@ <p class={`font-sans font-[600] text-layer-0-glyph text-xl`} > - {`${$t(`common.no`)}`} + {`${$ls(`common.no`)}`} </p> </button> </div> @@ -831,7 +831,7 @@ <p class={`font-sans font-[400] text-layer-0-glyph text-lg capitalize group-active:opacity-60 transition-all`} > - {`${$t(`icu.go_*`, { value: `${$t(`common.back`)}` })}`} + {`${$ls(`icu.go_*`, { value: `${$ls(`common.back`)}` })}`} </p> </button> </div> @@ -851,14 +851,14 @@ visible: true, label: $carousel_index === 0 - ? `${$t(`common.skip`)}` - : `${$t(`common.back`)}`, + ? `${$ls(`common.skip`)}` + : `${$ls(`common.back`)}`, callback: async () => { if ($carousel_index === 0) { const confirm = await dialog.confirm({ - message: `${$t(`app.page.cfg.init.notification.no_profile_name`)}`, - cancel_label: `${$t(`icu.add_*`, { value: `${$t(`common.profile`)}` })}`, - ok_label: `${$t(`common.continue`)}`, + message: `${$ls(`app.page.cfg.init.notification.no_profile_name`)}`, + cancel_label: `${$ls(`icu.add_*`, { value: `${$ls(`common.profile`)}` })}`, + ok_label: `${$ls(`common.continue`)}`, }); if (confirm === false) { el_id(fmt_id(`nostr_profilename`))?.focus(); @@ -898,7 +898,7 @@ <p class={`font-mono font-[600] text-layer-0-glyph text-2xl`} > - {`${$t(`eula.title`)}`} + {`${$ls(`eula.title`)}`} </p> </div> <div @@ -911,12 +911,12 @@ <p class={`font-mono font-[600] text-layer-0-glyph`} > - {`**${$t(`eula.introduction.title`)}**`} + {`**${$ls(`eula.introduction.title`)}**`} </p> <p class={`font-mono font-[500] text-layer-0-glyph text-sm text-justify break-word`} > - {`${$t(`eula.introduction.body`)}`} + {`${$ls(`eula.introduction.body`)}`} </p> </div> <div @@ -925,12 +925,12 @@ <p class={`font-mono font-[600] text-layer-0-glyph`} > - {`**${$t(`eula.prohibited_content.title`)}**`} + {`**${$ls(`eula.prohibited_content.title`)}**`} </p> <p class={`font-mono font-[500] text-sm text-layer-0-glyph text-justify break-word`} > - {`${$t(`eula.prohibited_content.body_0_title`)}`} + {`${$ls(`eula.prohibited_content.body_0_title`)}`} </p> <div class={`flex flex-col w-full justify-start items-start`} @@ -954,7 +954,7 @@ <p class={`col-span-10 font-mono font-[500] text-sm text-layer-0-glyph text-justify break-word`} > - {`${$t(`eula.prohibited_content.body_li_0_${li}`)}`} + {`${$ls(`eula.prohibited_content.body_li_0_${li}`)}`} </p> </div> </div> @@ -967,7 +967,7 @@ <p class={`font-mono font-[600] text-layer-0-glyph`} > - {`**${$t(`eula.prohibited_conduct.title`)}**`} + {`**${$ls(`eula.prohibited_conduct.title`)}**`} </p> <div class={`flex flex-col w-full justify-start items-start`} @@ -991,7 +991,7 @@ <p class={`col-span-10 font-mono font-[500] text-sm text-layer-0-glyph text-justify break-word`} > - {`${$t(`eula.prohibited_conduct.body_li_0_${li}`)}`} + {`${$ls(`eula.prohibited_conduct.body_li_0_${li}`)}`} </p> </div> </div> @@ -1004,12 +1004,12 @@ <p class={`font-mono font-[600] text-layer-0-glyph`} > - {`**${$t(`eula.consequences_of_violation.title`)}**`} + {`**${$ls(`eula.consequences_of_violation.title`)}**`} </p> <p class={`font-mono font-[500] text-layer-0-glyph text-sm text-justify break-word`} > - {`${$t(`eula.consequences_of_violation.body`)}`} + {`${$ls(`eula.consequences_of_violation.body`)}`} </p> </div> <div @@ -1018,12 +1018,12 @@ <p class={`font-mono font-[600] text-layer-0-glyph`} > - {`**${$t(`eula.disclaimer.title`)}**`} + {`**${$ls(`eula.disclaimer.title`)}**`} </p> <p class={`font-mono font-[500] text-layer-0-glyph text-sm text-justify break-word`} > - {`${$t(`eula.disclaimer.body`)}`} + {`${$ls(`eula.disclaimer.body`)}`} </p> </div> <div @@ -1032,12 +1032,12 @@ <p class={`font-mono font-[600] text-layer-0-glyph`} > - {`**${$t(`eula.changes.title`)}**`} + {`**${$ls(`eula.changes.title`)}**`} </p> <p class={`font-mono font-[500] text-layer-0-glyph text-sm text-justify break-word`} > - {`${$t(`eula.changes.body`)}`} + {`${$ls(`eula.changes.body`)}`} </p> </div> <div @@ -1046,12 +1046,12 @@ <p class={`font-mono font-[600] text-layer-0-glyph`} > - {`**${$t(`eula.contact.title`)}**`} + {`**${$ls(`eula.contact.title`)}**`} </p> <p class={`font-mono font-[500] text-layer-0-glyph text-sm text-justify break-word`} > - {`${$t(`eula.contact.body`)}`} + {`${$ls(`eula.contact.body`)}`} </p> </div> <div @@ -1060,12 +1060,12 @@ <p class={`font-mono font-[600] text-layer-0-glyph`} > - {`**${$t(`eula.acceptance_of_terms.title`)}**`} + {`**${$ls(`eula.acceptance_of_terms.title`)}**`} </p> <p class={`font-mono font-[500] text-layer-0-glyph text-sm text-justify break-word`} > - {`${$t(`eula.acceptance_of_terms.body`)}`} + {`${$ls(`eula.acceptance_of_terms.body`)}`} </p> </div> </div> @@ -1077,8 +1077,8 @@ class={`group flex flex-row basis-1/2 gap-4 justify-center items-center`} on:click={async () => { const confirm = await dialog.confirm({ - message: `${$t(`eula.error.required`)}`, - cancel_label: `${$t(`common.quit`)}`, + message: `${$ls(`eula.error.required`)}`, + cancel_label: `${$ls(`common.quit`)}`, }); if (confirm === false) location.reload(); //@todo }} @@ -1091,7 +1091,7 @@ <p class={`font-mono font-[400] text-sm text-layer-0-glyph/60 group-active:text-layer-0-glyph transition-all`} > - {`${`${$t(`common.disagree`)}`}`} + {`${`${$ls(`common.disagree`)}`}`} </p> <p class={`font-mono font-[400] text-sm text-layer-0-glyph/60 group-active:text-layer-0-glyph transition-all`} @@ -1113,7 +1113,7 @@ <p class={`font-mono font-[400] text-sm text-layer-0-glyph-hl group-active:text-layer-0-glyph-hl/80 transition-all`} > - {`${`${$t(`common.agree`)}`}`} + {`${`${$ls(`common.agree`)}`}`} </p> <p class={`font-mono font-[400] text-sm text-layer-0-glyph-hl group-active:text-layer-0-glyph-hl/80 transition-all`} diff --git a/src/routes/+error.svelte b/src/routes/+error.svelte @@ -1,6 +1,6 @@ <script lang="ts"> import { page } from "$app/stores"; - import { Glyph, LayoutArea, Nav, t } from "@radroots/svelte-lib"; + import { Glyph, LayoutArea, Nav, ls } from "@radroots/svelte-lib"; </script> <LayoutArea> @@ -14,7 +14,7 @@ }} /> <p class={`font-sans font-[400] text-layer-0-glyph`}> - {`${$t(`error.client.page.status.${$page.status}`)}`} + {`${$ls(`error.client.page.status.${$page.status}`)}`} </p> </div> </div> @@ -22,7 +22,7 @@ <Nav basis={{ prev: { - label: `${$t(`common.home`)}`, + label: `${$ls(`common.home`)}`, route: `/`, }, }}