useI18n.tsx 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693
  1. import * as React from 'react';
  2. import { enUS, ja, zhCN, ko } from 'date-fns/locale';
  3. // FIX: Import the 'Locale' type from 'date-fns' to resolve the 'Cannot find name' error.
  4. import type { Locale } from 'date-fns';
  5. export type Language = 'en' | 'ja' | 'zh' | 'ko';
  6. export const resources = {
  7. en: {
  8. translation: {
  9. // General
  10. 'add': 'Add',
  11. 'cancel': 'Cancel',
  12. 'save': 'Save',
  13. 'delete': 'Delete',
  14. 'update': 'Update',
  15. 'edit': 'Edit',
  16. 'name': 'Name',
  17. 'pro': 'PRO',
  18. 'all': 'All',
  19. 'for': 'For',
  20. 'no_items_found': 'No items found.',
  21. 'scheduled': 'Scheduled',
  22. 'unscheduled': 'Unscheduled',
  23. 'open': 'Open',
  24. 'resolved': 'Resolved',
  25. // Sidebar
  26. 'nav.page': 'Page',
  27. 'nav.page.link': 'Link',
  28. 'nav.page.media': 'Media',
  29. 'nav.page.design': 'Design',
  30. 'nav.ai_assistant': 'AI Assistant',
  31. 'nav.ai_assistant.persona': 'Persona',
  32. 'nav.ai_assistant.knowledge': 'Knowledge',
  33. 'nav.ai_assistant.sensitivity': 'Sensitivity',
  34. 'nav.analytics': 'Analytics',
  35. 'nav.analytics.page': 'Page',
  36. 'nav.analytics.interactions': 'Interactions',
  37. 'nav.analytics.crm': 'CRM',
  38. 'nav.seo': 'SEO',
  39. 'nav.seo.short_links': 'Short Links',
  40. 'nav.seo.hosting': 'Enterprise Hosting',
  41. 'nav.seo.services': 'SEO Services',
  42. 'nav.aigc': 'AIGC',
  43. 'nav.aigc.creator': 'Creator',
  44. 'nav.aigc.news': 'News',
  45. 'nav.aigc.scheduler': 'Scheduler',
  46. 'nav.showcase': 'Showcase',
  47. 'nav.showcase.personal': 'Personal',
  48. 'nav.showcase.enterprise': 'Enterprise',
  49. 'sidebar.select_page': 'Select Page',
  50. 'sidebar.logout': 'Logout',
  51. 'sidebar.light_theme': 'Light',
  52. 'sidebar.dark_theme': 'Dark',
  53. 'sidebar.language': 'Language',
  54. // App
  55. 'app.welcome': 'Welcome!',
  56. 'app.no_pages_prompt': "You don't have any pages yet. Let's create your first one.",
  57. 'app.create_first_page': 'Create Your First Page',
  58. 'app.import_success': "'{{name}}' has been added to your pages! You can now edit it.",
  59. 'app.videos_generated_success': "{{count}} video(s) generated successfully! You can find them in the Content Scheduler's video library.",
  60. 'app.form_submission_success': 'New form submission received! You can view it in the CRM.',
  61. 'app.no_page_selected': 'No Page Selected',
  62. // Page Builder
  63. 'page_builder.title': 'My Page',
  64. 'page_builder.url_prompt': 'Your public URL:',
  65. 'page_builder.share': 'Share',
  66. 'page_builder.personal_mode': 'Personal',
  67. 'page_builder.enterprise_mode': 'Enterprise',
  68. 'page_builder.exit_fullscreen': 'Exit Fullscreen',
  69. // Link Editor
  70. 'link_editor.add_block': 'Add Block',
  71. 'link_editor.header_text': 'Header Text',
  72. 'link_editor.alignment': 'Alignment',
  73. 'link_editor.title': 'Title',
  74. 'link_editor.url': 'URL',
  75. 'link_editor.thumbnail_url': 'Thumbnail URL (Optional)',
  76. 'link_editor.display_style': 'Display Style',
  77. 'link_editor.under_avatar': 'Under Avatar',
  78. 'link_editor.block_button': 'Block Button',
  79. 'link_editor.floating_widget': 'Floating Widget',
  80. 'link_editor.icon': 'Icon',
  81. 'link_editor.label': 'Label',
  82. 'link_editor.value': 'Value',
  83. 'link_editor.add_info_item': 'Add Info Item',
  84. 'link_editor.add_link': 'Add Link',
  85. 'link_editor.add_mock_links': 'Add Mock Links',
  86. 'link_editor.layout_mode': 'Layout Mode',
  87. 'link_editor.single_column': 'Single Column',
  88. 'link_editor.grid': 'Grid',
  89. 'link_editor.source': 'Source',
  90. 'link_editor.upload': 'Upload',
  91. 'link_editor.aigc_library': 'AIGC Library',
  92. 'link_editor.add_media': 'Add {{type}}',
  93. 'link_editor.add_mock_media': 'Add 3 Mock {{type}}s',
  94. 'link_editor.address': 'Address or Location',
  95. 'link_editor.map_preview': 'Map Preview',
  96. 'link_editor.image_overlay': 'Image Overlay',
  97. 'link_editor.background_image': 'Background Image',
  98. 'link_editor.button_label': 'Button Label',
  99. 'link_editor.email_address': 'Email Address',
  100. 'link_editor.phone_number': 'Phone Number',
  101. 'link_editor.display_mode': 'Display Mode',
  102. 'link_editor.label_only': 'Label Only',
  103. 'link_editor.label_and_value': 'Label + Value',
  104. 'link_editor.layout': 'Layout',
  105. 'link_editor.list': 'List',
  106. 'link_editor.content_source': 'Content Source',
  107. 'link_editor.aigc_lib': 'AIGC Library',
  108. 'link_editor.custom_urls': 'Custom URLs',
  109. 'link_editor.select_articles': 'Select Articles',
  110. 'link_editor.no_articles_selected': 'No articles selected.',
  111. 'link_editor.select_from_aigc': 'Select from AIGC Library',
  112. 'link_editor.add_url': 'Add URL',
  113. 'link_editor.add_mock_items': 'Add 3 Mock Items',
  114. 'link_editor.add_products_from_url': 'Add Products from URL',
  115. 'link_editor.add_from_urls': 'Add from URLs',
  116. 'link_editor.fetching': 'Fetching...',
  117. 'link_editor.add_sample_products': 'Or Add Sample Products',
  118. 'link_editor.add_award': 'Add Award',
  119. 'link_editor.subtitle': 'Subtitle (e.g., Awarded by)',
  120. 'link_editor.year': 'Year',
  121. 'link_editor.image_url': 'Image URL',
  122. 'link_editor.description': 'Description',
  123. 'link_editor.form_fields': 'Form Fields',
  124. 'link_editor.purpose_options': 'Purpose Options',
  125. 'link_editor.submit_button_text': 'Submit Button Text',
  126. 'link_editor.required': 'Required',
  127. 'link_editor.add_option': 'Add Option',
  128. 'link_editor.aigc_select_video': 'Select a Video from AIGC Library',
  129. // Design Editor
  130. 'design_editor.templates': 'Templates',
  131. 'design_editor.profile': 'Profile',
  132. 'design_editor.appearance': 'Appearance',
  133. 'design_editor.typography': 'Typography',
  134. 'design_editor.buttons': 'Buttons',
  135. 'design_editor.background': 'Background',
  136. 'design_editor.enterprise_layout': 'Enterprise Layout',
  137. 'design_editor.more_themes': 'More Themes...',
  138. 'design_editor.avatar': 'Avatar',
  139. 'design_editor.source': 'Source',
  140. 'design_editor.custom': 'Custom',
  141. 'design_editor.background_color': 'Background',
  142. 'design_editor.text_color': 'Text Color',
  143. 'design_editor.button_color': 'Button Color',
  144. 'design_editor.button_text': 'Button Text',
  145. 'design_editor.font_color': 'Font Color',
  146. 'design_editor.font_size': 'Font Size',
  147. 'design_editor.font_family': 'Font Family',
  148. 'design_editor.button_style': 'Button Style',
  149. 'design_editor.button_shape': 'Button Shape',
  150. 'design_editor.upload_image': 'Upload Image',
  151. 'design_editor.banner': 'Banner',
  152. 'design_editor.banner_type': 'Banner Type',
  153. 'design_editor.banner_width': 'Banner Width',
  154. 'design_editor.contained': 'Contained',
  155. 'design_editor.full_width': 'Full Width',
  156. 'design_editor.banner_height': 'Banner Height (px)',
  157. 'design_editor.banner_color': 'Banner Color',
  158. 'design_editor.side_nav': 'Side Navigation',
  159. 'design_editor.position': 'Position',
  160. 'design_editor.normal': 'Normal',
  161. 'design_editor.float_top': 'Float Top',
  162. 'design_editor.float_center': 'Float Center',
  163. 'design_editor.background_style': 'Background Style',
  164. 'design_editor.compact': 'Compact',
  165. 'design_editor.full_height': 'Full Height',
  166. 'design_editor.active_link': 'Active Link',
  167. 'design_editor.hover_bg': 'Hover BG',
  168. 'design_editor.hover_text': 'Hover Text',
  169. 'design_editor.chat_widget': 'Chat Widget',
  170. 'design_editor.icon_color': 'Icon Color',
  171. 'design_editor.header_bg': 'Header BG',
  172. 'design_editor.header_text': 'Header Text',
  173. 'design_editor.panel_bg': 'Panel BG',
  174. 'design_editor.user_message': 'User Message',
  175. 'design_editor.user_text': 'User Text',
  176. 'design_editor.ai_message': 'AI Message',
  177. 'design_editor.ai_text': 'AI Text',
  178. // AI Assistant
  179. 'ai_assistant.title': 'AI Assistant',
  180. 'ai_assistant.subtitle': "Configure your AI's behavior and knowledge.",
  181. 'ai_assistant.test_title': 'Test your Assistant',
  182. 'ai_assistant.save_changes': 'Save Changes',
  183. 'ai_assistant.save_success': 'AI Assistant settings saved successfully!',
  184. 'ai_assistant.system_instruction': 'System Instruction',
  185. 'ai_assistant.system_instruction_desc': "Define the AI's core identity, personality, and instructions.",
  186. 'ai_assistant.voice': 'Voice',
  187. 'ai_assistant.voice_desc': 'Select a voice for audio responses.',
  188. 'ai_assistant.clone': 'Clone',
  189. 'ai_assistant.clone_desc': 'Create a clone of your own voice.',
  190. 'ai_assistant.clone_voice': 'Clone Voice',
  191. 'ai_assistant.language': 'Language',
  192. 'ai_assistant.language_desc': 'The primary language for the AI.',
  193. 'ai_assistant.conversation_style': 'Conversation Style',
  194. 'ai_assistant.conversation_style_desc': 'The overall tone of the AI.',
  195. 'ai_assistant.add_knowledge': 'Add Knowledge Source',
  196. 'ai_assistant.no_knowledge': 'No knowledge sources',
  197. 'ai_assistant.no_knowledge_desc': 'Add files or web pages for your AI to learn from.',
  198. 'ai_assistant.forbidden_user': 'Forbidden User Topics',
  199. 'ai_assistant.forbidden_user_desc': 'The AI will refuse to answer questions containing these keywords.',
  200. 'ai_assistant.forbidden_ai': 'Forbidden AI Responses',
  201. 'ai_assistant.forbidden_ai_desc': 'The AI will avoid using these keywords in its responses.',
  202. // Analytics
  203. 'analytics.page.title': 'Page Analytics',
  204. 'analytics.page.last_days': 'Last {{range}} Days',
  205. 'analytics.page.all_time': 'All Time',
  206. 'analytics.page.views': 'Views',
  207. 'analytics.page.clicks': 'Clicks',
  208. 'analytics.page.ctr': 'Click-Through Rate',
  209. 'analytics.page.unique_visitors': 'Unique Visitors',
  210. 'analytics.page.performance': 'Performance',
  211. 'analytics.page.device_breakdown': 'Device Breakdown',
  212. 'analytics.page.top_locations': 'Top Locations',
  213. 'analytics.page.top_referrers': 'Top Referrers',
  214. 'analytics.interactions.title': 'Customer Interaction Analytics',
  215. 'analytics.interactions.search_placeholder': 'Search conversations...',
  216. 'analytics.interactions.date_label': 'Date:',
  217. 'analytics.interactions.last_7_days': 'Last 7 days',
  218. 'analytics.interactions.last_28_days': 'Last 28 days',
  219. 'analytics.interactions.total_conversations': 'Total Conversations',
  220. 'analytics.interactions.resolution_rate': 'Resolution Rate',
  221. 'analytics.interactions.avg_interactions': 'Avg. Interactions',
  222. 'analytics.interactions.avg_first_response': 'Avg. First Response',
  223. 'analytics.interactions.visitor_breakdown': 'Visitor Breakdown',
  224. 'analytics.interactions.common_topics': 'Common Topics',
  225. 'analytics.interactions.visitor': 'Visitor',
  226. 'analytics.interactions.conversations': 'Conversations',
  227. 'analytics.interactions.mark_resolved': 'Mark as Resolved',
  228. 'analytics.interactions.no_conversations': 'No conversations found for the selected filters.',
  229. 'analytics.interactions.edit_response_title': 'Edit AI Response',
  230. 'analytics.interactions.save_and_update': 'Save & Update Model',
  231. 'analytics.interactions.update_success': 'Response updated successfully. The AI will learn from this correction.',
  232. 'analytics.crm.title': 'Visitor CRM',
  233. 'analytics.crm.visitor_id': 'Visitor ID',
  234. 'analytics.crm.last_seen': 'Last Seen',
  235. 'analytics.crm.visits': 'Visits',
  236. // AIGC
  237. 'aigc.creator.generate_videos_progress': 'Generating Videos...',
  238. 'aigc.creator.processing_video': 'Processing video {{current}} of {{total}}. This may take a moment.',
  239. 'aigc.creator.my_first_video': 'My First Video',
  240. 'aigc.creator.untitled_video': 'Untitled Video {{count}}',
  241. 'aigc.creator.at_least_one_scene': 'A project must have at least one scene.',
  242. 'aigc.creator.script_first': 'Please write a script first.',
  243. 'aigc.creator.polish_error': "Sorry, we couldn't polish the script at this time.",
  244. 'aigc.creator.generate_videos': 'Generate {{count}} Video',
  245. 'aigc.creator.generate_videos_plural': 'Generate {{count}} Videos',
  246. 'aigc.creator.add_scene': 'Add Scene',
  247. 'aigc.creator.script': 'Script',
  248. 'aigc.creator.ai_polish': 'AI Polish',
  249. 'aigc.creator.polishing': 'Polishing...',
  250. 'aigc.creator.background': 'Background',
  251. 'aigc.creator.media': 'Media',
  252. 'aigc.creator.upload_image': 'Upload Image',
  253. 'aigc.creator.upload_video': 'Upload Video',
  254. 'aigc.news.title': 'News Library',
  255. 'aigc.news.create': 'Create New Article',
  256. 'aigc.news.edit': 'Edit Article',
  257. 'aigc.news.save_lib': 'Save to Library',
  258. 'aigc.news.save_changes': 'Save Changes',
  259. 'aigc.news.ai_tools': 'AI & Import Tools',
  260. 'aigc.news.generate_ai': 'Generate with AI',
  261. 'aigc.news.import_url': 'Import from URL',
  262. 'aigc.news.enter_topic': 'Enter a topic...',
  263. 'aigc.news.enter_url': 'https://example.com/article',
  264. 'aigc.news.generate': 'Generate',
  265. 'aigc.news.generating': '...',
  266. 'aigc.news.title_req': 'Title is required.',
  267. 'aigc.news.summary': 'Summary',
  268. 'aigc.news.full_content': 'Full Content',
  269. 'aigc.news.delete_confirm': 'Are you sure you want to delete this article?',
  270. 'aigc.news.empty_title': 'Select an article to view',
  271. 'aigc.news.empty_desc': 'Or create a new one to get started.',
  272. 'aigc.scheduler.update_post': 'Update Post',
  273. 'aigc.scheduler.schedule_post': 'Schedule Post',
  274. 'aigc.scheduler.time': 'Time',
  275. 'aigc.scheduler.caption': 'Caption',
  276. 'aigc.scheduler.post_to': 'Post to',
  277. 'aigc.scheduler.schedule': 'Schedule',
  278. 'aigc.scheduler.video_library': 'Video Library',
  279. 'aigc.scheduler.no_videos_filter': 'No videos match the current filter.',
  280. // Auth
  281. 'auth.welcome_back': 'Welcome Back',
  282. 'auth.create_account': 'Create an Account',
  283. 'auth.signin_prompt': 'Sign in to continue to your pages.',
  284. 'auth.signup_prompt': 'Start building your presence in seconds.',
  285. 'auth.email': 'Email Address',
  286. 'auth.password': 'Password',
  287. 'auth.processing': 'Processing...',
  288. 'auth.signin': 'Sign In',
  289. 'auth.signup': 'Sign Up',
  290. 'auth.no_account': "Don't have an account?",
  291. 'auth.has_account': 'Already have an account?',
  292. // Modals
  293. 'modal.share.title': 'Share Your Page',
  294. 'modal.share.pc_version': 'PC Version',
  295. 'modal.share.mobile_version': 'Mobile Version',
  296. 'modal.share.copy': 'Copy',
  297. 'modal.share.copied': 'Copied!',
  298. 'modal.pages.title': 'Select a Page',
  299. 'modal.pages.create_new': 'Create New Page',
  300. // SEO & Hosting
  301. 'seo.short_links.title': 'Short Link',
  302. 'seo.short_links.subtitle': 'Customize your main page URL.',
  303. 'seo.short_links.your_url': 'Your GreenPage URL',
  304. 'seo.short_links.your_url_desc': 'This is your main link that you can share anywhere. Keep it short and memorable.',
  305. 'seo.hosting.title': 'Enterprise Hosting',
  306. 'seo.hosting.subtitle': 'Manage your domain, hosting, and subscription plan.',
  307. 'seo.hosting.custom_domain': 'Connect a Custom Domain',
  308. 'seo.hosting.custom_domain_desc': 'Use your own domain for a more professional look (e.g., links.yourcompany.com).',
  309. 'seo.hosting.connect_domain': 'Connect Domain',
  310. 'seo.hosting.dns_note': "You'll need to update your DNS records after connecting. We'll provide the instructions.",
  311. 'seo.hosting.subscription': 'Managed Hosting & Subscription',
  312. 'seo.hosting.subscription_desc': 'Choose a plan that fits your needs. All enterprise plans include hosting.',
  313. 'seo.hosting.current_plan': 'Current Plan',
  314. 'seo.hosting.select_plan': 'Select Plan',
  315. 'seo.services.title': 'SEO Services',
  316. 'seo.services.subtitle': "Boost your page's visibility and attract more organic traffic.",
  317. 'seo.services.keyword_analysis': 'Keyword Analysis & Optimization',
  318. 'seo.services.keyword_analysis_desc': 'Discover high-impact keywords for your content strategy. Enter a topic to get started.',
  319. 'seo.services.analyze': 'Analyze',
  320. 'seo.services.keyword_results_placeholder': 'Keyword analysis results will appear here.',
  321. 'seo.services.ai_content': 'AI Content with SEO',
  322. 'seo.services.ai_content_desc': 'Supercharge your content creation. When you generate news articles with AI, our SEO service will automatically analyze your topic and assemble relevant long-tail keywords to seamlessly integrate into the content. This helps your articles rank better on search engines.',
  323. 'seo.services.how_it_works': 'How it works:',
  324. 'seo.services.step1': 'You provide a topic in the AIGC News Creator.',
  325. 'seo.services.step2': 'Our AI analyzes the topic for primary and related keywords.',
  326. 'seo.services.step3': 'It generates a high-quality article, naturally weaving in these keywords.',
  327. 'seo.services.step4': 'Your content is published, optimized for search engines from the start.',
  328. 'seo.services.go_to_news_creator': 'Go to News Creator',
  329. },
  330. },
  331. ja: {
  332. translation: {
  333. 'add': '追加',
  334. 'cancel': 'キャンセル',
  335. 'save': '保存',
  336. 'delete': '削除',
  337. 'update': '更新',
  338. 'edit': '編集',
  339. 'name': '名前',
  340. 'pro': 'プロ',
  341. 'all': 'すべて',
  342. 'for': '対象',
  343. 'no_items_found': 'アイテムが見つかりません。',
  344. 'scheduled': '予約済み',
  345. 'unscheduled': '未予約',
  346. 'open': '未解決',
  347. 'resolved': '解決済み',
  348. 'nav.page': 'ページ',
  349. 'nav.page.link': 'リンク',
  350. 'nav.page.media': 'メディア',
  351. 'nav.page.design': 'デザイン',
  352. 'nav.ai_assistant': 'AIアシスタント',
  353. 'nav.ai_assistant.persona': 'ペルソナ',
  354. 'nav.ai_assistant.knowledge': '知識',
  355. 'nav.ai_assistant.sensitivity': '感度',
  356. 'nav.analytics': 'アナリティクス',
  357. 'nav.analytics.page': 'ページ',
  358. 'nav.analytics.interactions': 'インタラクション',
  359. 'nav.analytics.crm': 'CRM',
  360. 'nav.seo': 'SEO',
  361. 'nav.seo.short_links': '短縮リンク',
  362. 'nav.seo.hosting': '法人ホスティング',
  363. 'nav.seo.services': 'SEOサービス',
  364. 'nav.aigc': 'AIGC',
  365. 'nav.aigc.creator': 'クリエーター',
  366. 'nav.aigc.news': 'ニュース',
  367. 'nav.aigc.scheduler': 'スケジューラ',
  368. 'nav.showcase': 'ショーケース',
  369. 'nav.showcase.personal': '個人',
  370. 'nav.showcase.enterprise': '法人',
  371. 'sidebar.select_page': 'ページを選択',
  372. 'sidebar.logout': 'ログアウト',
  373. 'sidebar.light_theme': 'ライト',
  374. 'sidebar.dark_theme': 'ダーク',
  375. 'sidebar.language': '言語',
  376. 'app.welcome': 'ようこそ!',
  377. 'app.no_pages_prompt': 'まだページがありません。最初のページを作成しましょう。',
  378. 'app.create_first_page': '最初のページを作成',
  379. 'app.import_success': '「{{name}}」があなたのページに追加されました!編集可能です。',
  380. 'app.videos_generated_success': '{{count}}本の動画が正常に生成されました!コンテンツスケジューラの動画ライブラリにあります。',
  381. 'app.form_submission_success': '新しいフォーム送信を受け取りました!CRMで表示できます。',
  382. 'app.no_page_selected': 'ページが選択されていません',
  383. 'page_builder.title': 'マイページ',
  384. 'page_builder.url_prompt': 'あなたの公開URL:',
  385. 'page_builder.share': '共有',
  386. 'page_builder.personal_mode': '個人',
  387. 'page_builder.enterprise_mode': '法人',
  388. 'page_builder.exit_fullscreen': '全画面表示を終了',
  389. 'link_editor.add_block': 'ブロックを追加',
  390. 'design_editor.templates': 'テンプレート',
  391. 'design_editor.profile': 'プロフィール',
  392. 'design_editor.appearance': '外観',
  393. 'design_editor.typography': 'タイポグラフィ',
  394. 'design_editor.buttons': 'ボタン',
  395. 'design_editor.background': '背景',
  396. 'design_editor.enterprise_layout': '法人レイアウト',
  397. 'design_editor.more_themes': '他のテーマ...',
  398. 'ai_assistant.title': 'AIアシスタント',
  399. 'ai_assistant.subtitle': 'AIの動作と知識を設定します。',
  400. 'ai_assistant.test_title': 'アシスタントをテスト',
  401. 'ai_assistant.save_changes': '変更を保存',
  402. 'ai_assistant.save_success': 'AIアシスタントの設定が正常に保存されました!',
  403. 'analytics.page.title': 'ページ分析',
  404. 'analytics.interactions.title': '顧客インタラクション分析',
  405. 'analytics.crm.title': '訪問者CRM',
  406. 'aigc.creator.title': 'ビデオクリエーター',
  407. 'aigc.news.title': 'ニュースクリエーター',
  408. 'aigc.scheduler.title': 'コンテンツスケジューラ',
  409. 'auth.welcome_back': 'おかえりなさい',
  410. 'auth.create_account': 'アカウントを作成',
  411. 'auth.signin_prompt': 'あなたのページに進むためにサインインしてください。',
  412. 'auth.signup_prompt': '数秒であなたのプレゼンスを構築し始めましょう。',
  413. 'auth.email': 'メールアドレス',
  414. 'auth.password': 'パスワード',
  415. 'auth.processing': '処理中...',
  416. 'auth.signin': 'サインイン',
  417. 'auth.signup': 'サインアップ',
  418. 'auth.no_account': 'アカウントをお持ちでないですか?',
  419. 'auth.has_account': 'すでにアカウントをお持ちですか?',
  420. 'modal.share.title': 'ページを共有',
  421. 'modal.share.pc_version': 'PC版',
  422. 'modal.share.mobile_version': 'モバイル版',
  423. 'modal.share.copy': 'コピー',
  424. 'modal.share.copied': 'コピーしました!',
  425. 'modal.pages.title': 'ページを選択',
  426. 'modal.pages.create_new': '新しいページを作成',
  427. }
  428. },
  429. zh: {
  430. translation: {
  431. 'add': '添加',
  432. 'cancel': '取消',
  433. 'save': '保存',
  434. 'delete': '删除',
  435. 'update': '更新',
  436. 'edit': '编辑',
  437. 'name': '名称',
  438. 'pro': '专业版',
  439. 'all': '全部',
  440. 'for': '为',
  441. 'no_items_found': '未找到任何项目。',
  442. 'scheduled': '已安排',
  443. 'unscheduled': '未安排',
  444. 'open': '待处理',
  445. 'resolved': '已解决',
  446. 'nav.page': '页面',
  447. 'nav.page.link': '链接',
  448. 'nav.page.media': '媒体',
  449. 'nav.page.design': '设计',
  450. 'nav.ai_assistant': 'AI 助手',
  451. 'nav.ai_assistant.persona': '角色',
  452. 'nav.ai_assistant.knowledge': '知识库',
  453. 'nav.ai_assistant.sensitivity': '敏感度',
  454. 'nav.analytics': '分析',
  455. 'nav.analytics.page': '页面',
  456. 'nav.analytics.interactions': '互动',
  457. 'nav.analytics.crm': '客户关系管理',
  458. 'nav.seo': 'SEO',
  459. 'nav.seo.short_links': '短链接',
  460. 'nav.seo.hosting': '企业托管',
  461. 'nav.seo.services': 'SEO 服务',
  462. 'nav.aigc': 'AIGC',
  463. 'nav.aigc.creator': '创作器',
  464. 'nav.aigc.news': '新闻',
  465. 'nav.aigc.scheduler': '调度器',
  466. 'nav.showcase': '展示',
  467. 'nav.showcase.personal': '个人',
  468. 'nav.showcase.enterprise': '企业',
  469. 'sidebar.select_page': '选择页面',
  470. 'sidebar.logout': '登出',
  471. 'sidebar.light_theme': '浅色',
  472. 'sidebar.dark_theme': '深色',
  473. 'sidebar.language': '语言',
  474. 'app.welcome': '欢迎!',
  475. 'app.no_pages_prompt': '您还没有任何页面。让我们来创建您的第一个页面吧。',
  476. 'app.create_first_page': '创建您的第一个页面',
  477. 'app.import_success': '“{{name}}” 已添加到您的页面中!您现在可以对其进行编辑。',
  478. 'app.videos_generated_success': '{{count}} 个视频生成成功!您可以在内容调度器的视频库中找到它们。',
  479. 'app.form_submission_success': '收到新的表单提交!您可以在 CRM 中查看。',
  480. 'app.no_page_selected': '未选择页面',
  481. 'page_builder.title': '我的页面',
  482. 'page_builder.url_prompt': '您的公开 URL:',
  483. 'page_builder.share': '分享',
  484. 'page_builder.personal_mode': '个人',
  485. 'page_builder.enterprise_mode': '企业',
  486. 'page_builder.exit_fullscreen': '退出全屏',
  487. 'link_editor.add_block': '添加区块',
  488. 'design_editor.templates': '模板',
  489. 'design_editor.profile': '个人资料',
  490. 'design_editor.appearance': '外观',
  491. 'design_editor.typography': '字体',
  492. 'design_editor.buttons': '按钮',
  493. 'design_editor.background': '背景',
  494. 'design_editor.enterprise_layout': '企业布局',
  495. 'design_editor.more_themes': '更多主题...',
  496. 'ai_assistant.title': 'AI 助手',
  497. 'ai_assistant.subtitle': '配置您的 AI 的行为和知识。',
  498. 'ai_assistant.test_title': '测试您的助手',
  499. 'ai_assistant.save_changes': '保存更改',
  500. 'ai_assistant.save_success': 'AI 助手设置已成功保存!',
  501. 'analytics.page.title': '页面分析',
  502. 'analytics.interactions.title': '客户互动分析',
  503. 'analytics.crm.title': '访客 CRM',
  504. 'aigc.creator.title': '视频创作器',
  505. 'aigc.news.title': '新闻创作器',
  506. 'aigc.scheduler.title': '内容调度器',
  507. 'auth.welcome_back': '欢迎回来',
  508. 'auth.create_account': '创建账户',
  509. 'auth.signin_prompt': '登录以继续访问您的页面。',
  510. 'auth.signup_prompt': '在几秒钟内开始建立您的在线形象。',
  511. 'auth.email': '电子邮箱地址',
  512. 'auth.password': '密码',
  513. 'auth.processing': '处理中...',
  514. 'auth.signin': '登录',
  515. 'auth.signup': '注册',
  516. 'auth.no_account': '还没有账户?',
  517. 'auth.has_account': '已经有账户了?',
  518. 'modal.share.title': '分享您的页面',
  519. 'modal.share.pc_version': '桌面版',
  520. 'modal.share.mobile_version': '移动版',
  521. 'modal.share.copy': '复制',
  522. 'modal.share.copied': '已复制!',
  523. 'modal.pages.title': '选择一个页面',
  524. 'modal.pages.create_new': '创建新页面',
  525. }
  526. },
  527. ko: {
  528. translation: {
  529. 'add': '추가',
  530. 'cancel': '취소',
  531. 'save': '저장',
  532. 'delete': '삭제',
  533. 'update': '업데이트',
  534. 'edit': '편집',
  535. 'name': '이름',
  536. 'pro': '프로',
  537. 'all': '전체',
  538. 'for': '대상',
  539. 'no_items_found': '항목을 찾을 수 없습니다.',
  540. 'scheduled': '예약됨',
  541. 'unscheduled': '예약 안됨',
  542. 'open': '진행 중',
  543. 'resolved': '해결됨',
  544. 'nav.page': '페이지',
  545. 'nav.page.link': '링크',
  546. 'nav.page.media': '미디어',
  547. 'nav.page.design': '디자인',
  548. 'nav.ai_assistant': 'AI 어시스턴트',
  549. 'nav.ai_assistant.persona': '페르소나',
  550. 'nav.ai_assistant.knowledge': '지식',
  551. 'nav.ai_assistant.sensitivity': '민감도',
  552. 'nav.analytics': '분석',
  553. 'nav.analytics.page': '페이지',
  554. 'nav.analytics.interactions': '상호작용',
  555. 'nav.analytics.crm': 'CRM',
  556. 'nav.seo': 'SEO',
  557. 'nav.seo.short_links': '단축 링크',
  558. 'nav.seo.hosting': '기업 호스팅',
  559. 'nav.seo.services': 'SEO 서비스',
  560. 'nav.aigc': 'AIGC',
  561. 'nav.aigc.creator': '크리에이터',
  562. 'nav.aigc.news': '뉴스',
  563. 'nav.aigc.scheduler': '스케줄러',
  564. 'nav.showcase': '쇼케이스',
  565. 'nav.showcase.personal': '개인',
  566. 'nav.showcase.enterprise': '기업',
  567. 'sidebar.select_page': '페이지 선택',
  568. 'sidebar.logout': '로그아웃',
  569. 'sidebar.light_theme': '라이트',
  570. 'sidebar.dark_theme': '다크',
  571. 'sidebar.language': '언어',
  572. 'app.welcome': '환영합니다!',
  573. 'app.no_pages_prompt': '아직 페이지가 없습니다. 첫 페이지를 만들어 보세요.',
  574. 'app.create_first_page': '첫 페이지 만들기',
  575. 'app.import_success': "'{{name}}'이(가) 페이지에 추가되었습니다! 이제 편집할 수 있습니다.",
  576. 'app.videos_generated_success': '{{count}}개의 동영상이 성공적으로 생성되었습니다! 콘텐츠 스케줄러의 비디오 라이브러리에서 찾을 수 있습니다.',
  577. 'app.form_submission_success': '새로운 양식 제출을 받았습니다! CRM에서 볼 수 있습니다.',
  578. 'app.no_page_selected': '선택된 페이지 없음',
  579. 'page_builder.title': '내 페이지',
  580. 'page_builder.url_prompt': '공개 URL:',
  581. 'page_builder.share': '공유',
  582. 'page_builder.personal_mode': '개인',
  583. 'page_builder.enterprise_mode': '기업',
  584. 'page_builder.exit_fullscreen': '전체 화면 종료',
  585. 'link_editor.add_block': '블록 추가',
  586. 'design_editor.templates': '템플릿',
  587. 'design_editor.profile': '프로필',
  588. 'design_editor.appearance': '모양',
  589. 'design_editor.typography': '타이포그래피',
  590. 'design_editor.buttons': '버튼',
  591. 'design_editor.background': '배경',
  592. 'design_editor.enterprise_layout': '기업 레이아웃',
  593. 'design_editor.more_themes': '더 많은 테마...',
  594. 'ai_assistant.title': 'AI 어시스턴트',
  595. 'ai_assistant.subtitle': 'AI의 행동과 지식을 구성하세요.',
  596. 'ai_assistant.test_title': '어시스턴트 테스트',
  597. 'ai_assistant.save_changes': '변경 사항 저장',
  598. 'ai_assistant.save_success': 'AI 어시스턴트 설정이 성공적으로 저장되었습니다!',
  599. 'analytics.page.title': '페이지 분석',
  600. 'analytics.interactions.title': '고객 상호작용 분석',
  601. 'analytics.crm.title': '방문자 CRM',
  602. 'aigc.creator.title': '비디오 크리에이터',
  603. 'aigc.news.title': '뉴스 크리에이터',
  604. 'aigc.scheduler.title': '콘텐츠 스케줄러',
  605. 'auth.welcome_back': '다시 오신 것을 환영합니다',
  606. 'auth.create_account': '계정 만들기',
  607. 'auth.signin_prompt': '페이지를 계속 보려면 로그인하세요.',
  608. 'auth.signup_prompt': '몇 초 만에 당신의 존재감을 구축하세요.',
  609. 'auth.email': '이메일 주소',
  610. 'auth.password': '비밀번호',
  611. 'auth.processing': '처리 중...',
  612. 'auth.signin': '로그인',
  613. 'auth.signup': '가입하기',
  614. 'auth.no_account': '계정이 없으신가요?',
  615. 'auth.has_account': '이미 계정이 있으신가요?',
  616. 'modal.share.title': '페이지 공유',
  617. 'modal.share.pc_version': 'PC 버전',
  618. 'modal.share.mobile_version': '모바일 버전',
  619. 'modal.share.copy': '복사',
  620. 'modal.share.copied': '복사됨!',
  621. 'modal.pages.title': '페이지 선택',
  622. 'modal.pages.create_new': '새 페이지 만들기',
  623. }
  624. },
  625. };
  626. export const dateLocales: Record<Language, Locale> = {
  627. en: enUS,
  628. ja: ja,
  629. zh: zhCN,
  630. ko: ko,
  631. };
  632. type TranslationContextType = {
  633. language: Language;
  634. setLanguage: (language: Language) => void;
  635. t: (key: string, options?: { [key: string]: string | number }) => string;
  636. dateLocale: Locale;
  637. };
  638. const LanguageContext = React.createContext<TranslationContextType | undefined>(undefined);
  639. export const LanguageProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => {
  640. const [language, setLanguageState] = React.useState<Language>(() => {
  641. const savedLang = localStorage.getItem('greenpage_lang');
  642. return (savedLang && Object.keys(resources).includes(savedLang)) ? savedLang as Language : 'en';
  643. });
  644. const setLanguage = (lang: Language) => {
  645. localStorage.setItem('greenpage_lang', lang);
  646. setLanguageState(lang);
  647. };
  648. const t = (key: string, options?: { [key: string]: string | number }) => {
  649. const langResources = resources[language] || resources.en;
  650. let text = (langResources.translation as any)[key] || key;
  651. if (options) {
  652. Object.keys(options).forEach(k => {
  653. text = text.replace(new RegExp(`\\{\\{${k}\\}\\}`, 'g'), String(options[k]));
  654. });
  655. }
  656. return text;
  657. };
  658. const dateLocale = dateLocales[language] || enUS;
  659. return (
  660. <LanguageContext.Provider value={{ language, setLanguage, t, dateLocale }}>
  661. {children}
  662. </LanguageContext.Provider>
  663. );
  664. };
  665. export const useTranslation = () => {
  666. const context = React.useContext(LanguageContext);
  667. if (context === undefined) {
  668. throw new Error('useTranslation must be used within a LanguageProvider');
  669. }
  670. return context;
  671. };