chore: update localization keys for settings and improve message structure
- Removed unnecessary `items` segment path in internationalization messages for settings. - Updated localization keys in the English and Chinese files for consistency and clarity.
This commit is contained in:
parent
8ad6609527
commit
aa0aea352b
@ -431,39 +431,11 @@
|
||||
"nextBillingDate": "Next billing date:",
|
||||
"trialEnds": "Trial ends:",
|
||||
"manageSubscription": "Manage Subscription",
|
||||
"upgradeMessage": "Upgrade to a paid plan to access more features",
|
||||
"paymentMethod": {
|
||||
"title": "Payment Method",
|
||||
"description": "Manage your payment methods",
|
||||
"manageMessage": "Manage your payment methods through the Stripe Customer Portal.",
|
||||
"securityMessage": "You can add, remove, or update your payment methods securely through the Stripe portal.",
|
||||
"noMethodsMessage": "No payment methods on file.",
|
||||
"upgradePromptMessage": "You'll be prompted to add a payment method when upgrading to a paid plan."
|
||||
},
|
||||
"managePaymentMethods": "Manage Payment Methods",
|
||||
"upgradePlan": {
|
||||
"title": "Upgrade Your Plan",
|
||||
"description": "Choose a plan that works for you"
|
||||
},
|
||||
"trialDays": "{days} day trial",
|
||||
"upgradeToPlan": "Upgrade to {planName}",
|
||||
"customPricing": "Custom Pricing",
|
||||
"contactSales": "Contact Sales",
|
||||
"billingHistory": {
|
||||
"title": "Billing History",
|
||||
"description": "View and download your past invoices",
|
||||
"accessMessage": "Access your billing history through the Stripe Customer Portal",
|
||||
"noHistoryMessage": "No billing history available"
|
||||
},
|
||||
"viewBillingHistory": "View Billing History",
|
||||
"CustomerPortalButton": {
|
||||
"loading": "Loading...",
|
||||
"createCustomerPortalFailed": "Failed to open customer portal"
|
||||
},
|
||||
"retry": "Retry",
|
||||
"errorMessage": "Failed to get billing data",
|
||||
"freePlanMessage": "You are currently on the free plan with limited features",
|
||||
"lifetimeMessage": "You have lifetime access to all premium features"
|
||||
"lifetimeMessage": "You have lifetime access to all premium features",
|
||||
"viewBillingHistory": "View Billing History",
|
||||
"retry": "Retry",
|
||||
"errorMessage": "Failed to get data"
|
||||
},
|
||||
"notification": {
|
||||
"title": "Notification",
|
||||
|
@ -405,7 +405,9 @@
|
||||
"maxLength": "请最多使用 30 个字符",
|
||||
"hint": "请使用 3-30 个字符",
|
||||
"success": "名字更新成功",
|
||||
"fail": "更新名字失败"
|
||||
"fail": "更新名字失败",
|
||||
"saving": "保存中...",
|
||||
"save": "保存"
|
||||
}
|
||||
},
|
||||
"billing": {
|
||||
@ -429,38 +431,11 @@
|
||||
"nextBillingDate": "下次账单日期:",
|
||||
"trialEnds": "试用结束日期:",
|
||||
"manageSubscription": "管理订阅",
|
||||
"upgradeMessage": "升级到付费方案以获取更多功能",
|
||||
"paymentMethod": {
|
||||
"title": "支付方式",
|
||||
"description": "管理您的支付方式",
|
||||
"manageMessage": "通过 Stripe 客户门户管理您的支付方式。",
|
||||
"securityMessage": "您可以通过 Stripe 门户安全地添加、删除或更新您的支付方式。",
|
||||
"noMethodsMessage": "没有支付方式记录。",
|
||||
"upgradePromptMessage": "升级到付费方案时,系统会提示您添加支付方式。"
|
||||
},
|
||||
"managePaymentMethods": "管理支付方式",
|
||||
"upgradePlan": {
|
||||
"title": "升级您的方案",
|
||||
"description": "选择适合您的方案"
|
||||
},
|
||||
"trialDays": "{days} 天试用期",
|
||||
"upgradeToPlan": "升级到 {planName}",
|
||||
"customPricing": "定制价格",
|
||||
"contactSales": "联系销售",
|
||||
"billingHistory": {
|
||||
"title": "账单历史",
|
||||
"description": "查看并下载您的历史账单",
|
||||
"accessMessage": "通过 Stripe 客户门户访问您的账单历史",
|
||||
"noHistoryMessage": "没有可用的账单历史"
|
||||
},
|
||||
"viewBillingHistory": "查看账单历史",
|
||||
"CustomerPortalButton": {
|
||||
"loading": "加载中...",
|
||||
"createCustomerPortalFailed": "打开Stripe客户页面失败"
|
||||
},
|
||||
"retry": "重试",
|
||||
"freePlanMessage": "您当前使用的是功能有限的免费方案",
|
||||
"lifetimeMessage": "您拥有所有高级功能的终身访问权限"
|
||||
"lifetimeMessage": "您拥有所有高级功能的终身使用权限",
|
||||
"viewBillingHistory": "查看账单历史",
|
||||
"retry": "重试",
|
||||
"errorMessage": "获取数据失败"
|
||||
},
|
||||
"notification": {
|
||||
"title": "通知",
|
||||
|
@ -31,7 +31,7 @@ export function CustomerPortalButton({
|
||||
className,
|
||||
children,
|
||||
}: CustomerPortalButtonProps) {
|
||||
const t = useTranslations('Dashboard.'settings.billing.CustomerPortalButton');
|
||||
const t = useTranslations('Dashboard.settings.billing.CustomerPortalButton');
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
|
||||
const handleClick = async () => {
|
||||
|
@ -16,7 +16,7 @@ import { useTranslations } from 'next-intl';
|
||||
import { useEffect, useMemo, useState } from 'react';
|
||||
|
||||
export default function BillingCard() {
|
||||
const t = useTranslations('Dashboard.'settings.billing');
|
||||
const t = useTranslations('Dashboard.settings.billing');
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [error, setError] = useState<string | undefined>('');
|
||||
const [subscription, setSubscription] = useState<Subscription | null>(null);
|
||||
|
@ -40,7 +40,7 @@ interface NewsletterFormCardProps {
|
||||
* Allows users to toggle their newsletter subscription status
|
||||
*/
|
||||
export function NewsletterFormCard({ className }: NewsletterFormCardProps) {
|
||||
const t = useTranslations('Dashboard.'settings.notification');
|
||||
const t = useTranslations('Dashboard.settings.notification');
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const [error, setError] = useState<string | undefined>('');
|
||||
const [isSubscriptionChecked, setIsSubscriptionChecked] = useState(false);
|
||||
|
@ -27,7 +27,7 @@ interface UpdateAvatarCardProps {
|
||||
* Update the user's avatar
|
||||
*/
|
||||
export function UpdateAvatarCard({ className }: UpdateAvatarCardProps) {
|
||||
const t = useTranslations('Dashboard.'settings.profile');
|
||||
const t = useTranslations('Dashboard.settings.profile');
|
||||
const [isUploading, setIsUploading] = useState(false);
|
||||
const [error, setError] = useState<string | undefined>('');
|
||||
const { data: session, refetch } = authClient.useSession();
|
||||
|
@ -35,7 +35,7 @@ interface UpdateNameCardProps {
|
||||
* update user name
|
||||
*/
|
||||
export function UpdateNameCard({ className }: UpdateNameCardProps) {
|
||||
const t = useTranslations('Dashboard.'settings.profile');
|
||||
const t = useTranslations('Dashboard.settings.profile');
|
||||
const [isSaving, setIsSaving] = useState(false);
|
||||
const [error, setError] = useState<string | undefined>('');
|
||||
const { data: session, refetch } = authClient.useSession();
|
||||
|
@ -32,7 +32,7 @@ import { toast } from 'sonner';
|
||||
* It includes a confirmation dialog to prevent accidental deletions.
|
||||
*/
|
||||
export function DeleteAccountCard() {
|
||||
const t = useTranslations('Dashboard.'settings.security.deleteAccount');
|
||||
const t = useTranslations('Dashboard.settings.security.deleteAccount');
|
||||
const [isDeleting, setIsDeleting] = useState(false);
|
||||
const [showConfirmation, setShowConfirmation] = useState(false);
|
||||
const [error, setError] = useState<string | undefined>('');
|
||||
|
@ -72,7 +72,7 @@ export function PasswordCardWrapper() {
|
||||
}
|
||||
|
||||
function PasswordSkeletonCard() {
|
||||
const t = useTranslations('Dashboard.'settings.security.updatePassword');
|
||||
const t = useTranslations('Dashboard.settings.security.updatePassword');
|
||||
return (
|
||||
<Card className={cn("w-full max-w-lg md:max-w-xl overflow-hidden pt-6 pb-6 flex flex-col")}>
|
||||
<CardHeader>
|
||||
|
@ -37,7 +37,7 @@ interface ResetPasswordCardProps {
|
||||
* This effectively adds a credential provider to their account, enabling email/password login.
|
||||
*/
|
||||
export function ResetPasswordCard({ className }: ResetPasswordCardProps) {
|
||||
const t = useTranslations('Dashboard.'settings.security.resetPassword');
|
||||
const t = useTranslations('Dashboard.settings.security.resetPassword');
|
||||
const router = useLocaleRouter();
|
||||
const { data: session } = authClient.useSession();
|
||||
|
||||
|
@ -46,7 +46,7 @@ interface UpdatePasswordCardProps {
|
||||
* @see https://www.better-auth.com/docs/authentication/email-password#update-password
|
||||
*/
|
||||
export function UpdatePasswordCard({ className }: UpdatePasswordCardProps) {
|
||||
const t = useTranslations('Dashboard.'settings.security.updatePassword');
|
||||
const t = useTranslations('Dashboard.settings.security.updatePassword');
|
||||
const [isSaving, setIsSaving] = useState(false);
|
||||
const [showCurrentPassword, setShowCurrentPassword] = useState(false);
|
||||
const [showNewPassword, setShowNewPassword] = useState(false);
|
||||
|
@ -449,25 +449,25 @@ export function getSidebarLinks(): NestedMenuItem[] {
|
||||
icon: <Settings2Icon className="site-4 shrink-0" />,
|
||||
items: [
|
||||
{
|
||||
title: t('Dashboard.'settings.profile.title'),
|
||||
title: t('Dashboard.settings.profile.title'),
|
||||
icon: <CircleUserRoundIcon className="site-4 shrink-0" />,
|
||||
href: Routes.SettingsProfile,
|
||||
external: false,
|
||||
},
|
||||
{
|
||||
title: t('Dashboard.'settings.billing.title'),
|
||||
title: t('Dashboard.settings.billing.title'),
|
||||
icon: <CreditCardIcon className="site-4 shrink-0" />,
|
||||
href: Routes.SettingsBilling,
|
||||
external: false,
|
||||
},
|
||||
{
|
||||
title: t('Dashboard.'settings.security.title'),
|
||||
title: t('Dashboard.settings.security.title'),
|
||||
icon: <LockKeyholeIcon className="site-4 shrink-0" />,
|
||||
href: Routes.SettingsSecurity,
|
||||
external: false,
|
||||
},
|
||||
{
|
||||
title: t('Dashboard.'settings.notification.title'),
|
||||
title: t('Dashboard.settings.notification.title'),
|
||||
icon: <BellIcon className="site-4 shrink-0" />,
|
||||
href: Routes.SettingsNotifications,
|
||||
external: false,
|
||||
|
Loading…
Reference in New Issue
Block a user