mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-11-16 23:04:24 +08:00
fix(i18n): use English runtime text and localize system UI
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import { useTranslations } from 'next-intl';
|
||||
import * as React from 'react';
|
||||
import Link from 'next/link';
|
||||
import { cn } from '@/lib/utils';
|
||||
@@ -15,16 +18,11 @@ export interface DeveloperSectionProps {
|
||||
export const DeveloperSection = React.memo(function DeveloperSection({
|
||||
className,
|
||||
}: DeveloperSectionProps) {
|
||||
const rt = useTranslations('runtime');
|
||||
|
||||
const [copied, setCopied] = React.useState(false);
|
||||
|
||||
const codeContent = `# 注册用户
|
||||
curl -X POST https://api.example.com/api/v1/auth/register \\
|
||||
-H "Content-Type: application/json" \\
|
||||
-d '{
|
||||
"username": "developer",
|
||||
"email": "dev@example.com",
|
||||
"password": "secure_password"
|
||||
}'`;
|
||||
const codeContent = rt.raw('register_a_user_curl_x_post_https_4ae682b0');
|
||||
|
||||
const onCopy = async () => {
|
||||
try {
|
||||
@@ -97,7 +95,9 @@ curl -X POST https://api.example.com/api/v1/auth/register \\
|
||||
</div>
|
||||
<pre className='text-xs sm:text-sm font-mono text-neutral-300 leading-relaxed whitespace-pre-wrap break-all sm:whitespace-pre sm:break-normal overflow-x-auto'>
|
||||
<code className='block'>
|
||||
<span className='text-green-400'># 快速开始</span>
|
||||
<span className='text-green-400'>
|
||||
{rt('quick_start_42fbb067')}
|
||||
</span>
|
||||
{'\n'}
|
||||
<span className='text-purple-400'>curl</span> -X{' '}
|
||||
<span className='text-yellow-400'>POST</span>{' '}
|
||||
@@ -130,22 +130,22 @@ curl -X POST https://api.example.com/api/v1/auth/register \\
|
||||
transition={{ duration: 0.8 }}
|
||||
>
|
||||
<h2 className='text-3xl md:text-5xl font-bold tracking-tight text-foreground leading-[1.1] mb-6'>
|
||||
开发者友好,
|
||||
{rt('developer_friendly_40c2a4ce')}
|
||||
<br />
|
||||
极速集成上手
|
||||
{rt('quick_to_integrate_18cbee8a')}
|
||||
</h2>
|
||||
<p className='text-muted-foreground text-lg leading-relaxed mb-8'>
|
||||
标准化的 RESTful API 接口,完整的 TypeScript
|
||||
类型定义,详细的文档和 Swagger
|
||||
UI。无论使用什么编程语言,只需几行代码,即可快速集成。
|
||||
{rt(
|
||||
'standard_restful_apis_complete_typescript_types_detailed_6369a0e2',
|
||||
)}
|
||||
</p>
|
||||
|
||||
<ul className='space-y-4 mb-8'>
|
||||
{[
|
||||
'RESTful API,语义清晰,易于理解',
|
||||
'OpenAPI / Swagger 接口文档',
|
||||
'TypeScript 类型定义,开发友好',
|
||||
'丰富的代码示例和集成指南',
|
||||
rt('restful_api_with_clear_understandable_semantics_1fa9d6f5'),
|
||||
rt('openapi_swagger_documentation_ccbcbc84'),
|
||||
rt('developer_friendly_typescript_type_definitions_910a7909'),
|
||||
rt('code_samples_and_integration_guides_9e998a5a'),
|
||||
].map((item, i) => (
|
||||
<li
|
||||
key={i}
|
||||
@@ -170,7 +170,7 @@ curl -X POST https://api.example.com/api/v1/auth/register \\
|
||||
className='rounded-full text-xs hover:bg-muted-foreground/10'
|
||||
>
|
||||
<Book className='w-3 h-3' />
|
||||
使用文档
|
||||
{rt('user_guide_c83b6b0a')}
|
||||
</Button>
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import { useTranslations } from 'next-intl';
|
||||
import * as React from 'react';
|
||||
import { cn } from '@/lib/utils';
|
||||
import Link from 'next/link';
|
||||
@@ -29,6 +32,8 @@ export interface FooterSectionProps {
|
||||
export const FooterSection = React.memo(function FooterSection({
|
||||
className,
|
||||
}: FooterSectionProps) {
|
||||
const rt = useTranslations('runtime');
|
||||
|
||||
return (
|
||||
<footer
|
||||
className={cn(
|
||||
@@ -48,8 +53,7 @@ export const FooterSection = React.memo(function FooterSection({
|
||||
</span>
|
||||
</Link>
|
||||
<p className='text-muted-foreground text-base leading-relaxed max-w-sm'>
|
||||
开源边缘节点与反向代理管理平台。基于 Go + React 构建,统一管理
|
||||
OpenResty 节点、网站规则与 WAF 配置。
|
||||
{rt('an_open_source_platform_for_managing_edge_317d8f34')}
|
||||
</p>
|
||||
<div className='flex gap-4 pt-2'>
|
||||
<SocialLink
|
||||
@@ -60,35 +64,43 @@ export const FooterSection = React.memo(function FooterSection({
|
||||
</div>
|
||||
|
||||
<div className='lg:col-span-1'>
|
||||
<h3 className='font-semibold text-foreground mb-6'>产品</h3>
|
||||
<h3 className='font-semibold text-foreground mb-6'>
|
||||
{rt('product_aea82737')}
|
||||
</h3>
|
||||
<ul className='space-y-4 text-sm text-muted-foreground'>
|
||||
<li>
|
||||
<FooterLink href='/'>仪表盘</FooterLink>
|
||||
<FooterLink href='/'>{rt('dashboard_0853bf3c')}</FooterLink>
|
||||
</li>
|
||||
<li>
|
||||
<FooterLink href='/settings'>个人设置</FooterLink>
|
||||
<FooterLink href='/settings'>
|
||||
{rt('personal_c2952a5f')}
|
||||
</FooterLink>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div className='lg:col-span-1'>
|
||||
<h3 className='font-semibold text-foreground mb-6'>开发</h3>
|
||||
<h3 className='font-semibold text-foreground mb-6'>
|
||||
{rt('development_9ec42862')}
|
||||
</h3>
|
||||
<ul className='space-y-4 text-sm text-muted-foreground'>
|
||||
<li>
|
||||
<FooterLink href='https://openflare.fyrn.link/'>
|
||||
使用文档
|
||||
{rt('user_guide_c83b6b0a')}
|
||||
</FooterLink>
|
||||
</li>
|
||||
<li>
|
||||
<FooterLink href='https://github.com/Rain-kl/OpenFlare'>
|
||||
源代码
|
||||
{rt('source_code_606a4e58')}
|
||||
</FooterLink>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div className='lg:col-span-1'>
|
||||
<h3 className='font-semibold text-foreground mb-6'>社区</h3>
|
||||
<h3 className='font-semibold text-foreground mb-6'>
|
||||
{rt('community_5bcd0ddc')}
|
||||
</h3>
|
||||
<ul className='space-y-4 text-sm text-muted-foreground'>
|
||||
<li>
|
||||
<FooterLink href='https://github.com/Rain-kl/OpenFlare/issues'>
|
||||
@@ -97,7 +109,7 @@ export const FooterSection = React.memo(function FooterSection({
|
||||
</li>
|
||||
<li>
|
||||
<FooterLink href='https://github.com/Rain-kl/OpenFlare/discussions'>
|
||||
讨论
|
||||
{rt('discussions_3cef912c')}
|
||||
</FooterLink>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -111,13 +123,13 @@ export const FooterSection = React.memo(function FooterSection({
|
||||
href='/docs/privacy-policy'
|
||||
className='hover:text-foreground transition-colors'
|
||||
>
|
||||
隐私政策
|
||||
{rt('privacy_policy_e464b41f')}
|
||||
</Link>
|
||||
<Link
|
||||
href='/docs/terms-of-service'
|
||||
className='hover:text-foreground transition-colors'
|
||||
>
|
||||
服务条款
|
||||
{rt('terms_of_service_9303687a')}
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import { useTranslations } from 'next-intl';
|
||||
import * as React from 'react';
|
||||
import Link from 'next/link';
|
||||
import { motion } from 'motion/react';
|
||||
@@ -15,6 +18,8 @@ export interface HeroSectionProps {
|
||||
export const HeroSection = React.memo(function HeroSection({
|
||||
className,
|
||||
}: HeroSectionProps) {
|
||||
const rt = useTranslations('runtime');
|
||||
|
||||
return (
|
||||
<section className={cn('w-full', className)}>
|
||||
<motion.div
|
||||
@@ -42,7 +47,9 @@ export const HeroSection = React.memo(function HeroSection({
|
||||
className='text-4xl md:text-5xl lg:text-6xl font-extrabold tracking-tight leading-[1.1] mb-6 text-foreground'
|
||||
>
|
||||
Modern Platform <br />
|
||||
<span className='bg-clip-text text-primary'>为二次开发而生</span>
|
||||
<span className='bg-clip-text text-primary'>
|
||||
{rt('built_for_customization_ff3cf147')}
|
||||
</span>
|
||||
</motion.h1>
|
||||
|
||||
<motion.p
|
||||
@@ -56,9 +63,9 @@ export const HeroSection = React.memo(function HeroSection({
|
||||
}}
|
||||
className='text-sm md:text-base text-muted-foreground max-w-xl leading-relaxed mb-10'
|
||||
>
|
||||
通用的、现代化的后台管理系统脚手架
|
||||
{rt('a_modern_administration_platform_116688ff')}
|
||||
<br className='hidden md:block' />
|
||||
开箱即用、完整基建、极易扩展,助您快速构建企业级应用。
|
||||
{rt('ready_to_use_infrastructure_that_is_easy_77776634')}
|
||||
</motion.p>
|
||||
|
||||
<motion.div
|
||||
@@ -77,7 +84,7 @@ export const HeroSection = React.memo(function HeroSection({
|
||||
size='lg'
|
||||
className='w-full rounded-full bg-primary hover:bg-primary/90 font-medium transition-all active:scale-95'
|
||||
>
|
||||
立即开始
|
||||
{rt('get_started_d1f9c450')}
|
||||
<ArrowRight className='size-4' />
|
||||
</Button>
|
||||
</Link>
|
||||
@@ -93,7 +100,7 @@ export const HeroSection = React.memo(function HeroSection({
|
||||
size='lg'
|
||||
className='w-full rounded-full font-medium active:scale-95'
|
||||
>
|
||||
了解更多
|
||||
{rt('learn_more_ca66c2da')}
|
||||
</Button>
|
||||
</Link>
|
||||
</motion.div>
|
||||
@@ -107,15 +114,15 @@ export const HeroSection = React.memo(function HeroSection({
|
||||
>
|
||||
<div className='flex items-center gap-2'>
|
||||
<Zap className='w-5 h-5 text-yellow-500' />
|
||||
<span>开箱即用</span>
|
||||
<span>{rt('ready_to_use_c58cfea2')}</span>
|
||||
</div>
|
||||
<div className='flex items-center gap-2'>
|
||||
<Globe className='w-5 h-5 text-blue-500' />
|
||||
<span>高度可扩展</span>
|
||||
<span>{rt('highly_extensible_9dfa6c10')}</span>
|
||||
</div>
|
||||
<div className='flex items-center gap-2'>
|
||||
<Shield className='w-5 h-5 text-green-500' />
|
||||
<span>工业级基建</span>
|
||||
<span>{rt('production_infrastructure_08c3a5e6')}</span>
|
||||
</div>
|
||||
</motion.div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user