Skip to content

Commit

Permalink
chore: transfer bare text to translation keys
Browse files Browse the repository at this point in the history
  • Loading branch information
benalleng committed Feb 13, 2024
1 parent 075c066 commit b147433
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/components/ChooseLanguage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function ChooseLanguage() {
const [_chooseLanguageForm, { Form, Field }] =
createForm<ChooseLanguageForm>({
initialValues: {
selectedLanguage: state.lang ?? ""
selectedLanguage: state.lang ?? i18n.language
},
validate: (values) => {
const errors: Record<string, string> = {};
Expand Down
3 changes: 2 additions & 1 deletion src/components/MutinyPlusCta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ export function MutinyPlusCta() {
>
<div class="flex justify-between">
<span>
Mutiny<span class="text-m-red">+</span>
{i18n.t("common.mutiny")}
<span class="text-m-red">+</span>
</span>
<img src={forward} alt="go" />
</div>
Expand Down
9 changes: 7 additions & 2 deletions src/i18n/en/translations.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export default {
common: {
title: "Mutiny Wallet",
mutiny: "Mutiny",
nice: "Nice",
home: "Home",
e_sats: "eSATS",
Expand Down Expand Up @@ -394,6 +395,8 @@ export default {
}
},
encrypt: {
title: "Change Password",
caption: "Backup first to unlock encryption",
header: "Encrypt your seed words",
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.',
Expand Down Expand Up @@ -530,10 +533,12 @@ export default {
save: "Save"
},
nostr_contacts: {
title: "Nostr Contacts",
title: "Sync Nostr Contacts",
npub_label: "Nostr npub",
npub_required: "Npub can't be blank",
sync: "Sync"
sync: "Sync",
resync: "Resync",
remove: "Remove"
},
manage_federations: {
title: "Manage Federations",
Expand Down
10 changes: 6 additions & 4 deletions src/routes/settings/Root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ export function Settings() {
},
{
href: "/settings/encrypt",
text: "Change Password",
text: i18n.t("settings.encrypt.title"),
disabled: !state.has_backed_up,
caption: !state.has_backed_up
? "Backup first to unlock encryption"
? i18n.t("settings.encrypt.caption")
: undefined
},
{
Expand Down Expand Up @@ -155,11 +155,13 @@ export function Settings() {
},
{
href: "/settings/syncnostrcontacts",
text: "Sync Nostr Contacts"
text: i18n.t("settings.nostr_contacts.title")
},
{
href: "/settings/federations",
text: "Manage Federations"
text: i18n.t(
"settings.manage_federations.title"
)
}
]}
/>
Expand Down
13 changes: 10 additions & 3 deletions src/routes/settings/SyncNostrContacts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ function SyncContactsForm() {
}

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

0 comments on commit b147433

Please sign in to comment.