Skip to content
This repository was archived by the owner on Apr 21, 2025. It is now read-only.

Commit 713abec

Browse files
benallengfuturepaul
authored andcommitted
chore: transfer bare text to translation keys
1 parent 1b3cb09 commit 713abec

File tree

9 files changed

+50
-22
lines changed

9 files changed

+50
-22
lines changed

src/components/ChooseLanguage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function ChooseLanguage() {
2323
const [_chooseLanguageForm, { Form, Field }] =
2424
createForm<ChooseLanguageForm>({
2525
initialValues: {
26-
selectedLanguage: state.lang ?? ""
26+
selectedLanguage: state.lang ?? i18n.language
2727
},
2828
validate: (values) => {
2929
const errors: Record<string, string> = {};

src/components/ContactEditor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export function ContactEditor(props: {
6868
previous: location.pathname
6969
}}
7070
>
71-
Import Nostr Contacts
71+
{i18n.t("contacts.link_to_nostr_sync")}
7272
</A>
7373
</SimpleDialog>
7474
</>

src/components/ContactViewer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,15 @@ export function ContactViewer(props: {
115115
intent="red"
116116
onClick={() => setConfirmOpen(true)}
117117
>
118-
Delete
118+
{i18n.t("contacts.delete")}
119119
</Button>
120120
<ConfirmDialog
121121
open={confirmOpen()}
122122
loading={false}
123123
onConfirm={handleDelete}
124124
onCancel={() => setConfirmOpen(false)}
125125
>
126-
Are you sure you want to delete this contact?
126+
{i18n.t("contacts.confirm_delete")}
127127
</ConfirmDialog>
128128
</Match>
129129
<Match when={!isEditing()}>

src/components/MutinyPlusCta.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ export function MutinyPlusCta() {
2929
>
3030
<div class="flex justify-between">
3131
<span>
32-
Mutiny<span class="text-m-red">+</span>
32+
{i18n.t("common.mutiny")}
33+
<span class="text-m-red">+</span>
3334
</span>
3435
<img src={forward} alt="go" />
3536
</div>

src/i18n/en/translations.ts

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
export default {
22
common: {
33
title: "Mutiny Wallet",
4+
mutiny: "Mutiny",
45
nice: "Nice",
56
home: "Home",
67
e_sats: "eSATS",
@@ -33,6 +34,8 @@ export default {
3334
create_contact: "Create contact",
3435
edit_contact: "Edit contact",
3536
save_contact: "Save contact",
37+
delete: "Delete",
38+
confirm_delete: "Are you sure you want to delete this contact?",
3639
payment_history: "Payment history",
3740
no_payments: "No payments yet with",
3841
edit: "Edit",
@@ -47,7 +50,8 @@ export default {
4750
email_error: "That doesn't look like a lightning address",
4851
npub_error: "That doesn't look like a nostr npub",
4952
error_ln_address_missing: "New contacts need a lightning address",
50-
npub: "Nostr Npub"
53+
npub: "Nostr Npub",
54+
link_to_nostr_sync: "Import Nostr Contacts"
5155
},
5256
receive: {
5357
receive_bitcoin: "Receive Bitcoin",
@@ -112,6 +116,13 @@ export default {
112116
what_for: "What's this for?"
113117
},
114118
send: {
119+
search: {
120+
placeholder: "Name, address, invoice",
121+
paste: "Paste",
122+
contacts: "Contacts",
123+
global_search: "Global search",
124+
no_results: "No results found for"
125+
},
115126
sending: "Sending...",
116127
confirm_send: "Confirm Send",
117128
contact_placeholder: "Add the receiver for your records",
@@ -394,6 +405,8 @@ export default {
394405
}
395406
},
396407
encrypt: {
408+
title: "Change Password",
409+
caption: "Backup first to unlock encryption",
397410
header: "Encrypt your seed words",
398411
hot_wallet_warning:
399412
'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 {
530543
save: "Save"
531544
},
532545
nostr_contacts: {
533-
title: "Nostr Contacts",
546+
title: "Sync Nostr Contacts",
534547
npub_label: "Nostr npub",
535548
npub_required: "Npub can't be blank",
536-
sync: "Sync"
549+
sync: "Sync",
550+
resync: "Resync",
551+
remove: "Remove"
537552
},
538553
manage_federations: {
539554
title: "Manage Federations",

src/routes/Search.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ function ActualSearch() {
261261
type="text"
262262
value={searchValue()}
263263
onInput={(e) => setSearchValue(e.currentTarget.value)}
264-
placeholder="Name, address, invoice..."
264+
placeholder={i18n.t("send.search.placeholder")}
265265
autofocus
266266
ref={(el) => (searchInputRef = el)}
267267
/>
@@ -271,7 +271,7 @@ function ActualSearch() {
271271
onClick={handlePaste}
272272
>
273273
<img src={paste} alt="Paste" class="h-4 w-4" />
274-
Paste
274+
{i18n.t("send.search.paste")}
275275
</button>
276276
</Show>
277277
<Show when={!!searchValue()}>
@@ -285,14 +285,16 @@ function ActualSearch() {
285285
</div>
286286
<Show when={searchState() !== "notsendable"}>
287287
<Button intent="green" onClick={handleContinue}>
288-
Continue
288+
{i18n.t("common.continue")}
289289
</Button>
290290
</Show>
291291
<Show when={searchState() !== "sendable"}>
292292
<div class="relative flex h-full max-h-[100svh] flex-col gap-3 overflow-y-scroll">
293293
<Suspense>
294294
<div class="sticky top-0 z-50 bg-m-grey-900/90 py-2 backdrop-blur-sm">
295-
<h2 class="text-xl font-semibold">Contacts</h2>
295+
<h2 class="text-xl font-semibold">
296+
{i18n.t("send.search.contacts")}
297+
</h2>
296298
</div>
297299
<Show
298300
when={
@@ -314,7 +316,7 @@ function ActualSearch() {
314316
<Suspense fallback={<LoadingShimmer />}>
315317
<Show when={!!debouncedSearchValue()}>
316318
<h2 class="py-2 text-xl font-semibold">
317-
Global Search
319+
{i18n.t("send.search.global_search")}
318320
</h2>
319321
<GlobalSearch
320322
searchValue={debouncedSearchValue()}
@@ -335,6 +337,7 @@ function GlobalSearch(props: {
335337
sendToContact: (contact: TagItem) => void;
336338
foundNpubs: (string | undefined)[];
337339
}) {
340+
const i18n = useI18n();
338341
const hexpubs = createMemo(() => {
339342
const hexpubs: Set<string> = new Set();
340343
for (const npub of props.foundNpubs) {
@@ -403,7 +406,7 @@ function GlobalSearch(props: {
403406
}
404407
>
405408
<p class="text-neutral-500">
406-
No results found for "{props.searchValue}"
409+
{i18n.t("send.search.no_results") + " " + props.searchValue}
407410
</p>
408411
</Match>
409412
<Match when={true}>

src/routes/settings/Root.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,10 @@ export function Settings() {
107107
},
108108
{
109109
href: "/settings/encrypt",
110-
text: "Change Password",
110+
text: i18n.t("settings.encrypt.title"),
111111
disabled: !state.has_backed_up,
112112
caption: !state.has_backed_up
113-
? "Backup first to unlock encryption"
113+
? i18n.t("settings.encrypt.caption")
114114
: undefined
115115
},
116116
{
@@ -155,11 +155,13 @@ export function Settings() {
155155
},
156156
{
157157
href: "/settings/syncnostrcontacts",
158-
text: "Sync Nostr Contacts"
158+
text: i18n.t("settings.nostr_contacts.title")
159159
},
160160
{
161161
href: "/settings/federations",
162-
text: "Manage Federations"
162+
text: i18n.t(
163+
"settings.manage_federations.title"
164+
)
163165
}
164166
]}
165167
/>

src/routes/settings/SyncNostrContacts.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ function SyncContactsForm() {
9090
}
9191

9292
export function SyncNostrContacts() {
93+
const i18n = useI18n();
9394
const [state, actions] = useMegaStore();
9495
const [loading, setLoading] = createSignal(false);
9596
const [error, setError] = createSignal<Error>();
@@ -114,7 +115,9 @@ export function SyncNostrContacts() {
114115
<SafeArea>
115116
<DefaultMain>
116117
<BackPop />
117-
<LargeHeader>Sync Nostr Contacts</LargeHeader>
118+
<LargeHeader>
119+
{i18n.t("settings.nostr_contacts.title")}
120+
</LargeHeader>
118121
<Switch>
119122
<Match when={state.npub}>
120123
<VStack>
@@ -135,13 +138,17 @@ export function SyncNostrContacts() {
135138
onClick={resync}
136139
loading={loading()}
137140
>
138-
Resync
141+
{i18n.t(
142+
"settings.nostr_contacts.resync"
143+
)}
139144
</Button>
140145
<Button
141146
intent="red"
142147
onClick={clearNpub}
143148
>
144-
Remove
149+
{i18n.t(
150+
"settings.nostr_contacts.remove"
151+
)}
145152
</Button>
146153
</VStack>
147154
</FancyCard>

src/utils/languages.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const LANGUAGE_OPTIONS: Language[] = [
1414
shortName: "pt"
1515
},
1616
{
17-
value: "Korean",
17+
value: "한국어",
1818
shortName: "ko"
1919
}
2020
];

0 commit comments

Comments
 (0)