chore: transfer bare text to translation keys

This commit is contained in:
benalleng
2024-02-12 20:57:48 -05:00
committed by Paul Miller
parent 1b3cb09c65
commit 713abecfe0
9 changed files with 50 additions and 22 deletions

View File

@@ -23,7 +23,7 @@ export function ChooseLanguage() {
const [_chooseLanguageForm, { Form, Field }] = const [_chooseLanguageForm, { Form, Field }] =
createForm<ChooseLanguageForm>({ createForm<ChooseLanguageForm>({
initialValues: { initialValues: {
selectedLanguage: state.lang ?? "" selectedLanguage: state.lang ?? i18n.language
}, },
validate: (values) => { validate: (values) => {
const errors: Record<string, string> = {}; const errors: Record<string, string> = {};

View File

@@ -68,7 +68,7 @@ export function ContactEditor(props: {
previous: location.pathname previous: location.pathname
}} }}
> >
Import Nostr Contacts {i18n.t("contacts.link_to_nostr_sync")}
</A> </A>
</SimpleDialog> </SimpleDialog>
</> </>

View File

@@ -115,7 +115,7 @@ export function ContactViewer(props: {
intent="red" intent="red"
onClick={() => setConfirmOpen(true)} onClick={() => setConfirmOpen(true)}
> >
Delete {i18n.t("contacts.delete")}
</Button> </Button>
<ConfirmDialog <ConfirmDialog
open={confirmOpen()} open={confirmOpen()}
@@ -123,7 +123,7 @@ export function ContactViewer(props: {
onConfirm={handleDelete} onConfirm={handleDelete}
onCancel={() => setConfirmOpen(false)} onCancel={() => setConfirmOpen(false)}
> >
Are you sure you want to delete this contact? {i18n.t("contacts.confirm_delete")}
</ConfirmDialog> </ConfirmDialog>
</Match> </Match>
<Match when={!isEditing()}> <Match when={!isEditing()}>

View File

@@ -29,7 +29,8 @@ export function MutinyPlusCta() {
> >
<div class="flex justify-between"> <div class="flex justify-between">
<span> <span>
Mutiny<span class="text-m-red">+</span> {i18n.t("common.mutiny")}
<span class="text-m-red">+</span>
</span> </span>
<img src={forward} alt="go" /> <img src={forward} alt="go" />
</div> </div>

View File

@@ -1,6 +1,7 @@
export default { export default {
common: { common: {
title: "Mutiny Wallet", title: "Mutiny Wallet",
mutiny: "Mutiny",
nice: "Nice", nice: "Nice",
home: "Home", home: "Home",
e_sats: "eSATS", e_sats: "eSATS",
@@ -33,6 +34,8 @@ export default {
create_contact: "Create contact", create_contact: "Create contact",
edit_contact: "Edit contact", edit_contact: "Edit contact",
save_contact: "Save contact", save_contact: "Save contact",
delete: "Delete",
confirm_delete: "Are you sure you want to delete this contact?",
payment_history: "Payment history", payment_history: "Payment history",
no_payments: "No payments yet with", no_payments: "No payments yet with",
edit: "Edit", edit: "Edit",
@@ -47,7 +50,8 @@ export default {
email_error: "That doesn't look like a lightning address", email_error: "That doesn't look like a lightning address",
npub_error: "That doesn't look like a nostr npub", npub_error: "That doesn't look like a nostr npub",
error_ln_address_missing: "New contacts need a lightning address", error_ln_address_missing: "New contacts need a lightning address",
npub: "Nostr Npub" npub: "Nostr Npub",
link_to_nostr_sync: "Import Nostr Contacts"
}, },
receive: { receive: {
receive_bitcoin: "Receive Bitcoin", receive_bitcoin: "Receive Bitcoin",
@@ -112,6 +116,13 @@ export default {
what_for: "What's this for?" what_for: "What's this for?"
}, },
send: { send: {
search: {
placeholder: "Name, address, invoice",
paste: "Paste",
contacts: "Contacts",
global_search: "Global search",
no_results: "No results found for"
},
sending: "Sending...", sending: "Sending...",
confirm_send: "Confirm Send", confirm_send: "Confirm Send",
contact_placeholder: "Add the receiver for your records", contact_placeholder: "Add the receiver for your records",
@@ -394,6 +405,8 @@ export default {
} }
}, },
encrypt: { encrypt: {
title: "Change Password",
caption: "Backup first to unlock encryption",
header: "Encrypt your seed words", header: "Encrypt your seed words",
hot_wallet_warning: hot_wallet_warning:
'Mutiny is a "hot wallet" so it needs your seed word to operate, but you can optionally encrypt those words with a password.', 'Mutiny is a "hot wallet" so it needs your seed word to operate, but you can optionally encrypt those words with a password.',
@@ -530,10 +543,12 @@ export default {
save: "Save" save: "Save"
}, },
nostr_contacts: { nostr_contacts: {
title: "Nostr Contacts", title: "Sync Nostr Contacts",
npub_label: "Nostr npub", npub_label: "Nostr npub",
npub_required: "Npub can't be blank", npub_required: "Npub can't be blank",
sync: "Sync" sync: "Sync",
resync: "Resync",
remove: "Remove"
}, },
manage_federations: { manage_federations: {
title: "Manage Federations", title: "Manage Federations",

View File

@@ -261,7 +261,7 @@ function ActualSearch() {
type="text" type="text"
value={searchValue()} value={searchValue()}
onInput={(e) => setSearchValue(e.currentTarget.value)} onInput={(e) => setSearchValue(e.currentTarget.value)}
placeholder="Name, address, invoice..." placeholder={i18n.t("send.search.placeholder")}
autofocus autofocus
ref={(el) => (searchInputRef = el)} ref={(el) => (searchInputRef = el)}
/> />
@@ -271,7 +271,7 @@ function ActualSearch() {
onClick={handlePaste} onClick={handlePaste}
> >
<img src={paste} alt="Paste" class="h-4 w-4" /> <img src={paste} alt="Paste" class="h-4 w-4" />
Paste {i18n.t("send.search.paste")}
</button> </button>
</Show> </Show>
<Show when={!!searchValue()}> <Show when={!!searchValue()}>
@@ -285,14 +285,16 @@ function ActualSearch() {
</div> </div>
<Show when={searchState() !== "notsendable"}> <Show when={searchState() !== "notsendable"}>
<Button intent="green" onClick={handleContinue}> <Button intent="green" onClick={handleContinue}>
Continue {i18n.t("common.continue")}
</Button> </Button>
</Show> </Show>
<Show when={searchState() !== "sendable"}> <Show when={searchState() !== "sendable"}>
<div class="relative flex h-full max-h-[100svh] flex-col gap-3 overflow-y-scroll"> <div class="relative flex h-full max-h-[100svh] flex-col gap-3 overflow-y-scroll">
<Suspense> <Suspense>
<div class="sticky top-0 z-50 bg-m-grey-900/90 py-2 backdrop-blur-sm"> <div class="sticky top-0 z-50 bg-m-grey-900/90 py-2 backdrop-blur-sm">
<h2 class="text-xl font-semibold">Contacts</h2> <h2 class="text-xl font-semibold">
{i18n.t("send.search.contacts")}
</h2>
</div> </div>
<Show <Show
when={ when={
@@ -314,7 +316,7 @@ function ActualSearch() {
<Suspense fallback={<LoadingShimmer />}> <Suspense fallback={<LoadingShimmer />}>
<Show when={!!debouncedSearchValue()}> <Show when={!!debouncedSearchValue()}>
<h2 class="py-2 text-xl font-semibold"> <h2 class="py-2 text-xl font-semibold">
Global Search {i18n.t("send.search.global_search")}
</h2> </h2>
<GlobalSearch <GlobalSearch
searchValue={debouncedSearchValue()} searchValue={debouncedSearchValue()}
@@ -335,6 +337,7 @@ function GlobalSearch(props: {
sendToContact: (contact: TagItem) => void; sendToContact: (contact: TagItem) => void;
foundNpubs: (string | undefined)[]; foundNpubs: (string | undefined)[];
}) { }) {
const i18n = useI18n();
const hexpubs = createMemo(() => { const hexpubs = createMemo(() => {
const hexpubs: Set<string> = new Set(); const hexpubs: Set<string> = new Set();
for (const npub of props.foundNpubs) { for (const npub of props.foundNpubs) {
@@ -403,7 +406,7 @@ function GlobalSearch(props: {
} }
> >
<p class="text-neutral-500"> <p class="text-neutral-500">
No results found for "{props.searchValue}" {i18n.t("send.search.no_results") + " " + props.searchValue}
</p> </p>
</Match> </Match>
<Match when={true}> <Match when={true}>

View File

@@ -107,10 +107,10 @@ export function Settings() {
}, },
{ {
href: "/settings/encrypt", href: "/settings/encrypt",
text: "Change Password", text: i18n.t("settings.encrypt.title"),
disabled: !state.has_backed_up, disabled: !state.has_backed_up,
caption: !state.has_backed_up caption: !state.has_backed_up
? "Backup first to unlock encryption" ? i18n.t("settings.encrypt.caption")
: undefined : undefined
}, },
{ {
@@ -155,11 +155,13 @@ export function Settings() {
}, },
{ {
href: "/settings/syncnostrcontacts", href: "/settings/syncnostrcontacts",
text: "Sync Nostr Contacts" text: i18n.t("settings.nostr_contacts.title")
}, },
{ {
href: "/settings/federations", href: "/settings/federations",
text: "Manage Federations" text: i18n.t(
"settings.manage_federations.title"
)
} }
]} ]}
/> />

View File

@@ -90,6 +90,7 @@ function SyncContactsForm() {
} }
export function SyncNostrContacts() { export function SyncNostrContacts() {
const i18n = useI18n();
const [state, actions] = useMegaStore(); const [state, actions] = useMegaStore();
const [loading, setLoading] = createSignal(false); const [loading, setLoading] = createSignal(false);
const [error, setError] = createSignal<Error>(); const [error, setError] = createSignal<Error>();
@@ -114,7 +115,9 @@ export function SyncNostrContacts() {
<SafeArea> <SafeArea>
<DefaultMain> <DefaultMain>
<BackPop /> <BackPop />
<LargeHeader>Sync Nostr Contacts</LargeHeader> <LargeHeader>
{i18n.t("settings.nostr_contacts.title")}
</LargeHeader>
<Switch> <Switch>
<Match when={state.npub}> <Match when={state.npub}>
<VStack> <VStack>
@@ -135,13 +138,17 @@ export function SyncNostrContacts() {
onClick={resync} onClick={resync}
loading={loading()} loading={loading()}
> >
Resync {i18n.t(
"settings.nostr_contacts.resync"
)}
</Button> </Button>
<Button <Button
intent="red" intent="red"
onClick={clearNpub} onClick={clearNpub}
> >
Remove {i18n.t(
"settings.nostr_contacts.remove"
)}
</Button> </Button>
</VStack> </VStack>
</FancyCard> </FancyCard>

View File

@@ -14,7 +14,7 @@ export const LANGUAGE_OPTIONS: Language[] = [
shortName: "pt" shortName: "pt"
}, },
{ {
value: "Korean", value: "한국어",
shortName: "ko" shortName: "ko"
} }
]; ];