Skip to content

Commit 1e79737

Browse files
committed
fix: stract to i18n
1 parent cb3791f commit 1e79737

File tree

5 files changed

+198
-30
lines changed

5 files changed

+198
-30
lines changed

app/pages/pds.vue

Lines changed: 36 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ const router = useRouter()
55
const canGoBack = useCanGoBack()
66
77
useSeoMeta({
8-
title: 'npmx.social - npmx',
9-
ogTitle: 'npmx.social - npmx',
10-
twitterTitle: 'npmx.social - npmx',
11-
description: 'The official AT Protocol Personal Data Server (PDS) for the npmx community.',
12-
ogDescription: 'The official AT Protocol Personal Data Server (PDS) for the npmx community.',
13-
twitterDescription: 'The official AT Protocol Personal Data Server (PDS) for the npmx community.',
8+
title: () => `${$t('pds.title')} - npmx`,
9+
ogTitle: () => `${$t('pds.title')} - npmx`,
10+
twitterTitle: () => `${$t('pds.title')} - npmx`,
11+
description: () => $t('pds.meta_description'),
12+
ogDescription: () => $t('pds.meta_description'),
13+
twitterDescription: () => $t('pds.meta_description'),
1414
})
1515
1616
defineOgImageComponent('Default', {
@@ -42,29 +42,31 @@ const usersWithAvatars = computed(() => {
4242
<article class="max-w-2xl mx-auto">
4343
<header class="mb-12">
4444
<div class="flex items-baseline justify-between gap-4 mb-4">
45-
<h1 class="font-mono text-3xl sm:text-4xl font-medium">npmx.social</h1>
45+
<h1 class="font-mono text-3xl sm:text-4xl font-medium">
46+
{{ $t('pds.title') }}
47+
</h1>
4648
<button
4749
type="button"
4850
class="cursor-pointer inline-flex items-center gap-2 p-1.5 -mx-1.5 font-mono text-sm text-fg-muted hover:text-fg transition-colors duration-200 rounded focus-visible:outline-accent/70 shrink-0"
4951
@click="router.back()"
5052
v-if="canGoBack"
5153
>
5254
<span class="i-lucide:arrow-left rtl-flip w-4 h-4" aria-hidden="true" />
53-
<span class="hidden sm:inline">Back</span>
55+
<span class="hidden sm:inline">{{ $t('nav.back') }}</span>
5456
</button>
5557
</div>
5658
<p class="text-fg-muted text-lg">
57-
The official AT Protocol Personal Data Server (PDS) for the npmx community.
59+
{{ $t('pds.meta_description') }}
5860
</p>
5961
</header>
6062

6163
<section class="max-w-none space-y-12">
6264
<div>
63-
<h2 class="text-lg text-fg uppercase tracking-wider mb-4">Join the Community</h2>
65+
<h2 class="text-lg text-fg uppercase tracking-wider mb-4">
66+
{{ $t('pds.join.title') }}
67+
</h2>
6468
<p class="text-fg-muted leading-relaxed mb-4">
65-
Whether you are creating your first Bluesky account or migrating an existing one, you
66-
belong here. You can migrate your current account without losing your handle, your
67-
posts, or your followers.
69+
{{ $t('pds.join.description') }}
6870
</p>
6971
<div class="mt-6">
7072
<LinkBase
@@ -73,22 +75,24 @@ const usersWithAvatars = computed(() => {
7375
no-underline
7476
>
7577
<span class="i-lucide:arrow-right-left w-4 h-4 text-fg-muted" aria-hidden="true" />
76-
Migrate with PDS MOOver
78+
{{ $t('pds.join.migrate') }}
7779
</LinkBase>
7880
</div>
7981
</div>
8082

8183
<div>
82-
<h2 class="text-lg text-fg uppercase tracking-wider mb-4">Server Details</h2>
84+
<h2 class="text-lg text-fg uppercase tracking-wider mb-4">
85+
{{ $t('pds.server.title') }}
86+
</h2>
8387
<ul class="space-y-3 text-fg-muted list-none p-0">
8488
<li class="flex items-start gap-3">
8589
<span
8690
class="i-lucide:map-pin shrink-0 mt-1 w-4 h-4 text-fg-subtle"
8791
aria-hidden="true"
8892
/>
8993
<span>
90-
<strong class="text-fg">Location:</strong>
91-
Nuremberg, Germany
94+
<strong class="text-fg">{{ $t('pds.server.location_label') }}</strong>
95+
{{ $t('pds.server.location_value') }}
9296
</span>
9397
</li>
9498
<li class="flex items-start gap-3">
@@ -97,8 +101,8 @@ const usersWithAvatars = computed(() => {
97101
aria-hidden="true"
98102
/>
99103
<span>
100-
<strong class="text-fg">Infrastructure:</strong>
101-
Hosted on Hetzner
104+
<strong class="text-fg">{{ $t('pds.server.infrastructure_label') }}</strong>
105+
{{ $t('pds.server.infrastructure_value') }}
102106
</span>
103107
</li>
104108
<li class="flex items-start gap-3">
@@ -107,36 +111,39 @@ const usersWithAvatars = computed(() => {
107111
aria-hidden="true"
108112
/>
109113
<span>
110-
<strong class="text-fg">Privacy:</strong>
111-
Subject to strict EU Data Protection laws
114+
<strong class="text-fg">{{ $t('pds.server.privacy_label') }}</strong>
115+
{{ $t('pds.server.privacy_value') }}
112116
</span>
113117
</li>
114118
</ul>
115119
</div>
116120
<div aria-labelledby="community-heading">
117121
<h2 id="community-heading" class="text-lg text-fg uppercase tracking-wider mb-4">
118-
Who is here
122+
{{ $t('pds.community.title') }}
119123
</h2>
120124
<p class="text-fg-muted leading-relaxed mb-6">
121-
They are already calling npmx.social home.
125+
{{ $t('pds.community.description') }}
122126
</p>
123127

124128
<div v-if="pdsStatus === 'pending'" class="text-fg-subtle text-sm" role="status">
125-
Loading PDS community...
129+
{{ $t('pds.community.loading') }}
126130
</div>
127131
<div v-else-if="pdsStatus === 'error'" class="text-fg-subtle text-sm" role="alert">
128-
Failed to load PDS community.
132+
{{ $t('pds.community.error') }}
129133
</div>
130134
<div v-else-if="!usersWithAvatars.length" class="text-fg-subtle text-sm">
131-
No community members to display.
135+
{{ $t('pds.community.empty') }}
132136
</div>
133-
<ul v-else class="grid grid-cols-[repeat(auto-fill,48px)] gap-2 list-none p-0">
137+
<ul
138+
v-else
139+
class="grid grid-cols-[repeat(auto-fill,48px)] justify-center gap-2 list-none p-0"
140+
>
134141
<li v-for="user in usersWithAvatars" :key="user.handle" class="block group relative">
135142
<a
136143
:href="`https://bsky.app/profile/${user.handle}`"
137144
target="_blank"
138145
rel="noopener noreferrer"
139-
:aria-label="`View ${user.handle}'s profile`"
146+
:aria-label="$t('pds.community.view_profile', { handle: user.handle })"
140147
class="block rounded-lg"
141148
>
142149
<img
@@ -148,9 +155,8 @@ const usersWithAvatars = computed(() => {
148155
class="w-12 h-12 rounded-lg ring-2 ring-transparent group-hover:ring-accent transition-all duration-200 ease-out group-hover:scale-125 will-change-transform"
149156
loading="lazy"
150157
/>
151-
152158
<span
153-
class="pointer-events-none absolute -top-9 inset-is-1/2 -translate-x-1/2 whitespace-nowrap rounded-md bg-gray-900 text-white dark:bg-gray-100 dark:text-gray-900 text-xs px-2 py-1 shadow-lg opacity-0 scale-95 transition-all duration-150 group-hover:opacity-100 group-hover:scale-100 z-10"
159+
class="pointer-events-none absolute -top-9 inset-is-1/2 -translate-x-1/2 whitespace-nowrap rounded-md bg-gray-900 text-white dark:bg-gray-100 dark:text-gray-900 text-xs px-2 py-1 shadow-lg opacity-0 scale-95 transition-all duration-150 group-hover:opacity-100 group-hover:scale-100"
154160
dir="ltr"
155161
role="tooltip"
156162
>

i18n/locales/en.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,6 +1165,33 @@
11651165
"close_files_panel": "Close files panel",
11661166
"filter_files_label": "Filter files by change type"
11671167
},
1168+
"pds": {
1169+
"title": "npmx.social",
1170+
"meta_description": "The official AT Protocol Personal Data Server (PDS) for the npmx community.",
1171+
"og_description": "The official **PDS** for the npmx community.",
1172+
"join": {
1173+
"title": "Join the Community",
1174+
"description": "Whether you are creating your first Bluesky account or migrating an existing one, you belong here. You can migrate your current account without losing your handle, your posts, or your followers.",
1175+
"migrate": "Migrate with PDS MOOver"
1176+
},
1177+
"server": {
1178+
"title": "Server Details",
1179+
"location_label": "Location:",
1180+
"location_value": "Nuremberg, Germany",
1181+
"infrastructure_label": "Infrastructure:",
1182+
"infrastructure_value": "Hosted on Hetzner",
1183+
"privacy_label": "Privacy:",
1184+
"privacy_value": "Subject to strict EU Data Protection laws"
1185+
},
1186+
"community": {
1187+
"title": "Who is here",
1188+
"description": "They are already calling npmx.social home.",
1189+
"loading": "Loading PDS community...",
1190+
"error": "Failed to load PDS community.",
1191+
"empty": "No community members to display.",
1192+
"view_profile": "View {handle}'s profile"
1193+
}
1194+
},
11681195
"privacy_policy": {
11691196
"title": "privacy policy",
11701197
"last_updated": "Last updated: {date}",

i18n/schema.json

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3499,6 +3499,87 @@
34993499
},
35003500
"additionalProperties": false
35013501
},
3502+
"pds": {
3503+
"type": "object",
3504+
"properties": {
3505+
"title": {
3506+
"type": "string"
3507+
},
3508+
"meta_description": {
3509+
"type": "string"
3510+
},
3511+
"og_description": {
3512+
"type": "string"
3513+
},
3514+
"join": {
3515+
"type": "object",
3516+
"properties": {
3517+
"title": {
3518+
"type": "string"
3519+
},
3520+
"description": {
3521+
"type": "string"
3522+
},
3523+
"migrate": {
3524+
"type": "string"
3525+
}
3526+
},
3527+
"additionalProperties": false
3528+
},
3529+
"server": {
3530+
"type": "object",
3531+
"properties": {
3532+
"title": {
3533+
"type": "string"
3534+
},
3535+
"location_label": {
3536+
"type": "string"
3537+
},
3538+
"location_value": {
3539+
"type": "string"
3540+
},
3541+
"infrastructure_label": {
3542+
"type": "string"
3543+
},
3544+
"infrastructure_value": {
3545+
"type": "string"
3546+
},
3547+
"privacy_label": {
3548+
"type": "string"
3549+
},
3550+
"privacy_value": {
3551+
"type": "string"
3552+
}
3553+
},
3554+
"additionalProperties": false
3555+
},
3556+
"community": {
3557+
"type": "object",
3558+
"properties": {
3559+
"title": {
3560+
"type": "string"
3561+
},
3562+
"description": {
3563+
"type": "string"
3564+
},
3565+
"loading": {
3566+
"type": "string"
3567+
},
3568+
"error": {
3569+
"type": "string"
3570+
},
3571+
"empty": {
3572+
"type": "string"
3573+
},
3574+
"view_profile": {
3575+
"type": "string"
3576+
}
3577+
},
3578+
"additionalProperties": false
3579+
}
3580+
},
3581+
"additionalProperties": false
3582+
},
35023583
"privacy_policy": {
35033584
"type": "object",
35043585
"properties": {

lunaria/files/en-GB.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,6 +1164,33 @@
11641164
"close_files_panel": "Close files panel",
11651165
"filter_files_label": "Filter files by change type"
11661166
},
1167+
"pds": {
1168+
"title": "npmx.social",
1169+
"meta_description": "The official AT Protocol Personal Data Server (PDS) for the npmx community.",
1170+
"og_description": "The official **PDS** for the npmx community.",
1171+
"join": {
1172+
"title": "Join the Community",
1173+
"description": "Whether you are creating your first Bluesky account or migrating an existing one, you belong here. You can migrate your current account without losing your handle, your posts, or your followers.",
1174+
"migrate": "Migrate with PDS MOOver"
1175+
},
1176+
"server": {
1177+
"title": "Server Details",
1178+
"location_label": "Location:",
1179+
"location_value": "Nuremberg, Germany",
1180+
"infrastructure_label": "Infrastructure:",
1181+
"infrastructure_value": "Hosted on Hetzner",
1182+
"privacy_label": "Privacy:",
1183+
"privacy_value": "Subject to strict EU Data Protection laws"
1184+
},
1185+
"community": {
1186+
"title": "Who is here",
1187+
"description": "They are already calling npmx.social home.",
1188+
"loading": "Loading PDS community...",
1189+
"error": "Failed to load PDS community.",
1190+
"empty": "No community members to display.",
1191+
"view_profile": "View {handle}'s profile"
1192+
}
1193+
},
11671194
"privacy_policy": {
11681195
"title": "privacy policy",
11691196
"last_updated": "Last updated: {date}",

lunaria/files/en-US.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,6 +1164,33 @@
11641164
"close_files_panel": "Close files panel",
11651165
"filter_files_label": "Filter files by change type"
11661166
},
1167+
"pds": {
1168+
"title": "npmx.social",
1169+
"meta_description": "The official AT Protocol Personal Data Server (PDS) for the npmx community.",
1170+
"og_description": "The official **PDS** for the npmx community.",
1171+
"join": {
1172+
"title": "Join the Community",
1173+
"description": "Whether you are creating your first Bluesky account or migrating an existing one, you belong here. You can migrate your current account without losing your handle, your posts, or your followers.",
1174+
"migrate": "Migrate with PDS MOOver"
1175+
},
1176+
"server": {
1177+
"title": "Server Details",
1178+
"location_label": "Location:",
1179+
"location_value": "Nuremberg, Germany",
1180+
"infrastructure_label": "Infrastructure:",
1181+
"infrastructure_value": "Hosted on Hetzner",
1182+
"privacy_label": "Privacy:",
1183+
"privacy_value": "Subject to strict EU Data Protection laws"
1184+
},
1185+
"community": {
1186+
"title": "Who is here",
1187+
"description": "They are already calling npmx.social home.",
1188+
"loading": "Loading PDS community...",
1189+
"error": "Failed to load PDS community.",
1190+
"empty": "No community members to display.",
1191+
"view_profile": "View {handle}'s profile"
1192+
}
1193+
},
11671194
"privacy_policy": {
11681195
"title": "privacy policy",
11691196
"last_updated": "Last updated: {date}",

0 commit comments

Comments
 (0)