diff --git a/ui/homepage/app/layout.tsx b/ui/homepage/app/layout.tsx index e69de29..800147c 100644 --- a/ui/homepage/app/layout.tsx +++ b/ui/homepage/app/layout.tsx @@ -0,0 +1,17 @@ +import './globals.css' +import { LanguageProvider } from '@i18n/LanguageProvider' + +export const metadata = { + title: 'CloudNative Suite', + description: 'Unified tools for your cloud native stack', +} + +export default function RootLayout({ children }: { children: React.ReactNode }) { + return ( + + + {children} + + + ) +} diff --git a/ui/homepage/i18n/LanguageProvider.tsx b/ui/homepage/i18n/LanguageProvider.tsx index e69de29..30b52f3 100644 --- a/ui/homepage/i18n/LanguageProvider.tsx +++ b/ui/homepage/i18n/LanguageProvider.tsx @@ -0,0 +1,29 @@ +'use client' + +import { createContext, useContext, useState } from 'react' + +export type Language = 'en' | 'zh' + +type LanguageContextType = { + language: Language + setLanguage: (lang: Language) => void +} + +const LanguageContext = createContext({ + language: 'en', + setLanguage: () => {}, +}) + +export function LanguageProvider({ children }: { children: React.ReactNode }) { + const [language, setLanguage] = useState('en') + + return ( + + {children} + + ) +} + +export function useLanguage() { + return useContext(LanguageContext) +} diff --git a/ui/homepage/i18n/translations.ts b/ui/homepage/i18n/translations.ts index e69de29..006151a 100644 --- a/ui/homepage/i18n/translations.ts +++ b/ui/homepage/i18n/translations.ts @@ -0,0 +1,45 @@ +export type Translation = { + hero: { + title: string + description: string + start: string + learn: string + } + featuresTitle: string + featuresSubtitle: string + openSourceTitle: string + downloadTitle: string + downloadSubtitle: string + footerLinks: [string, string, string] +} + +export const translations: Record<'en' | 'zh', Translation> = { + en: { + hero: { + title: 'CloudNative Suite', + description: 'Unified tools for building and managing your cloud native stack.', + start: 'Get Started', + learn: 'Learn More', + }, + featuresTitle: 'Features', + featuresSubtitle: 'Everything you need to build, ship and run applications', + openSourceTitle: 'Open Source Projects', + downloadTitle: 'Download', + downloadSubtitle: 'Select your platform', + footerLinks: ['Privacy Policy', 'Terms of Service', 'Contact Us'], + }, + zh: { + hero: { + title: '云原生套件', + description: '为构建和管理云原生环境提供统一工具', + start: '开始使用', + learn: '了解更多', + }, + featuresTitle: '功能特性', + featuresSubtitle: '助您轻松构建、交付和运行应用', + openSourceTitle: '开源项目', + downloadTitle: '下载', + downloadSubtitle: '选择适合的平台', + footerLinks: ['隐私政策', '服务条款', '联系我们'], + }, +}