fix(frontend): localize stray hardcoded UI strings

Move the last few user-visible hardcoded strings into vue-i18n:

- AppHeader: "Toggle Menu" / "User Menu" aria-labels (screen readers
  read these in English regardless of locale)
- CustomPageView: "Page not found" error body
- PaymentProviderDialog: display-name example placeholder hardcoded in
  Chinese for all locales

Adds common.toggleMenu / common.userMenu / common.pageNotFound and
admin.settings.payment.customMethodDisplayNamePlaceholder to both zh
and en locales, and registers the new placeholder key in the
PaymentProviderDialog spec's i18n mock.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Astrenix
2026-07-19 02:55:50 +08:00
co-authored by Claude Fable 5
parent d4b9797ff7
commit 3401a971a8
8 changed files with 13 additions and 4 deletions
+2 -2
View File
@@ -6,7 +6,7 @@
<button
@click="toggleMobileSidebar"
class="btn-ghost btn-icon lg:hidden"
aria-label="Toggle Menu"
:aria-label="t('common.toggleMenu')"
>
<Icon name="menu" size="md" />
</button>
@@ -96,7 +96,7 @@
<button
@click="toggleDropdown"
class="flex items-center gap-2 rounded-xl p-1.5 transition-colors hover:bg-gray-100 dark:hover:bg-dark-800"
aria-label="User Menu"
:aria-label="t('common.userMenu')"
>
<div class="flex h-8 w-8 items-center justify-center overflow-hidden rounded-xl bg-gradient-to-br from-primary-500 to-primary-600 text-sm font-medium text-white shadow-sm">
<img
@@ -100,7 +100,7 @@
</div>
<div>
<label class="text-xs text-gray-500 dark:text-gray-400">{{ t('admin.settings.payment.customMethodDisplayName') }}</label>
<input v-model="method.displayName" type="text" class="input mt-0.5" placeholder="信用卡" />
<input v-model="method.displayName" type="text" class="input mt-0.5" :placeholder="t('admin.settings.payment.customMethodDisplayNamePlaceholder')" />
</div>
<button
type="button"
@@ -13,6 +13,7 @@ const messages: Record<string, string> = {
'admin.settings.payment.customMethodType': 'Payment type',
'admin.settings.payment.customMethodUpstreamType': 'Upstream type',
'admin.settings.payment.customMethodDisplayName': 'Display name',
'admin.settings.payment.customMethodDisplayNamePlaceholder': '信用卡',
'admin.settings.payment.paymentGuideTrigger': 'View payment guide',
'admin.settings.payment.alipayGuideSummary': 'Desktop prefers QR precreate and falls back to cashier; mobile prefers WAP checkout.',
'admin.settings.payment.wxpayGuideSummary': 'Desktop prefers Native QR; mobile routes to JSAPI or H5 based on browser context.',