i18n.js 55 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641
  1. /* DoTouch.AI 官网 v1.1.0 — 多语言词典(默认越南语)+ 切换器 + 货币引擎 */
  2. /* 汇率占位:1 USD = 25,400 VND;1 USD = 7.20 CNY(TODO: 接入实时汇率 API) */
  3. const FX_RATE_VND = 25400;
  4. /* 演示环境 API(Docker 部署,独立隔离)— 生产环境替换为真实网关 */
  5. const DEMO_API = 'http://localhost:8081/v1';
  6. const FX_RATE_CNY = 7.2;
  7. /* 按语言(地区)切换货币:vi→VND / en→USD / zh-CN·zh-TW→CNY */
  8. const CURRENCY = {
  9. en: { sym: '$', rate: 1, dec: 2, suffix: '', name: 'USD' },
  10. vi: { sym: '', rate: FX_RATE_VND, dec: 0, suffix: '₫', name: 'VND' },
  11. 'zh-CN': { sym: '¥', rate: FX_RATE_CNY, dec: 2, suffix: '', name: 'CNY' },
  12. 'zh-TW': { sym: '¥', rate: FX_RATE_CNY, dec: 2, suffix: '', name: 'CNY' }
  13. };
  14. function fmtPrice(usdValue) {
  15. const cur = CURRENCY[document.documentElement.lang] || CURRENCY.en;
  16. const val = usdValue * cur.rate;
  17. let num = cur.dec === 0
  18. ? Math.round(val).toLocaleString('en-US').replace(/,/g, '.')
  19. : val.toFixed(cur.dec);
  20. return cur.sym + num + cur.suffix;
  21. }
  22. function applyCurrency() {
  23. document.querySelectorAll('[data-usd]').forEach(el => {
  24. el.textContent = fmtPrice(parseFloat(el.dataset.usd));
  25. });
  26. }
  27. const I18N = {
  28. /* ═══════════ 越南语(默认) ═══════════ */
  29. vi: {
  30. nav_models:"Mô hình", nav_pricing:"Bảng giá", nav_docs:"Tài liệu", nav_login:"Đăng nhập", nav_signup:"Bắt đầu",
  31. crumb_home:"Trang chủ",
  32. /* ── 首页 ── */
  33. hero_badge:"Tương thích OpenAI · Bằng 70% giá Trung Quốc · Ưu tiên Việt Nam",
  34. hero_h1:"Một chạm.", hero_h1_grad:"Mọi AI.",
  35. hero_sub:"DoTouch.AI mang sức mạnh của các mô hình AI tiên phong Trung Quốc — GLM 5.2, DeepSeek V4 và hơn thế nữa — đến với nhà phát triển và doanh nghiệp nhỏ trên toàn thế giới với giá cực rẻ. API OpenAI tương thích. Rẻ hơn 30%. Không cần di chuyển.",
  36. hero_cta1:"Bắt đầu miễn phí", hero_cta2:"Xem bảng giá",
  37. stat_models:"4+", stat_models_l:"Mô hình tiên phong", stat_save:"30%", stat_save_l:"Rẻ hơn giá Trung Quốc",
  38. stat_api:"100%", stat_api_l:"Tương thích API OpenAI", stat_pay:"6+", stat_pay_l:"Phương thức thanh toán",
  39. models_kicker:"Mô hình", models_h2:"Mô hình AI Trung Quốc, một API duy nhất",
  40. models_p:"Tất cả mô hình được phục vụ qua Alibaba Cloud DashScope, tương thích hoàn toàn OpenAI. Xem chi tiết từng mô hình.",
  41. model_link:"Chi tiết",
  42. price_in:"Đầu vào", price_out:"Đầu ra",
  43. pricing_kicker:"Bảng giá", pricing_h2:"Chỉ trả cho những gì bạn dùng",
  44. pricing_p:"Trả trước, tính theo token. Không thuê bao — nạp tiền bất cứ lúc nào. Giá bằng 70% giá nội địa Trung Quốc, hiển thị bằng USD & VND.",
  45. pt_model:"Mô hình", pt_in:"Đầu vào / 1M token", pt_out:"Đầu ra / 1M token", pt_save:"Tiết kiệm",
  46. pricing_more:"Xem bảng giá đầy đủ →",
  47. feat_kicker:"Vì sao DoTouch", feat_h2:"Dành cho lập trình viên, giá cho mọi người",
  48. f1_t:"Tương thích OpenAI tức thì", f1_d:"Đổi một dòng cấu hình SDK OpenAI là mọi thứ hoạt động.",
  49. f2_t:"Bằng 70% giá Trung Quốc", f2_d:"Mô hình Trung Quốc với giá Trung Quốc, thanh toán bằng USD hoặc VND.",
  50. f3_t:"Thanh toán nội địa", f3_d:"MoMo, ZaloPay, Stripe, PayPal, Alipay và thẻ ngân hàng.",
  51. f4_t:"Hỗ trợ ưu tiên Việt Nam", f4_d:"Console, tài liệu và hỗ trợ tiếng Việt.",
  52. f5_t:"Độ trễ thấp, uptime cao", f5_d:"Edge node tại Hồng Kông kết nối trực tiếp nguồn cấp.",
  53. f6_t:"Sử dụng minh bạch", f6_d:"Bản ghi token & chi phí từng request, tổng kết theo ngày.",
  54. pay_kicker:"Thanh toán", pay_h2:"Thanh toán theo cách của bạn", pay_card:"Thẻ ngân hàng",
  55. how_kicker:"Bắt đầu nhanh", how_h2:"Hoạt động sau 3 bước",
  56. s1_t:"Tạo tài khoản", s1_d:"Đăng ký email, nạp tiền bao nhiêu tùy ý.",
  57. s2_t:"Tạo API key", s2_d:"Một cú click trong console. Key bắt đầu bằng dt_.",
  58. s3_t:"Gọi API", s3_d:"Trỏ OpenAI SDK vào api.dotouch.ai. Xong.",
  59. faq_kicker:"FAQ", faq_h2:"Câu hỏi thường gặp",
  60. q1:"Hóa đơn hoạt động thế nào?", a1:"Chỉ trả trước. Nạp tín dụng, mỗi request được đo theo token và trừ từ số dư. Không thuê bao, không hóa đơn bất ngờ.",
  61. q2:"Có thực sự tương thích OpenAI không?", a2:"Có. Cùng endpoint, định dạng request, streaming (SSE) và lỗi. Trỏ OpenAI SDK hiện có vào base URL của chúng tôi là xong.",
  62. q3:"Thanh toán bằng loại tiền nào?", a3:"Hiển thị USD và VND. Thanh toán qua MoMo, ZaloPay, Stripe, PayPal, Alipay và thẻ ngân hàng. Tỷ giá áp dụng tại thời điểm nạp tiền.",
  63. q4:"Có những mô hình nào?", a4:"GLM 5.2, DeepSeek V4, DeepSeek V4 Pro, Qwen Max — và nhiều mô hình đang được bổ sung liên tục.",
  64. q5:"Có mức nạp tối thiểu không?", a5:"Không. Bắt đầu với bất kỳ số tiền nào — thậm chí $1.",
  65. q6:"Dữ liệu của tôi có an toàn không?", a6:"API của bạn được xử lý qua Alibaba Cloud DashScope theo điều khoản áp dụng. Chúng tôi không bao giờ huấn luyện trên dữ liệu của bạn.",
  66. cta_h2:"Một chạm. Mọi AI. Rẻ hơn 30%.", cta_p:"Tham gia cùng lập trình viên khắp Việt Nam và thế giới.", cta_btn:"Tạo tài khoản miễn phí",
  67. rate_note:"Tỷ giá tham khảo: 1 USD ≈ 25.400₫ (cập nhật tự động khi nạp tiền)",
  68. foot_p:"AI Trung Quốc giá rẻ cho lập trình viên và doanh nghiệp nhỏ trên toàn thế giới.",
  69. foot_product:"Sản phẩm", foot_console:"Console", foot_status:"Trạng thái", foot_dev:"Nhà phát triển",
  70. foot_docs:"Tài liệu", foot_quickstart:"Bắt đầu nhanh", foot_support:"Hỗ trợ", foot_legal:"Pháp lý",
  71. foot_tos:"Điều khoản dịch vụ", foot_privacy:"Chính sách bảo mật", foot_refund:"Chính sách hoàn tiền",
  72. foot_made:"Thế giới mã nguồn mở · AI phổ cập",
  73. chat_title:"Trợ giúp & Hỗ trợ", chat_online:"Trực tuyến", chat_hello:"Xin chào! Chúng tôi có thể giúp gì cho bạn?", chat_input:"Nhập tin nhắn...", chat_q_balance:"Làm sao để nạp tiền?", chat_q_key:"Tạo API key thế nào?", chat_q_model:"Nên chọn mô hình nào?",
  74. auth_login_title:"Đăng nhập", auth_register_title:"Tạo tài khoản", auth_reset_title:"Đặt lại mật khẩu",
  75. auth_email:"Email", auth_password:"Mật khẩu", auth_confirm:"Xác nhận mật khẩu", auth_new_pwd:"Mật khẩu mới", auth_confirm_new:"Xác nhận mật khẩu mới",
  76. auth_code_label:"Mã xác minh", auth_code_send:"Gửi mã", auth_code_resend:"Gửi lại ({s}s)", auth_code_note:"Mã gồm 8 ký tự chữ hoa & số, hiệu lực 15 phút",
  77. auth_code_sent:"✓ Đã gửi mã đến {email}. Vui lòng nhập mã trong 15 phút.",
  78. auth_login_btn:"Đăng nhập", auth_register_btn:"Đăng ký", auth_reset_btn:"Đặt lại mật khẩu",
  79. auth_forgot:"Quên mật khẩu?", auth_to_register:"Tạo tài khoản", auth_to_login:"Đã có tài khoản? Đăng nhập", auth_back_login:"Quay lại đăng nhập",
  80. auth_err_pwd:"Mật khẩu không khớp", auth_err_email:"Email không hợp lệ", auth_err_code:"Mã xác minh phải gồm 8 ký tự chữ hoa & số",
  81. nav_home:"Trang chủ", nav_docs_ops:"Hướng dẫn", nav_console:"Console",
  82. c_overview:"Tổng quan", c_keys:"API Keys", c_wallet:"Nạp tiền", c_usage:"Sử dụng",
  83. c_welcome:"Chào mừng trở lại", c_balance:"Số dư", c_today_req:"Yêu cầu hôm nay", c_today_tokens:"Token hôm nay", c_active_keys:"API Key đang hoạt động",
  84. c_usage_7d:"Sử dụng 7 ngày qua", c_recent_tx:"Giao dịch gần đây", c_see_all:"Xem chi tiết →",
  85. c_create_key:"+ Tạo API Key", c_key_name:"Tên Key", c_key_expire:"Hết hạn (tùy chọn)", c_key_create_btn:"+ Tạo Key",
  86. c_key_once:"⚠️ Key sẽ chỉ được hiển thị một lần sau khi tạo. Hãy lưu ngay.",
  87. c_t_name:"Tên", c_t_key:"Key", c_t_status:"Trạng thái", c_t_last:"Sử dụng gần nhất", c_t_created:"Tạo lúc", c_t_action:"Thao tác",
  88. c_rotate:"Đổi key", c_revoke:"Thu hồi", c_reactivate:"Kích hoạt lại", c_delete:"Xóa",
  89. c_security:"🔒 Bảo mật: Key được lưu dạng băm SHA-256. Đổi key = thu hồi + tạo mới.",
  90. c_avail:"Số dư khả dụng", c_month_topup:"Đã nạp (tháng này)", c_select_amount:"Chọn số tiền nạp", c_pay_method:"Phương thức thanh toán", c_topup_now:"Nạp ngay",
  91. c_deposit_history:"Lịch sử nạp", c_t_time:"Thời gian", c_t_type:"Loại", c_t_amount:"Số tiền", c_t_ref:"Tham chiếu",
  92. c_7days:"7 ngày", c_30days:"30 ngày", c_by_model:"Theo mô hình (7 ngày)", c_requests:"Yêu cầu", c_cost:"Chi phí",
  93. c_total:"Tổng quan",
  94. c_sub_today:"so với hôm qua", c_key_meta:"1 đã thu hồi · 1 sắp hết hạn", c_inout:"in 3.1M · out 1.1M", c_req_unit:"req",
  95. c_st_active:"active", c_st_expired:"expired", c_st_revoked:"revoked", c_st_success:"success", c_tx_usage:"usage", c_tx_deposit:"deposit",
  96. c_this_month:"tháng này", c_topup_sub:"2 giao dịch", c_tokens:"Token", c_usage_note:"Chi tiết từng request có sẵn tại GET /v1/usage (phân trang).",
  97. q_limits:"Giới hạn", q_daily:"Hằng ngày", q_total:"Tổng", q_req:"Yêu cầu", q_cost:"Chi phí",
  98. q_alert_pct:"Cảnh báo tại", q_edit:"Cấu hình giới hạn", q_save:"Lưu", q_unlimited:"Không giới hạn",
  99. q_progress:"Đã dùng", q_blocked:"Đã chặn", q_warning:"Sắp đạt giới hạn",
  100. q_banner:"Nhắc nhở sử dụng", q_banner_80:"Đã đạt 80% giới hạn hằng ngày, vui lòng kiểm tra.",
  101. q_banner_100:"Đã vượt giới hạn, yêu cầu sẽ bị từ chối (429).",
  102. q_quota_manage:"Quản lý giới hạn", q_over:"Vượt hạn", q_ok:"Bình thường", q_events:"Sự kiện giới hạn",
  103. /* ── Models 列表页 ── */
  104. models_ph:"Tìm mô hình...", filter_all:"Tất cả", filter_flagship:"Cao cấp", filter_value:"Đáng giá", filter_reasoning:"Suy luận", filter_enterprise:"Doanh nghiệp",
  105. m_col_model:"Mô hình", m_col_vendor:"Nhà cung cấp", m_col_ctx:"Ngữ cảnh", m_col_in:"Đầu vào", m_col_out:"Đầu ra", m_col_action:"",
  106. m_glm_name:"GLM 5.2", m_glm_vendor:"Zhipu AI", m_glm_ctx:"128K", m_glm_short:"Mô hình đa phương thức hàng đầu, suy luận + lập trình + tác vụ agent.",
  107. m_dsv4_name:"DeepSeek V4", m_dsv4_vendor:"DeepSeek", m_dsv4_ctx:"1M", m_dsv4_short:"Cỗ máy suy luận mã nguồn mở, lý tưởng cho chat & RAG khối lượng lớn.",
  108. m_dsv4p_name:"DeepSeek V4 Pro", m_dsv4p_vendor:"DeepSeek", m_dsv4p_ctx:"1M", m_dsv4p_short:"Suy luận sâu cho toán học, logic và kế hoạch agent dài hạn.",
  109. m_qwen_name:"Qwen Max", m_qwen_vendor:"Alibaba", m_qwen_ctx:"256K", m_qwen_short:"Mô hình tổng quát mạnh nhất, đa ngôn ngữ & gọi công cụ.",
  110. m_see_detail:"Xem chi tiết →", m_ctx_tokens:"tokens",
  111. tag_flagship:"Cao cấp", tag_best:"Đáng giá", tag_reasoning:"Suy luận", tag_enterprise:"Doanh nghiệp",
  112. models_count:"mô hình có sẵn",
  113. /* ── 模型详情页 ── */
  114. detail_bread:"Mô hình", detail_overview:"Tổng quan",
  115. detail_use_btn:"Bắt đầu với API này",
  116. detail_spec:"Thông số kỹ thuật", detail_spec_vendor:"Nhà cung cấp", detail_spec_ctx:"Ngữ cảnh", detail_spec_out:"Đầu ra tối đa", detail_spec_base:"BASE URL", detail_spec_rate:"Giới hạn tốc độ",
  117. detail_cap:"Khả năng", detail_cap_json:"JSON Output", detail_cap_tool:"Tool Calls", detail_cap_stream:"Streaming (SSE)", detail_cap_think:"Chế độ suy luận",
  118. detail_pricing:"Giá", detail_pricing_note:"Giá mỗi 1 triệu tokens · đã gồm ưu đãi 70% giá Trung Quốc",
  119. detail_price_in:"Đầu vào", detail_price_out:"Đầu ra",
  120. detail_code:"Ví dụ gọi API", detail_code_tab_curl:"cURL", detail_code_tab_py:"Python SDK",
  121. detail_rel:"Mô hình liên quan", detail_rel_view:"Xem tất cả mô hình →",
  122. detail_billing:"Quy tắc tính phí", detail_billing_p:"Phí = token tiêu thụ × đơn giá, trừ trực tiếp từ số dư nạp trước. Giá có thể thay đổi; xem trang này để cập nhật mới nhất.",
  123. spec_ok:"Hỗ trợ", spec_no:"Không hỗ trợ",
  124. /* ── 定价页 ── */
  125. price_h1:"Bảng giá", price_sub:"Tất cả giá đã bằng 70% giá nội địa Trung Quốc. Hiển thị USD và VND theo tỷ giá hiện tại.",
  126. price_th_model:"Mô hình", price_th_in:"Đầu vào / 1M", price_th_out:"Đầu ra / 1M", price_th_save:"Tiết kiệm",
  127. price_rule:"Quy tắc tính phí", price_rule_p:"Phí = token × đơn giá, trừ từ số dư. Không thuê bao, không cam kết. Tỷ giá VND áp dụng tại thời điểm nạp tiền.",
  128. price_faq:"Câu hỏi về giá", price_note:"* Giá đang là tạm tính, chờ xác nhận giá DashScope × 0.7.",
  129. /* ── 文档页 ── */
  130. docs_h1:"Tài liệu", docs_sub:"Bắt đầu nhanh, API Reference và quy tắc tính phí.",
  131. docs_sidebar_start:"Bắt đầu nhanh", docs_sidebar_api:"API Reference", docs_sidebar_errors:"Mã lỗi", docs_sidebar_billing:"Tính phí",
  132. docs_start_h:"Bắt đầu nhanh", docs_start_p:"3 bước để gọi mô hình đầu tiên.",
  133. docs_start_s1:"Tạo tài khoản & nạp tiền", docs_start_s2:"Tạo API key (tiền tố dt_)", docs_start_s3:"Gọi API tương thích OpenAI",
  134. docs_api_h:"API Reference", docs_api_endpoint:"Endpoint", docs_api_models:"Danh sách mô hình", docs_api_models_p:"GET /v1/models — không cần xác thực.",
  135. docs_api_chat:"Chat Completions", docs_api_chat_p:"POST /v1/chat/completions — xác thực bằng Bearer API key. Hỗ trợ streaming SSE.",
  136. docs_err_h:"Mã lỗi", docs_err_401:"API key không hợp lệ", docs_err_402:"Số dư không đủ", docs_err_404:"Mô hình không tồn tại", docs_err_429:"Vượt giới hạn tốc độ",
  137. docs_bill_h:"Tính phí", docs_bill_p:"Phí = token × đơn giá (USD), quy đổi VND theo tỷ giá tại thời điểm nạp tiền. Lịch sử giao dịch trong Console.",
  138. code_copy:"Sao chép"
  139. },
  140. /* ═══════════ 英语 ═══════════ */
  141. en: {
  142. nav_models:"Models", nav_pricing:"Pricing", nav_docs:"Docs", nav_login:"Log in", nav_signup:"Get Started",
  143. crumb_home:"Home",
  144. hero_badge:"OpenAI Compatible · From 70% of China Price · Vietnam-First",
  145. hero_h1:"One Touch.", hero_h1_grad:"All AI.",
  146. hero_sub:"DoTouch.AI brings the power of Chinese frontier models — GLM 5.2, DeepSeek V4 and more — to developers and small businesses worldwide at unbelievably low prices. Same OpenAI API. 30% cheaper. Zero migration.",
  147. hero_cta1:"Start for Free", hero_cta2:"View Pricing",
  148. stat_models:"4+", stat_models_l:"Frontier models", stat_save:"30%", stat_save_l:"Cheaper than China price",
  149. stat_api:"100%", stat_api_l:"OpenAI API compatible", stat_pay:"6+", stat_pay_l:"Payment methods",
  150. models_kicker:"Models", models_h2:"Chinese Frontier Models, One API",
  151. models_p:"All models are served through Alibaba Cloud DashScope, fully OpenAI-compatible. Explore each model in detail.",
  152. model_link:"Details",
  153. price_in:"Input", price_out:"Output",
  154. pricing_kicker:"Pricing", pricing_h2:"Pay Only for What You Use",
  155. pricing_p:"Prepaid, metered per token. No subscription — top up anytime. Prices are 70% of the China domestic price, shown in USD & VND.",
  156. pt_model:"Model", pt_in:"Input / 1M tokens", pt_out:"Output / 1M tokens", pt_save:"You save",
  157. pricing_more:"View full pricing →",
  158. feat_kicker:"Why DoTouch", feat_h2:"Built for Developers, Priced for Everyone",
  159. f1_t:"Drop-in OpenAI Compatible", f1_d:"Change one line in your OpenAI SDK config and everything works.",
  160. f2_t:"70% of China Price", f2_d:"Chinese models at Chinese prices, paid in USD or VND.",
  161. f3_t:"Local Payments", f3_d:"MoMo, ZaloPay, Stripe, PayPal, Alipay and bank cards.",
  162. f4_t:"Vietnam-First Support", f4_d:"Vietnamese console, docs and support.",
  163. f5_t:"Low Latency, High Uptime", f5_d:"Hong Kong edge nodes with a direct line to upstream.",
  164. f6_t:"Transparent Usage", f6_d:"Per-request token & cost records, daily summaries.",
  165. pay_kicker:"Payments", pay_h2:"Pay Your Way", pay_card:"Bank Card",
  166. how_kicker:"Quickstart", how_h2:"Live in 3 Steps",
  167. s1_t:"Create your account", s1_d:"Sign up with email, top up any amount.",
  168. s2_t:"Generate an API key", s2_d:"One click in the console. Keys start with dt_.",
  169. s3_t:"Call the API", s3_d:"Point your OpenAI SDK at api.dotouch.ai. Done.",
  170. faq_kicker:"FAQ", faq_h2:"Questions, Answered",
  171. q1:"How does billing work?", a1:"Prepaid only. Top up credits, then each request is metered per token and deducted from your balance. No subscription, no surprise invoices.",
  172. q2:"Is it really OpenAI-compatible?", a2:"Yes. Same endpoints, request shapes, streaming (SSE) and error format. Point your existing OpenAI SDK at our base URL and you're done.",
  173. q3:"Which currencies can I pay in?", a3:"USD and VND display. Payments via MoMo, ZaloPay, Stripe, PayPal, Alipay and bank cards. Exchange rate applied at top-up time.",
  174. q4:"What models are available?", a4:"GLM 5.2, DeepSeek V4, DeepSeek V4 Pro, Qwen Max — with more being added continuously.",
  175. q5:"Is there a minimum top-up?", a5:"No. Start with any amount — even $1.",
  176. q6:"Is my data safe?", a6:"Your API calls are processed through Alibaba Cloud DashScope under applicable terms. We never train on your data.",
  177. cta_h2:"One touch. All AI. 30% less.", cta_p:"Join developers across Vietnam and the world.", cta_btn:"Create Free Account",
  178. rate_note:"Prices shown in USD",
  179. foot_p:"Affordable Chinese frontier AI for developers and small businesses worldwide.",
  180. foot_product:"Product", foot_console:"Console", foot_status:"Status", foot_dev:"Developers",
  181. foot_docs:"Documentation", foot_quickstart:"Quickstart", foot_support:"Support", foot_legal:"Legal",
  182. foot_tos:"Terms of Service", foot_privacy:"Privacy Policy", foot_refund:"Refund Policy",
  183. foot_made:"Open-Source World · AI for Everyone",
  184. chat_title:"Help & Support", chat_online:"Online", chat_hello:"Hi! How can we help you today?", chat_input:"Type a message...", chat_q_balance:"How do I top up?", chat_q_key:"How do I create an API key?", chat_q_model:"Which model should I pick?",
  185. auth_login_title:"Log In", auth_register_title:"Sign Up", auth_reset_title:"Reset Password",
  186. auth_email:"Email", auth_password:"Password", auth_confirm:"Confirm password", auth_new_pwd:"New password", auth_confirm_new:"Confirm new password",
  187. auth_code_label:"Verification code", auth_code_send:"Send code", auth_code_resend:"Resend ({s}s)", auth_code_note:"8-character code (A-Z, 0-9), valid for 15 minutes",
  188. auth_code_sent:"✓ Code sent to {email}. Enter it within 15 minutes.",
  189. auth_login_btn:"Log In", auth_register_btn:"Sign Up", auth_reset_btn:"Reset Password",
  190. auth_forgot:"Forgot password?", auth_to_register:"Sign up", auth_to_login:"Already have an account? Log in", auth_back_login:"Back to log in",
  191. auth_err_pwd:"Passwords do not match", auth_err_email:"Invalid email address", auth_err_code:"Code must be 8 characters (A-Z, 0-9)",
  192. nav_home:"Home", nav_docs_ops:"Docs", nav_console:"Console",
  193. c_overview:"Overview", c_keys:"API Keys", c_wallet:"Top Up", c_usage:"Usage",
  194. c_welcome:"Welcome back", c_balance:"Balance", c_today_req:"Requests today", c_today_tokens:"Tokens today", c_active_keys:"Active API Keys",
  195. c_usage_7d:"Usage · last 7 days", c_recent_tx:"Recent transactions", c_see_all:"View details →",
  196. c_create_key:"+ Create API Key", c_key_name:"Key name", c_key_expire:"Expires (optional)", c_key_create_btn:"+ Create",
  197. c_key_once:"⚠️ The key is shown only once after creation. Save it now.",
  198. c_t_name:"Name", c_t_key:"Key", c_t_status:"Status", c_t_last:"Last used", c_t_created:"Created", c_t_action:"Actions",
  199. c_rotate:"Rotate", c_revoke:"Revoke", c_reactivate:"Reactivate", c_delete:"Delete",
  200. c_security:"🔒 Keys are stored as SHA-256 hashes. Rotate = revoke + create new.",
  201. c_avail:"Available balance", c_month_topup:"Top-ups (this month)", c_select_amount:"Select top-up amount", c_pay_method:"Payment method", c_topup_now:"Top Up Now",
  202. c_deposit_history:"Top-up history", c_t_time:"Time", c_t_type:"Type", c_t_amount:"Amount", c_t_ref:"Reference",
  203. c_7days:"7 days", c_30days:"30 days", c_by_model:"By model (7 days)", c_requests:"Requests", c_cost:"Cost",
  204. c_total:"Overview",
  205. c_sub_today:"vs yesterday", c_key_meta:"1 revoked · 1 expiring", c_inout:"in 3.1M · out 1.1M", c_req_unit:"req",
  206. c_st_active:"active", c_st_expired:"expired", c_st_revoked:"revoked", c_st_success:"success", c_tx_usage:"usage", c_tx_deposit:"deposit",
  207. c_this_month:"this month", c_topup_sub:"2 transactions", c_tokens:"Tokens", c_usage_note:"Per-request details available at GET /v1/usage (paginated).",
  208. q_limits:"Limits", q_daily:"Daily", q_total:"Total", q_req:"Requests", q_cost:"Cost",
  209. q_alert_pct:"Alert at", q_edit:"Edit limits", q_save:"Save", q_unlimited:"Unlimited",
  210. q_progress:"Used", q_blocked:"Blocked", q_warning:"Approaching limit",
  211. q_banner:"Usage alert", q_banner_80:"You have reached 80% of your daily limit. Please review.",
  212. q_banner_100:"Limit exceeded — requests will be rejected (429).",
  213. q_quota_manage:"Quota management", q_over:"Over", q_ok:"OK", q_events:"Quota events",
  214. models_ph:"Search models...", filter_all:"All", filter_flagship:"Flagship", filter_value:"Best Value", filter_reasoning:"Reasoning", filter_enterprise:"Enterprise",
  215. m_col_model:"Model", m_col_vendor:"Vendor", m_col_ctx:"Context", m_col_in:"Input", m_col_out:"Output", m_col_action:"",
  216. m_glm_name:"GLM 5.2", m_glm_vendor:"Zhipu AI", m_glm_ctx:"128K", m_glm_short:"Flagship multimodal model. Reasoning, coding and agentic tasks.",
  217. m_dsv4_name:"DeepSeek V4", m_dsv4_vendor:"DeepSeek", m_dsv4_ctx:"1M", m_dsv4_short:"Open-weight reasoning powerhouse. Ideal for high-volume chat & RAG.",
  218. m_dsv4p_name:"DeepSeek V4 Pro", m_dsv4p_vendor:"DeepSeek", m_dsv4p_ctx:"1M", m_dsv4p_short:"Deep reasoning for complex math, logic and long-horizon planning.",
  219. m_qwen_name:"Qwen Max", m_qwen_vendor:"Alibaba", m_qwen_ctx:"256K", m_qwen_short:"Strongest general model. Multilingual & tool-calling ready.",
  220. m_see_detail:"View details →", m_ctx_tokens:"tokens",
  221. tag_flagship:"Flagship", tag_best:"Best Value", tag_reasoning:"Reasoning", tag_enterprise:"Enterprise",
  222. models_count:"models available",
  223. detail_bread:"Models", detail_overview:"Overview",
  224. detail_use_btn:"Start with this model",
  225. detail_spec:"Specifications", detail_spec_vendor:"Vendor", detail_spec_ctx:"Context window", detail_spec_out:"Max output", detail_spec_base:"BASE URL", detail_spec_rate:"Rate limit",
  226. detail_cap:"Capabilities", detail_cap_json:"JSON Output", detail_cap_tool:"Tool Calls", detail_cap_stream:"Streaming (SSE)", detail_cap_think:"Thinking mode",
  227. detail_pricing:"Pricing", detail_pricing_note:"Per 1M tokens · 70% of China price included",
  228. detail_price_in:"Input", detail_price_out:"Output",
  229. detail_code:"API Example", detail_code_tab_curl:"cURL", detail_code_tab_py:"Python SDK",
  230. detail_rel:"Related models", detail_rel_view:"View all models →",
  231. detail_billing:"Billing rules", detail_billing_p:"Cost = tokens × unit price, deducted from your prepaid balance. Prices may change; check this page for the latest.",
  232. spec_ok:"Supported", spec_no:"Not supported",
  233. price_h1:"Pricing", price_sub:"All prices are 70% of the China domestic price. Shown in USD and VND at the current rate.",
  234. price_th_model:"Model", price_th_in:"Input / 1M", price_th_out:"Output / 1M", price_th_save:"You save",
  235. price_rule:"Billing rules", price_rule_p:"Cost = tokens × unit price, deducted from balance. No subscription, no commitment. VND rate applied at top-up.",
  236. price_faq:"Pricing FAQ", price_note:"* Prices are placeholders pending DashScope × 0.7 confirmation.",
  237. docs_h1:"Documentation", docs_sub:"Quickstart, API reference and billing rules.",
  238. docs_sidebar_start:"Quickstart", docs_sidebar_api:"API Reference", docs_sidebar_errors:"Error Codes", docs_sidebar_billing:"Billing",
  239. docs_start_h:"Quickstart", docs_start_p:"3 steps to call your first model.",
  240. docs_start_s1:"Create account & top up", docs_start_s2:"Create an API key (dt_ prefix)", docs_start_s3:"Call the OpenAI-compatible API",
  241. docs_api_h:"API Reference", docs_api_endpoint:"Endpoint", docs_api_models:"List models", docs_api_models_p:"GET /v1/models — no auth required.",
  242. docs_api_chat:"Chat Completions", docs_api_chat_p:"POST /v1/chat/completions — Bearer API key auth. SSE streaming supported.",
  243. docs_err_h:"Error Codes", docs_err_401:"Invalid API key", docs_err_402:"Insufficient balance", docs_err_404:"Model not found", docs_err_429:"Rate limit exceeded",
  244. docs_bill_h:"Billing", docs_bill_p:"Cost = tokens × unit price (USD), converted to VND at top-up rate. Full transaction history in Console.",
  245. code_copy:"Copy"
  246. },
  247. /* ═══════════ 简体中文 ═══════════ */
  248. "zh-CN": {
  249. nav_models:"模型", nav_pricing:"定价", nav_docs:"文档", nav_login:"登录", nav_signup:"立即开始",
  250. crumb_home:"首页",
  251. hero_badge:"OpenAI 兼容 · 国内价 7 折 · 越南优先",
  252. hero_h1:"一点触达", hero_h1_grad:"全部 AI。",
  253. hero_sub:"DoTouch.AI 将中国前沿大模型——GLM 5.2、DeepSeek V4 等——以难以置信的低价带给全球开发者与中小企业。同样的 OpenAI API,便宜 30%,零迁移成本。",
  254. hero_cta1:"免费开始", hero_cta2:"查看定价",
  255. stat_models:"4+", stat_models_l:"前沿模型", stat_save:"30%", stat_save_l:"低于国内价格",
  256. stat_api:"100%", stat_api_l:"OpenAI API 兼容", stat_pay:"6+", stat_pay_l:"支付方式",
  257. models_kicker:"模型", models_h2:"中国前沿模型,一个 API",
  258. models_p:"所有模型经由阿里云百炼提供服务,完全兼容 OpenAI 格式。可查看每个模型的详细信息。",
  259. model_link:"详情",
  260. price_in:"输入", price_out:"输出",
  261. pricing_kicker:"定价", pricing_h2:"按用量付费",
  262. pricing_p:"预充值,按 token 计量。无订阅——随时充值。价格 = 国内价 7 折,以美元与越南盾双币种显示。",
  263. pt_model:"模型", pt_in:"输入 / 1M tokens", pt_out:"输出 / 1M tokens", pt_save:"节省",
  264. pricing_more:"查看完整定价 →",
  265. feat_kicker:"为什么选择 DoTouch", feat_h2:"为开发者而生,人人用得起",
  266. f1_t:"无缝兼容 OpenAI", f1_d:"改一行 OpenAI SDK 配置即可使用。",
  267. f2_t:"国内价 7 折", f2_d:"中国模型、中国价格,美元或越南盾支付。",
  268. f3_t:"本地化支付", f3_d:"MoMo、ZaloPay、Stripe、PayPal、Alipay 与银行卡。",
  269. f4_t:"越南优先支持", f4_d:"越南语控制台、文档与客服。",
  270. f5_t:"低延迟高可用", f5_d:"香港边缘节点直连上游容量。",
  271. f6_t:"用量透明", f6_d:"每次请求的 token 与费用记录、按日汇总。",
  272. pay_kicker:"支付", pay_h2:"按你的方式付款", pay_card:"银行卡",
  273. how_kicker:"快速开始", how_h2:"三步上线",
  274. s1_t:"创建账号", s1_d:"邮箱注册,任意金额充值。",
  275. s2_t:"生成 API Key", s2_d:"控制台一键生成,dt_ 前缀。",
  276. s3_t:"调用 API", s3_d:"把 OpenAI SDK 指向 api.dotouch.ai,完成。",
  277. faq_kicker:"常见问题", faq_h2:"常见问题解答",
  278. q1:"计费方式是什么?", a1:"仅预充值。充值后每次请求按 token 计量并从余额扣除。无订阅、无意外账单。",
  279. q2:"真的兼容 OpenAI 吗?", a2:"是的。相同的端点、请求结构、流式(SSE)与错误格式。现有 OpenAI SDK 只需换 base URL。",
  280. q3:"支持哪些币种?", a3:"支持美元与越南盾显示。支付支持 MoMo、ZaloPay、Stripe、PayPal、Alipay 与银行卡,按充值时的汇率结算。",
  281. q4:"有哪些模型?", a4:"GLM 5.2、DeepSeek V4、DeepSeek V4 Pro、Qwen Max——更多模型持续上架中。",
  282. q5:"有最低充值限制吗?", a5:"没有。任意金额起步——哪怕 $1。",
  283. q6:"我的数据安全吗?", a6:"你的 API 调用经由阿里云百炼处理并遵守适用条款。我们绝不用你的数据训练模型。",
  284. cta_h2:"一点触达。全部 AI。省 30%。", cta_p:"加入越南及全球开发者的 DoTouch.AI 社区。", cta_btn:"免费创建账号",
  285. rate_note:"参考汇率:1 USD ≈ ¥7.20(充值时刻自动更新)",
  286. foot_p:"为全球开发者与中小企业提供平价中国前沿 AI。",
  287. foot_product:"产品", foot_console:"控制台", foot_status:"状态", foot_dev:"开发者",
  288. foot_docs:"文档", foot_quickstart:"快速开始", foot_support:"支持", foot_legal:"法律",
  289. foot_tos:"服务条款", foot_privacy:"隐私政策", foot_refund:"退款政策",
  290. foot_made:"开源世界 · 算力普惠",
  291. chat_title:"帮助与支持", chat_online:"在线", chat_hello:"你好!有什么可以帮你?", chat_input:"输入消息...", chat_q_balance:"如何充值?", chat_q_key:"如何创建 API Key?", chat_q_model:"该选哪个模型?",
  292. auth_login_title:"登录", auth_register_title:"注册账号", auth_reset_title:"重置密码",
  293. auth_email:"邮箱", auth_password:"密码", auth_confirm:"确认密码", auth_new_pwd:"新密码", auth_confirm_new:"确认新密码",
  294. auth_code_label:"验证码", auth_code_send:"发送验证码", auth_code_resend:"重新发送 ({s}s)", auth_code_note:"验证码为 8 位大写字母和数字,15 分钟内有效",
  295. auth_code_sent:"✓ 验证码已发送至 {email},请在 15 分钟内输入。",
  296. auth_login_btn:"登录", auth_register_btn:"注册", auth_reset_btn:"重置密码",
  297. auth_forgot:"忘记密码?", auth_to_register:"注册账号", auth_to_login:"已有账号?去登录", auth_back_login:"返回登录",
  298. auth_err_pwd:"两次输入的密码不一致", auth_err_email:"邮箱格式不正确", auth_err_code:"验证码须为 8 位大写字母和数字",
  299. nav_home:"首页", nav_docs_ops:"操作文档", nav_console:"控制台",
  300. c_overview:"总览", c_keys:"API Keys", c_wallet:"充值", c_usage:"用量",
  301. c_welcome:"欢迎回来", c_balance:"余额", c_today_req:"今日请求", c_today_tokens:"今日 Token", c_active_keys:"活跃 API Key",
  302. c_usage_7d:"近 7 日用量", c_recent_tx:"最近交易", c_see_all:"查看详情 →",
  303. c_create_key:"+ 创建 API Key", c_key_name:"Key 名称", c_key_expire:"过期时间(可选)", c_key_create_btn:"+ 创建",
  304. c_key_once:"⚠️ Key 创建后仅显示一次,请立即保存。",
  305. c_t_name:"名称", c_t_key:"Key", c_t_status:"状态", c_t_last:"最近使用", c_t_created:"创建时间", c_t_action:"操作",
  306. c_rotate:"轮换", c_revoke:"撤销", c_reactivate:"重新激活", c_delete:"删除",
  307. c_security:"🔒 Key 以 SHA-256 哈希存储。轮换 = 撤销 + 新建。",
  308. c_avail:"可用余额", c_month_topup:"本月充值", c_select_amount:"选择充值金额", c_pay_method:"支付方式", c_topup_now:"立即充值",
  309. c_deposit_history:"充值历史", c_t_time:"时间", c_t_type:"类型", c_t_amount:"金额", c_t_ref:"参考",
  310. c_7days:"7 天", c_30days:"30 天", c_by_model:"按模型(7 天)", c_requests:"请求数", c_cost:"费用",
  311. c_total:"总览",
  312. c_sub_today:"较昨日", c_key_meta:"1 已撤销 · 1 即将过期", c_inout:"输入 3.1M · 输出 1.1M", c_req_unit:"次",
  313. c_st_active:"正常", c_st_expired:"已过期", c_st_revoked:"已撤销", c_st_success:"成功", c_tx_usage:"用量扣费", c_tx_deposit:"充值",
  314. c_this_month:"本月", c_topup_sub:"2 笔交易", c_tokens:"Token", c_usage_note:"单次请求明细见 GET /v1/usage(分页)。",
  315. q_limits:"用量限额", q_daily:"每日", q_total:"总量", q_req:"请求数", q_cost:"费用",
  316. q_alert_pct:"预警阈值", q_edit:"配置限额", q_save:"保存", q_unlimited:"不限",
  317. q_progress:"已用", q_blocked:"已超限", q_warning:"接近限额",
  318. q_banner:"用量提醒", q_banner_80:"已达到每日限额的 80%,请注意控制用量。",
  319. q_banner_100:"已超出限额,请求将被拒绝(429)。",
  320. q_quota_manage:"限额管理", q_over:"超限", q_ok:"正常", q_events:"限额事件",
  321. models_ph:"搜索模型...", filter_all:"全部", filter_flagship:"旗舰", filter_value:"性价比", filter_reasoning:"深度推理", filter_enterprise:"企业级",
  322. m_col_model:"模型", m_col_vendor:"供应商", m_col_ctx:"上下文", m_col_in:"输入", m_col_out:"输出", m_col_action:"",
  323. m_glm_name:"GLM 5.2", m_glm_vendor:"智谱 AI", m_glm_ctx:"128K", m_glm_short:"旗舰多模态模型。推理、编程与智能体任务。",
  324. m_dsv4_name:"DeepSeek V4", m_dsv4_vendor:"DeepSeek", m_dsv4_ctx:"1M", m_dsv4_short:"开源推理引擎。适合高并发对话与 RAG 管线。",
  325. m_dsv4p_name:"DeepSeek V4 Pro", m_dsv4p_vendor:"DeepSeek", m_dsv4p_ctx:"1M", m_dsv4p_short:"深度推理模式,擅长复杂数学、逻辑与长程规划。",
  326. m_qwen_name:"Qwen Max", m_qwen_vendor:"阿里云", m_qwen_ctx:"256K", m_qwen_short:"阿里最强通用模型。多语言与工具调用就绪。",
  327. m_see_detail:"查看详情 →", m_ctx_tokens:"tokens",
  328. tag_flagship:"旗舰", tag_best:"性价比之王", tag_reasoning:"深度推理", tag_enterprise:"企业级",
  329. models_count:"个模型可用",
  330. detail_bread:"模型", detail_overview:"概览",
  331. detail_use_btn:"开始使用此模型",
  332. detail_spec:"技术规格", detail_spec_vendor:"供应商", detail_spec_ctx:"上下文长度", detail_spec_out:"最大输出", detail_spec_base:"BASE URL", detail_spec_rate:"限流",
  333. detail_cap:"能力", detail_cap_json:"JSON 输出", detail_cap_tool:"工具调用", detail_cap_stream:"流式输出 (SSE)", detail_cap_think:"思考模式",
  334. detail_pricing:"价格", detail_pricing_note:"每 1M tokens · 已含国内价 7 折",
  335. detail_price_in:"输入", detail_price_out:"输出",
  336. detail_code:"API 示例", detail_code_tab_curl:"cURL", detail_code_tab_py:"Python SDK",
  337. detail_rel:"相关模型", detail_rel_view:"查看全部模型 →",
  338. detail_billing:"扣费规则", detail_billing_p:"费用 = token 消耗 × 单价,从预充值余额直接扣除。价格可能变动,请以本页最新信息为准。",
  339. spec_ok:"支持", spec_no:"不支持",
  340. price_h1:"定价", price_sub:"所有价格 = 国内价 7 折。以美元与越南盾按当前汇率显示。",
  341. price_th_model:"模型", price_th_in:"输入 / 1M", price_th_out:"输出 / 1M", price_th_save:"节省",
  342. price_rule:"扣费规则", price_rule_p:"费用 = token × 单价,从余额扣除。无订阅、无承诺。越南盾按充值时刻汇率结算。",
  343. price_faq:"价格常见问题", price_note:"* 价格为占位值,待百炼 × 0.7 确认。",
  344. docs_h1:"文档", docs_sub:"快速开始、API 参考与计费规则。",
  345. docs_sidebar_start:"快速开始", docs_sidebar_api:"API 参考", docs_sidebar_errors:"错误码", docs_sidebar_billing:"计费",
  346. docs_start_h:"快速开始", docs_start_p:"三步调用你的第一个模型。",
  347. docs_start_s1:"创建账号并充值", docs_start_s2:"创建 API Key(dt_ 前缀)", docs_start_s3:"调用 OpenAI 兼容 API",
  348. docs_api_h:"API 参考", docs_api_endpoint:"端点", docs_api_models:"模型列表", docs_api_models_p:"GET /v1/models — 无需认证。",
  349. docs_api_chat:"Chat Completions", docs_api_chat_p:"POST /v1/chat/completions — Bearer API Key 认证,支持 SSE 流式。",
  350. docs_err_h:"错误码", docs_err_401:"API Key 无效", docs_err_402:"余额不足", docs_err_404:"模型不存在", docs_err_429:"超过限流",
  351. docs_bill_h:"计费", docs_bill_p:"费用 = token × 单价(美元),按充值时刻汇率换算越南盾。控制台可查完整交易记录。",
  352. code_copy:"复制"
  353. },
  354. /* ═══════════ 繁体中文 ═══════════ */
  355. "zh-TW": {
  356. nav_models:"模型", nav_pricing:"定價", nav_docs:"文件", nav_login:"登入", nav_signup:"立即開始",
  357. crumb_home:"首頁",
  358. hero_badge:"OpenAI 相容 · 中國國內價 7 折 · 越南優先",
  359. hero_h1:"一點觸達", hero_h1_grad:"所有 AI。",
  360. hero_sub:"DoTouch.AI 將中國前沿大模型——GLM 5.2、DeepSeek V4 等——以難以置信的低價帶給全球開發者與中小企業。同樣的 OpenAI API,便宜 30%,零遷移成本。",
  361. hero_cta1:"免費開始", hero_cta2:"查看定價",
  362. stat_models:"4+", stat_models_l:"前沿模型", stat_save:"30%", stat_save_l:"低於中國國內價格",
  363. stat_api:"100%", stat_api_l:"OpenAI API 相容", stat_pay:"6+", stat_pay_l:"支付方式",
  364. models_kicker:"模型", models_h2:"中國前沿模型,一個 API",
  365. models_p:"所有模型經由阿里雲百煉提供服務,完全相容 OpenAI 格式。可查看每個模型的詳細資訊。",
  366. model_link:"詳情",
  367. price_in:"輸入", price_out:"輸出",
  368. pricing_kicker:"定價", pricing_h2:"按用量付費",
  369. pricing_p:"預儲值,按 token 計量。無訂閱——隨時儲值。價格 = 中國國內價 7 折,以美元與越南盾雙幣種顯示。",
  370. pt_model:"模型", pt_in:"輸入 / 1M tokens", pt_out:"輸出 / 1M tokens", pt_save:"節省",
  371. pricing_more:"查看完整定價 →",
  372. feat_kicker:"為什麼選擇 DoTouch", feat_h2:"為開發者而生,人人用得起",
  373. f1_t:"無縫相容 OpenAI", f1_d:"改一行 OpenAI SDK 設定即可使用。",
  374. f2_t:"中國國內價 7 折", f2_d:"中國模型、中國價格,美元或越南盾支付。",
  375. f3_t:"本地化支付", f3_d:"MoMo、ZaloPay、Stripe、PayPal、Alipay 與銀行卡。",
  376. f4_t:"越南優先支援", f4_d:"越南語控制台、文件與客服。",
  377. f5_t:"低延遲高可用", f5_d:"香港邊緣節點直連上游容量。",
  378. f6_t:"用量透明", f6_d:"每次請求的 token 與費用記錄、按日彙總。",
  379. pay_kicker:"支付", pay_h2:"按你的方式付款", pay_card:"銀行卡",
  380. how_kicker:"快速開始", how_h2:"三步上線",
  381. s1_t:"建立帳號", s1_d:"信箱註冊,任意金額儲值。",
  382. s2_t:"產生 API Key", s2_d:"控制台一鍵產生,dt_ 前綴。",
  383. s3_t:"呼叫 API", s3_d:"把 OpenAI SDK 指向 api.dotouch.ai,完成。",
  384. faq_kicker:"常見問題", faq_h2:"常見問題解答",
  385. q1:"計費方式是什麼?", a1:"僅預儲值。儲值後每次請求按 token 計量並從餘額扣除。無訂閱、無意外帳單。",
  386. q2:"真的相容 OpenAI 嗎?", a2:"是的。相同的端點、請求結構、串流(SSE)與錯誤格式。現有 OpenAI SDK 只需更換 base URL。",
  387. q3:"支援哪些幣種?", a3:"支援美元與越南盾顯示。支付支援 MoMo、ZaloPay、Stripe、PayPal、Alipay 與銀行卡,按儲值時的匯率結算。",
  388. q4:"有哪些模型?", a4:"GLM 5.2、DeepSeek V4、DeepSeek V4 Pro、Qwen Max——更多模型持續上架中。",
  389. q5:"有最低儲值限制嗎?", a5:"沒有。任意金額起步——哪怕 $1。",
  390. q6:"我的資料安全嗎?", a6:"你的 API 呼叫經由阿里雲百煉處理並遵守適用條款。我們絕不用你的資料訓練模型。",
  391. cta_h2:"一點觸達。所有 AI。省 30%。", cta_p:"加入越南及全球開發者的 DoTouch.AI 社群。", cta_btn:"免費建立帳號",
  392. rate_note:"參考匯率:1 USD ≈ ¥7.20(儲值時刻自動更新)",
  393. foot_p:"為全球開發者與中小企業提供平價中國前沿 AI。",
  394. foot_product:"產品", foot_console:"控制台", foot_status:"狀態", foot_dev:"開發者",
  395. foot_docs:"文件", foot_quickstart:"快速開始", foot_support:"支援", foot_legal:"法律",
  396. foot_tos:"服務條款", foot_privacy:"隱私政策", foot_refund:"退款政策",
  397. foot_made:"開源世界 · 算力普惠",
  398. chat_title:"幫助與支援", chat_online:"線上", chat_hello:"你好!有什麼可以幫你?", chat_input:"輸入訊息...", chat_q_balance:"如何儲值?", chat_q_key:"如何建立 API Key?", chat_q_model:"該選哪個模型?",
  399. auth_login_title:"登入", auth_register_title:"註冊帳號", auth_reset_title:"重設密碼",
  400. auth_email:"信箱", auth_password:"密碼", auth_confirm:"確認密碼", auth_new_pwd:"新密碼", auth_confirm_new:"確認新密碼",
  401. auth_code_label:"驗證碼", auth_code_send:"發送驗證碼", auth_code_resend:"重新發送 ({s}s)", auth_code_note:"驗證碼為 8 位大寫字母和數字,15 分鐘內有效",
  402. auth_code_sent:"✓ 驗證碼已發送至 {email},請在 15 分鐘內輸入。",
  403. auth_login_btn:"登入", auth_register_btn:"註冊", auth_reset_btn:"重設密碼",
  404. auth_forgot:"忘記密碼?", auth_to_register:"註冊帳號", auth_to_login:"已有帳號?去登入", auth_back_login:"返回登入",
  405. auth_err_pwd:"兩次輸入的密碼不一致", auth_err_email:"信箱格式不正確", auth_err_code:"驗證碼須為 8 位大寫字母和數字",
  406. nav_home:"首頁", nav_docs_ops:"操作文件", nav_console:"控制台",
  407. c_overview:"總覽", c_keys:"API Keys", c_wallet:"儲值", c_usage:"用量",
  408. c_welcome:"歡迎回來", c_balance:"餘額", c_today_req:"今日請求", c_today_tokens:"今日 Token", c_active_keys:"活躍 API Key",
  409. c_usage_7d:"近 7 日用量", c_recent_tx:"最近交易", c_see_all:"查看詳情 →",
  410. c_create_key:"+ 建立 API Key", c_key_name:"Key 名稱", c_key_expire:"過期時間(可選)", c_key_create_btn:"+ 建立",
  411. c_key_once:"⚠️ Key 建立後僅顯示一次,請立即儲存。",
  412. c_t_name:"名稱", c_t_key:"Key", c_t_status:"狀態", c_t_last:"最近使用", c_t_created:"建立時間", c_t_action:"操作",
  413. c_rotate:"輪換", c_revoke:"撤銷", c_reactivate:"重新啟用", c_delete:"刪除",
  414. c_security:"🔒 Key 以 SHA-256 雜湊儲存。輪換 = 撤銷 + 新建。",
  415. c_avail:"可用餘額", c_month_topup:"本月儲值", c_select_amount:"選擇儲值金額", c_pay_method:"支付方式", c_topup_now:"立即儲值",
  416. c_deposit_history:"儲值歷史", c_t_time:"時間", c_t_type:"類型", c_t_amount:"金額", c_t_ref:"參考",
  417. c_7days:"7 天", c_30days:"30 天", c_by_model:"按模型(7 天)", c_requests:"請求數", c_cost:"費用",
  418. c_total:"總覽",
  419. c_sub_today:"較昨日", c_key_meta:"1 已撤銷 · 1 即將過期", c_inout:"輸入 3.1M · 輸出 1.1M", c_req_unit:"次",
  420. c_st_active:"正常", c_st_expired:"已過期", c_st_revoked:"已撤銷", c_st_success:"成功", c_tx_usage:"用量扣費", c_tx_deposit:"儲值",
  421. c_this_month:"本月", c_topup_sub:"2 筆交易", c_tokens:"Token", c_usage_note:"單次請求明細見 GET /v1/usage(分頁)。",
  422. q_limits:"用量限額", q_daily:"每日", q_total:"總量", q_req:"請求數", q_cost:"費用",
  423. q_alert_pct:"預警閾值", q_edit:"設定限額", q_save:"儲存", q_unlimited:"不限",
  424. q_progress:"已用", q_blocked:"已超限", q_warning:"接近限額",
  425. q_banner:"用量提醒", q_banner_80:"已達到每日限額的 80%,請注意控制用量。",
  426. q_banner_100:"已超出限額,請求將被拒絕(429)。",
  427. q_quota_manage:"限額管理", q_over:"超限", q_ok:"正常", q_events:"限額事件",
  428. models_ph:"搜尋模型...", filter_all:"全部", filter_flagship:"旗艦", filter_value:"性價比", filter_reasoning:"深度推理", filter_enterprise:"企業級",
  429. m_col_model:"模型", m_col_vendor:"供應商", m_col_ctx:"上下文", m_col_in:"輸入", m_col_out:"輸出", m_col_action:"",
  430. m_glm_name:"GLM 5.2", m_glm_vendor:"智譜 AI", m_glm_ctx:"128K", m_glm_short:"旗艦多模態模型。推理、程式設計與智慧體任務。",
  431. m_dsv4_name:"DeepSeek V4", m_dsv4_vendor:"DeepSeek", m_dsv4_ctx:"1M", m_dsv4_short:"開源推理引擎。適合高並發對話與 RAG 管線。",
  432. m_dsv4p_name:"DeepSeek V4 Pro", m_dsv4p_vendor:"DeepSeek", m_dsv4p_ctx:"1M", m_dsv4p_short:"深度推理模式,擅長複雜數學、邏輯與長程規劃。",
  433. m_qwen_name:"Qwen Max", m_qwen_vendor:"阿里雲", m_qwen_ctx:"256K", m_qwen_short:"阿里最強通用模型。多語言與工具呼叫就緒。",
  434. m_see_detail:"查看詳情 →", m_ctx_tokens:"tokens",
  435. tag_flagship:"旗艦", tag_best:"性價比之王", tag_reasoning:"深度推理", tag_enterprise:"企業級",
  436. models_count:"個模型可用",
  437. detail_bread:"模型", detail_overview:"概覽",
  438. detail_use_btn:"開始使用此模型",
  439. detail_spec:"技術規格", detail_spec_vendor:"供應商", detail_spec_ctx:"上下文長度", detail_spec_out:"最大輸出", detail_spec_base:"BASE URL", detail_spec_rate:"限流",
  440. detail_cap:"能力", detail_cap_json:"JSON 輸出", detail_cap_tool:"工具呼叫", detail_cap_stream:"串流輸出 (SSE)", detail_cap_think:"思考模式",
  441. detail_pricing:"價格", detail_pricing_note:"每 1M tokens · 已含中國國內價 7 折",
  442. detail_price_in:"輸入", detail_price_out:"輸出",
  443. detail_code:"API 範例", detail_code_tab_curl:"cURL", detail_code_tab_py:"Python SDK",
  444. detail_rel:"相關模型", detail_rel_view:"查看全部模型 →",
  445. detail_billing:"扣費規則", detail_billing_p:"費用 = token 消耗 × 單價,從預儲值餘額直接扣除。價格可能變動,請以本頁最新資訊為準。",
  446. spec_ok:"支援", spec_no:"不支援",
  447. price_h1:"定價", price_sub:"所有價格 = 中國國內價 7 折。以美元與越南盾按當前匯率顯示。",
  448. price_th_model:"模型", price_th_in:"輸入 / 1M", price_th_out:"輸出 / 1M", price_th_save:"節省",
  449. price_rule:"扣費規則", price_rule_p:"費用 = token × 單價,從餘額扣除。無訂閱、無承諾。越南盾按儲值時刻匯率結算。",
  450. price_faq:"價格常見問題", price_note:"* 價格為佔位值,待百煉 × 0.7 確認。",
  451. docs_h1:"文件", docs_sub:"快速開始、API 參考與計費規則。",
  452. docs_sidebar_start:"快速開始", docs_sidebar_api:"API 參考", docs_sidebar_errors:"錯誤碼", docs_sidebar_billing:"計費",
  453. docs_start_h:"快速開始", docs_start_p:"三步呼叫你的第一個模型。",
  454. docs_start_s1:"建立帳號並儲值", docs_start_s2:"建立 API Key(dt_ 前綴)", docs_start_s3:"呼叫 OpenAI 相容 API",
  455. docs_api_h:"API 參考", docs_api_endpoint:"端點", docs_api_models:"模型列表", docs_api_models_p:"GET /v1/models — 無需認證。",
  456. docs_api_chat:"Chat Completions", docs_api_chat_p:"POST /v1/chat/completions — Bearer API Key 認證,支援 SSE 串流。",
  457. docs_err_h:"錯誤碼", docs_err_401:"API Key 無效", docs_err_402:"餘額不足", docs_err_404:"模型不存在", docs_err_429:"超過限流",
  458. docs_bill_h:"計費", docs_bill_p:"費用 = token × 單價(美元),按儲值時刻匯率換算越南盾。控制台可查完整交易記錄。",
  459. code_copy:"複製"
  460. }
  461. };
  462. /* ── 切换器:默认 vi ── */
  463. function setLang(lang) {
  464. const dict = I18N[lang];
  465. document.querySelectorAll('[data-i18n]').forEach(el => {
  466. const key = el.dataset.i18n;
  467. if (dict && dict[key] !== undefined) el.textContent = dict[key];
  468. });
  469. document.querySelectorAll('.lang-btn').forEach(b => b.classList.toggle('active', b.dataset.lang === lang));
  470. if (document.documentElement) document.documentElement.lang = lang;
  471. applyCurrency();
  472. try { localStorage.setItem('dotouch_lang', lang); } catch(e){}
  473. }
  474. (function init() {
  475. let saved = 'vi'; // 默认越南语
  476. try { saved = localStorage.getItem('dotouch_lang') || 'vi'; } catch(e){}
  477. document.querySelectorAll('.lang-btn').forEach(b => b.addEventListener('click', () => setLang(b.dataset.lang)));
  478. document.querySelectorAll('.faq-q').forEach(q => q.addEventListener('click', () => q.parentElement.classList.toggle('open')));
  479. const fab = document.getElementById('supportFab');
  480. const panel = document.getElementById('supportPanel');
  481. if (fab && panel) fab.addEventListener('click', () => panel.classList.toggle('open'));
  482. setLang(saved);
  483. /* 认证弹窗 */
  484. const modal = document.getElementById('authModal');
  485. if (modal) {
  486. const views = { login: document.getElementById('viewLogin'), register: document.getElementById('viewRegister'), reset: document.getElementById('viewReset') };
  487. window.showAuth = function (view) {
  488. Object.entries(views).forEach(([k, el]) => { if (el) el.hidden = k !== view; });
  489. modal.classList.add('open');
  490. document.body.style.overflow = 'hidden';
  491. };
  492. const closeAuth = () => { modal.classList.remove('open'); document.body.style.overflow = ''; };
  493. document.querySelectorAll('[data-open-auth]').forEach(b => b.addEventListener('click', () => showAuth(b.dataset.openAuth)));
  494. document.querySelectorAll('[data-auth-view]').forEach(a => a.addEventListener('click', () => showAuth(a.dataset.authView)));
  495. modal.querySelector('.modal-close')?.addEventListener('click', closeAuth);
  496. modal.addEventListener('click', e => { if (e.target === modal) closeAuth(); });
  497. /* 验证码 8 格输入:自动跳格 + 转大写 + 限制 A-Z0-9 */
  498. modal.querySelectorAll('.code-cell').forEach(cell => {
  499. cell.addEventListener('input', () => {
  500. cell.value = cell.value.toUpperCase().replace(/[^A-Z0-9]/g, '').slice(0, 1);
  501. if (cell.value) { const n = cell.nextElementSibling; if (n && n.classList.contains('code-cell')) n.focus(); }
  502. });
  503. cell.addEventListener('keydown', e => {
  504. if (e.key === 'Backspace' && !cell.value) { const p = cell.previousElementSibling; if (p && p.classList.contains('code-cell')) p.focus(); }
  505. });
  506. cell.addEventListener('paste', e => {
  507. e.preventDefault();
  508. const text = (e.clipboardData.getData('text') || '').toUpperCase().replace(/[^A-Z0-9]/g, '').slice(0, 8);
  509. const cells = modal.querySelectorAll('.code-cell');
  510. [...text].forEach((ch, i) => { if (cells[i]) cells[i].value = ch; });
  511. if (cells[text.length]) cells[text.length].focus();
  512. });
  513. });
  514. /* 发送验证码:提示 15 分钟有效 + 60 秒重发倒计时 */
  515. modal.querySelectorAll('[data-send-code]').forEach(btn => {
  516. btn.addEventListener('click', () => {
  517. const row = btn.closest('.code-row');
  518. const emailInput = row.parentElement.querySelector('input[type="email"]');
  519. const note = row.parentElement.querySelector('.auth-note[data-code-note]');
  520. const email = emailInput ? emailInput.value.trim() : '';
  521. const dict = I18N[document.documentElement.lang] || I18N.en;
  522. if (note) {
  523. if (!email) { note.textContent = dict.auth_err_email; note.className = 'auth-note err'; return; }
  524. note.textContent = dict.auth_code_sent.replace('{email}', email);
  525. note.className = 'auth-note ok';
  526. }
  527. let s = 60;
  528. btn.disabled = true;
  529. const t = setInterval(() => {
  530. s--;
  531. btn.textContent = dict.auth_code_resend.replace('{s}', s);
  532. if (s <= 0) { clearInterval(t); btn.disabled = false; btn.textContent = dict.auth_code_send; }
  533. }, 1000);
  534. });
  535. });
  536. /* ── 演示模式:真实登录/注册(对接 Docker 演示 API) ── */
  537. const DEMO_TOKEN_KEY = 'dotouch_demo_token';
  538. const DEMO_USER_KEY = 'dotouch_demo_user';
  539. const authFetch = async (path, body) => {
  540. try {
  541. const resp = await fetch(DEMO_API + path, {
  542. method: 'POST',
  543. headers: { 'Content-Type': 'application/json' },
  544. body: JSON.stringify(body),
  545. });
  546. const data = await resp.json().catch(() => ({}));
  547. return { ok: resp.ok, status: resp.status, data };
  548. } catch {
  549. return { ok: false, status: 0, data: { message: '无法连接演示 API(请确认 docker compose -f docker-compose.demo.yml up 已启动)' } };
  550. }
  551. };
  552. const applyLoginState = () => {
  553. const email = localStorage.getItem(DEMO_USER_KEY);
  554. document.querySelectorAll('[data-open-auth="login"]').forEach(a => {
  555. if (email) {
  556. a.textContent = email.split('@')[0];
  557. a.style.pointerEvents = 'none';
  558. a.style.opacity = '.7';
  559. }
  560. });
  561. document.querySelectorAll('[data-open-auth="register"]').forEach(a => {
  562. a.textContent = email ? '✓ 已登录' : (dict.nav_signup || a.textContent);
  563. });
  564. const banner = document.getElementById('demoLoginBanner');
  565. if (banner) banner.textContent = email ? '✅ 演示环境已登录:' + email : '';
  566. };
  567. try { applyLoginState(); } catch(e){}
  568. /* 登录提交 */
  569. document.querySelectorAll('#viewLogin .btn-primary').forEach(btn => {
  570. btn.addEventListener('click', async () => {
  571. const view = document.getElementById('viewLogin');
  572. const email = view.querySelector('input[type="email"]').value.trim();
  573. const pwd = view.querySelector('input[type="password"]').value;
  574. const err = view.querySelector('.auth-error');
  575. if (!email || !pwd) { err.textContent = dict.auth_err_email; err.classList.add('show'); return; }
  576. const r = await authFetch('/auth/login', { email, password: pwd });
  577. if (r.ok && r.data.accessToken) {
  578. localStorage.setItem(DEMO_TOKEN_KEY, r.data.accessToken);
  579. localStorage.setItem(DEMO_USER_KEY, email);
  580. err.classList.remove('show');
  581. applyLoginState();
  582. closeAuth();
  583. alert('✅ 登录成功!演示环境已登录:' + email + '\n\n现在可以体验:创建 API Key / 充值 / 调用模型');
  584. location.href = '../console-v1.0.0/user-console.html';
  585. } else {
  586. err.textContent = r.data.message || '登录失败';
  587. err.classList.add('show');
  588. }
  589. });
  590. });
  591. /* 注册:发送验证码 → 提示查看演示容器日志 */
  592. document.querySelectorAll('#viewRegister [data-send-code]').forEach(btn => {
  593. btn.addEventListener('click', async () => {
  594. const view = document.getElementById('viewRegister');
  595. const email = view.querySelector('input[type="email"]').value.trim();
  596. const note = view.querySelector('[data-code-note]');
  597. if (!email) { note.textContent = dict.auth_err_email; note.className = 'auth-note err'; return; }
  598. const r = await authFetch('/auth/send-code', { email, purpose: 'register' });
  599. note.textContent = r.ok
  600. ? '📨 验证码已发送(演示环境:docker logs demo-dotouch-api 查看)'
  601. : (r.data.message || '发送失败');
  602. note.className = r.ok ? 'auth-note ok' : 'auth-note err';
  603. });
  604. });
  605. /* 注册提交 */
  606. document.querySelectorAll('#viewRegister .btn-primary').forEach(btn => {
  607. btn.addEventListener('click', async () => {
  608. const view = document.getElementById('viewRegister');
  609. const email = view.querySelector('input[type="email"]').value.trim();
  610. const pwd = view.querySelectorAll('input[type="password"]')[0].value;
  611. const pwd2 = view.querySelectorAll('input[type="password"]')[1].value;
  612. const err = view.querySelector('.auth-error');
  613. const code = view.querySelectorAll('.code-cell');
  614. const codeVal = [...code].map(c => c.value).join('');
  615. if (pwd !== pwd2) { err.textContent = dict.auth_err_pwd; err.classList.add('show'); return; }
  616. if (codeVal.length !== 8) { err.textContent = dict.auth_err_code; err.classList.add('show'); return; }
  617. const r = await authFetch('/auth/register', { email, password: pwd, code: codeVal });
  618. if (r.ok) {
  619. err.classList.remove('show');
  620. alert('✅ 注册成功!请使用新账号登录');
  621. showAuth('login');
  622. } else {
  623. err.textContent = r.data.message || '注册失败';
  624. err.classList.add('show');
  625. }
  626. });
  627. });
  628. }
  629. })();