Skip to content

Commit 9582127

Browse files
committed
reorganize modal i18n keys
1 parent 208f466 commit 9582127

6 files changed

Lines changed: 119 additions & 107 deletions

File tree

app/components/Header/AtprotoModal.client.vue

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ async function handleLogin() {
3737
locale: locale.value,
3838
})
3939
} else {
40-
errorMessage.value = $t('auth.modal.default_input_error')
40+
errorMessage.value = $t('auth.modal.atmosphere.default_input_error')
4141
}
4242
}
4343
}
@@ -64,13 +64,13 @@ watch(user, async newUser => {
6464

6565
<template>
6666
<!-- Modal -->
67-
<Modal :modalTitle="$t('auth.modal.title')" class="max-w-lg" id="atproto-modal">
67+
<Modal :modalTitle="$t('auth.modal.atmosphere.title')" class="max-w-lg" id="atproto-modal">
6868
<div v-if="user?.handle" class="space-y-4">
6969
<div class="flex items-center gap-3 p-4 bg-bg-subtle border border-border rounded-lg">
7070
<span class="w-3 h-3 rounded-full bg-green-500" aria-hidden="true" />
7171
<div>
7272
<p class="font-mono text-xs text-fg-muted">
73-
{{ $t('auth.modal.connected_as', { handle: user.handle }) }}
73+
{{ $t('auth.modal.atmosphere.connected_as', { handle: user.handle }) }}
7474
</p>
7575
</div>
7676
</div>
@@ -94,22 +94,22 @@ watch(user, async newUser => {
9494

9595
<!-- Disconnected state -->
9696
<form v-else class="space-y-4" @submit.prevent="handleLogin">
97-
<p class="text-sm text-fg-muted">{{ $t('auth.modal.connect_prompt') }}</p>
97+
<p class="text-sm text-fg-muted">{{ $t('auth.modal.atmosphere.connect_prompt') }}</p>
9898

9999
<div class="space-y-3">
100100
<div>
101101
<label
102102
for="handle-input"
103103
class="block text-xs text-fg-subtle uppercase tracking-wider mb-1.5"
104104
>
105-
{{ $t('auth.modal.handle_label') }}
105+
{{ $t('auth.modal.atmosphere.handle_label') }}
106106
</label>
107107
<InputBase
108108
id="handle-input"
109109
v-model="handleInput"
110110
type="text"
111111
name="handle"
112-
:placeholder="$t('auth.modal.handle_placeholder')"
112+
:placeholder="$t('auth.modal.atmosphere.handle_placeholder')"
113113
no-correct
114114
class="w-full"
115115
size="medium"
@@ -123,10 +123,10 @@ watch(user, async newUser => {
123123
<summary
124124
class="text-fg-subtle hover:text-fg-muted transition-colors duration-200 focus-visible:(outline-2 outline-accent/70)"
125125
>
126-
{{ $t('auth.modal.what_is_atmosphere') }}
126+
{{ $t('auth.modal.atmosphere.what_is_atmosphere') }}
127127
</summary>
128128
<div class="mt-3">
129-
<i18n-t keypath="auth.modal.atmosphere_explanation" tag="p" scope="global">
129+
<i18n-t keypath="auth.modal.atmosphere.explanation" tag="p" scope="global">
130130
<template #npmx>
131131
<span class="font-bold">npmx.dev</span>
132132
</template>
@@ -148,7 +148,7 @@ watch(user, async newUser => {
148148
{{ $t('auth.modal.connect') }}
149149
</ButtonBase>
150150
<ButtonBase type="button" class="w-full" @click="handleCreateAccount">
151-
{{ $t('auth.modal.create_account') }}
151+
{{ $t('auth.modal.atmosphere.create_account') }}
152152
</ButtonBase>
153153
<hr class="color-border" />
154154
<ButtonBase
@@ -157,7 +157,7 @@ watch(user, async newUser => {
157157
@click="handleBlueskySignIn"
158158
classicon="i-simple-icons:bluesky"
159159
>
160-
{{ $t('auth.modal.connect_bluesky') }}
160+
{{ $t('auth.modal.atmosphere.connect_bluesky') }}
161161
</ButtonBase>
162162
</form>
163163
</Modal>

app/components/Header/GitHubModal.client.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ function handleConnect() {
88
</script>
99

1010
<template>
11-
<Modal :modalTitle="$t('auth.github.title')" class="max-w-lg" id="github-modal">
11+
<Modal :modalTitle="$t('auth.modal.github.title')" class="max-w-lg" id="github-modal">
1212
<!-- Connected state -->
1313
<div v-if="isConnected && user" class="space-y-4">
1414
<div class="flex items-center gap-3 p-4 bg-bg-subtle border border-border rounded-lg">
1515
<span class="w-3 h-3 rounded-full bg-green-500" aria-hidden="true" />
1616
<div>
1717
<p class="font-mono text-xs text-fg-muted">
18-
{{ $t('auth.github.connected_as', { username: user.username }) }}
18+
{{ $t('auth.modal.github.connected_as', { username: user.username }) }}
1919
</p>
2020
</div>
2121
</div>
@@ -26,7 +26,7 @@ function handleConnect() {
2626

2727
<!-- Disconnected state -->
2828
<div v-else class="space-y-4">
29-
<p class="text-sm text-fg-muted">{{ $t('auth.github.connect_prompt') }}</p>
29+
<p class="text-sm text-fg-muted">{{ $t('auth.modal.github.connect_prompt') }}</p>
3030
<ButtonBase
3131
variant="primary"
3232
class="w-full"

i18n/locales/en.json

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -995,24 +995,26 @@
995995
},
996996
"auth": {
997997
"modal": {
998-
"title": "Atmosphere",
999-
"connected_as": "Connected as {'@'}{handle}",
1000-
"disconnect": "Disconnect",
1001-
"connect_prompt": "Connect with your Atmosphere account",
1002-
"handle_label": "Handle",
1003-
"handle_placeholder": "alice.npmx.social",
998+
"profile": "Profile",
1004999
"connect": "Connect",
1005-
"create_account": "Create a new account",
1006-
"connect_bluesky": "Connect with Bluesky",
1007-
"what_is_atmosphere": "What is an Atmosphere account?",
1008-
"atmosphere_explanation": "{npmx} uses the {atproto} to power many of its social features, allowing users to own their data and use one account for all compatible applications. Once you create an account, you can use other apps like {bluesky} and {tangled} with the same account.",
1009-
"default_input_error": "Please enter a valid handle, DID, or a full PDS URL",
1010-
"profile": "Profile"
1011-
},
1012-
"github": {
1013-
"title": "GitHub",
1014-
"connected_as": "Connected as {username}",
1015-
"connect_prompt": "Connect your GitHub account to star repositories directly from npmx."
1000+
"disconnect": "Disconnect",
1001+
"atmosphere": {
1002+
"title": "Atmosphere",
1003+
"connected_as": "Connected as {'@'}{handle}",
1004+
"connect_prompt": "Connect with your Atmosphere account",
1005+
"handle_label": "Handle",
1006+
"handle_placeholder": "alice.npmx.social",
1007+
"create_account": "Create a new account",
1008+
"connect_bluesky": "Connect with Bluesky",
1009+
"what_is_atmosphere": "What is an Atmosphere account?",
1010+
"explanation": "{npmx} uses the {atproto} to power many of its social features, allowing users to own their data and use one account for all compatible applications. Once you create an account, you can use other apps like {bluesky} and {tangled} with the same account.",
1011+
"default_input_error": "Please enter a valid handle, DID, or a full PDS URL"
1012+
},
1013+
"github": {
1014+
"title": "GitHub",
1015+
"connected_as": "Connected as {username}",
1016+
"connect_prompt": "Connect your GitHub account to star repositories directly from npmx."
1017+
}
10161018
}
10171019
},
10181020
"header": {

i18n/schema.json

Lines changed: 51 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2989,59 +2989,65 @@
29892989
"modal": {
29902990
"type": "object",
29912991
"properties": {
2992-
"title": {
2993-
"type": "string"
2994-
},
2995-
"connected_as": {
2996-
"type": "string"
2997-
},
2998-
"disconnect": {
2999-
"type": "string"
3000-
},
3001-
"connect_prompt": {
3002-
"type": "string"
3003-
},
3004-
"handle_label": {
3005-
"type": "string"
3006-
},
3007-
"handle_placeholder": {
2992+
"profile": {
30082993
"type": "string"
30092994
},
30102995
"connect": {
30112996
"type": "string"
30122997
},
3013-
"create_account": {
3014-
"type": "string"
3015-
},
3016-
"connect_bluesky": {
3017-
"type": "string"
3018-
},
3019-
"what_is_atmosphere": {
3020-
"type": "string"
3021-
},
3022-
"atmosphere_explanation": {
3023-
"type": "string"
3024-
},
3025-
"default_input_error": {
3026-
"type": "string"
3027-
},
3028-
"profile": {
3029-
"type": "string"
3030-
}
3031-
},
3032-
"additionalProperties": false
3033-
},
3034-
"github": {
3035-
"type": "object",
3036-
"properties": {
3037-
"title": {
2998+
"disconnect": {
30382999
"type": "string"
30393000
},
3040-
"connected_as": {
3041-
"type": "string"
3001+
"atmosphere": {
3002+
"type": "object",
3003+
"properties": {
3004+
"title": {
3005+
"type": "string"
3006+
},
3007+
"connected_as": {
3008+
"type": "string"
3009+
},
3010+
"connect_prompt": {
3011+
"type": "string"
3012+
},
3013+
"handle_label": {
3014+
"type": "string"
3015+
},
3016+
"handle_placeholder": {
3017+
"type": "string"
3018+
},
3019+
"create_account": {
3020+
"type": "string"
3021+
},
3022+
"connect_bluesky": {
3023+
"type": "string"
3024+
},
3025+
"what_is_atmosphere": {
3026+
"type": "string"
3027+
},
3028+
"explanation": {
3029+
"type": "string"
3030+
},
3031+
"default_input_error": {
3032+
"type": "string"
3033+
}
3034+
},
3035+
"additionalProperties": false
30423036
},
3043-
"connect_prompt": {
3044-
"type": "string"
3037+
"github": {
3038+
"type": "object",
3039+
"properties": {
3040+
"title": {
3041+
"type": "string"
3042+
},
3043+
"connected_as": {
3044+
"type": "string"
3045+
},
3046+
"connect_prompt": {
3047+
"type": "string"
3048+
}
3049+
},
3050+
"additionalProperties": false
30453051
}
30463052
},
30473053
"additionalProperties": false

lunaria/files/en-GB.json

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -928,23 +928,25 @@
928928
},
929929
"auth": {
930930
"modal": {
931-
"title": "Atmosphere",
932-
"connected_as": "Connected as {'@'}{handle}",
933-
"disconnect": "Disconnect",
934-
"connect_prompt": "Connect with your Atmosphere account",
935-
"handle_label": "Handle",
936-
"handle_placeholder": "alice.npmx.social",
937931
"connect": "Connect",
938-
"create_account": "Create a new account",
939-
"connect_bluesky": "Connect with Bluesky",
940-
"what_is_atmosphere": "What is an Atmosphere account?",
941-
"atmosphere_explanation": "{npmx} uses the {atproto} to power many of its social features, allowing users to own their data and use one account for all compatible applications. Once you create an account, you can use other apps like {bluesky} and {tangled} with the same account.",
942-
"default_input_error": "Please enter a valid handle, DID, or a full PDS URL"
943-
},
944-
"github": {
945-
"title": "GitHub",
946-
"connected_as": "Connected as {username}",
947-
"connect_prompt": "Connect your GitHub account to star repositories directly from npmx."
932+
"disconnect": "Disconnect",
933+
"atmosphere": {
934+
"title": "Atmosphere",
935+
"connected_as": "Connected as {'@'}{handle}",
936+
"connect_prompt": "Connect with your Atmosphere account",
937+
"handle_label": "Handle",
938+
"handle_placeholder": "alice.npmx.social",
939+
"create_account": "Create a new account",
940+
"connect_bluesky": "Connect with Bluesky",
941+
"what_is_atmosphere": "What is an Atmosphere account?",
942+
"explanation": "{npmx} uses the {atproto} to power many of its social features, allowing users to own their data and use one account for all compatible applications. Once you create an account, you can use other apps like {bluesky} and {tangled} with the same account.",
943+
"default_input_error": "Please enter a valid handle, DID, or a full PDS URL"
944+
},
945+
"github": {
946+
"title": "GitHub",
947+
"connected_as": "Connected as {username}",
948+
"connect_prompt": "Connect your GitHub account to star repositories directly from npmx."
949+
}
948950
}
949951
},
950952
"header": {

lunaria/files/en-US.json

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -928,23 +928,25 @@
928928
},
929929
"auth": {
930930
"modal": {
931-
"title": "Atmosphere",
932-
"connected_as": "Connected as {'@'}{handle}",
933-
"disconnect": "Disconnect",
934-
"connect_prompt": "Connect with your Atmosphere account",
935-
"handle_label": "Handle",
936-
"handle_placeholder": "alice.npmx.social",
937931
"connect": "Connect",
938-
"create_account": "Create a new account",
939-
"connect_bluesky": "Connect with Bluesky",
940-
"what_is_atmosphere": "What is an Atmosphere account?",
941-
"atmosphere_explanation": "{npmx} uses the {atproto} to power many of its social features, allowing users to own their data and use one account for all compatible applications. Once you create an account, you can use other apps like {bluesky} and {tangled} with the same account.",
942-
"default_input_error": "Please enter a valid handle, DID, or a full PDS URL"
943-
},
944-
"github": {
945-
"title": "GitHub",
946-
"connected_as": "Connected as {username}",
947-
"connect_prompt": "Connect your GitHub account to star repositories directly from npmx."
932+
"disconnect": "Disconnect",
933+
"atmosphere": {
934+
"title": "Atmosphere",
935+
"connected_as": "Connected as {'@'}{handle}",
936+
"connect_prompt": "Connect with your Atmosphere account",
937+
"handle_label": "Handle",
938+
"handle_placeholder": "alice.npmx.social",
939+
"create_account": "Create a new account",
940+
"connect_bluesky": "Connect with Bluesky",
941+
"what_is_atmosphere": "What is an Atmosphere account?",
942+
"explanation": "{npmx} uses the {atproto} to power many of its social features, allowing users to own their data and use one account for all compatible applications. Once you create an account, you can use other apps like {bluesky} and {tangled} with the same account.",
943+
"default_input_error": "Please enter a valid handle, DID, or a full PDS URL"
944+
},
945+
"github": {
946+
"title": "GitHub",
947+
"connected_as": "Connected as {username}",
948+
"connect_prompt": "Connect your GitHub account to star repositories directly from npmx."
949+
}
948950
}
949951
},
950952
"header": {

0 commit comments

Comments
 (0)