From 81e0f21a39f755c8d56a9ebed9725c7da62e6d7f Mon Sep 17 00:00:00 2001 From: "web@ppanel" Date: Wed, 27 Nov 2024 21:41:20 +0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(billing):=20I18n=20and=20sty?= =?UTF-8?q?les?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/admin/components/billing.tsx | 14 +++++--------- apps/admin/components/dashboard/statistics.tsx | 1 + apps/admin/locales/en-US/common.json | 4 ++++ apps/admin/locales/zh-CN/common.json | 4 ++++ 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/apps/admin/components/billing.tsx b/apps/admin/components/billing.tsx index ac7bf4e..11513a5 100644 --- a/apps/admin/components/billing.tsx +++ b/apps/admin/components/billing.tsx @@ -1,7 +1,7 @@ import { Avatar, AvatarFallback, AvatarImage } from '@shadcn/ui/avatar'; import { Card, CardDescription, CardHeader, CardTitle } from '@shadcn/ui/card'; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@shadcn/ui/tooltip'; -import { getLocale } from 'next-intl/server'; +import { getTranslations } from 'next-intl/server'; import Image from 'next/legacy/image'; import Link from 'next/link'; @@ -21,7 +21,7 @@ interface ItemType { } export default async function Billing({ type }: BillingProps) { - const locale = await getLocale(); + const t = await getTranslations('common.billing'); let list: ItemType[] = []; try { const response = await fetch(BASE_URL, { cache: 'no-store' }); @@ -39,14 +39,10 @@ export default async function Billing({ type }: BillingProps) { return (

- {locale === 'en-US' ? 'Advertisement' : '广告合作'} - - {locale === 'en-US' - ? 'Ad revenue helps PPanel continue to release updates' - : '广告收入有助于 PPanel 继续发布更新'} - + {t('title')} + {t('description')}

-
+
{list.map((item, index) => ( diff --git a/apps/admin/components/dashboard/statistics.tsx b/apps/admin/components/dashboard/statistics.tsx index 2266201..13e04d4 100644 --- a/apps/admin/components/dashboard/statistics.tsx +++ b/apps/admin/components/dashboard/statistics.tsx @@ -118,6 +118,7 @@ export default function Statistics() { const currentData = trafficData[dataType][timeFrame]; return ( <> +

统计

{[ { diff --git a/apps/admin/locales/en-US/common.json b/apps/admin/locales/en-US/common.json index 21c7e42..3d19c53 100644 --- a/apps/admin/locales/en-US/common.json +++ b/apps/admin/locales/en-US/common.json @@ -1,4 +1,8 @@ { + "billing": { + "title": "赞助商", + "description": "赞助有助于 PPanel 继续发布更新!" + }, "empty": [ "Imagine this place filled with exciting content! For now, you'll have to use your imagination...", "This area mysteriously disappeared, but we're summoning it back!", diff --git a/apps/admin/locales/zh-CN/common.json b/apps/admin/locales/zh-CN/common.json index 80ec93a..fe3a8b9 100644 --- a/apps/admin/locales/zh-CN/common.json +++ b/apps/admin/locales/zh-CN/common.json @@ -1,4 +1,8 @@ { + "billing": { + "title": "赞助商", + "description": "赞助有助于 PPanel 继续发布更新!" + }, "empty": [ "想象一下这里充满了精彩的内容!暂时只能靠想象了…", "这片区域神秘消失了,我们正在召唤它回来!",