Skip to content

Latest commit

 

History

History
31 lines (19 loc) · 2.38 KB

File metadata and controls

31 lines (19 loc) · 2.38 KB

Interface languages

CometAPI Connect includes English, Traditional Chinese, Japanese, Korean, French, German, Spanish, Italian, Portuguese, Russian, Arabic, Thai, Vietnamese, Indonesian, Turkish, and Polish interface catalogs.

On first use, the interface matches navigator.languages in preference order. Regional variants use the corresponding supported language; Chinese variants use Traditional Chinese. Unsupported preferences fall back to English. Arabic uses a right-to-left layout, while configuration paths and input values retain left-to-right formatting.

The language selector supports a manual choice or automatic browser matching. A manual choice is remembered in the cometapi_locale cookie for one year and survives local port changes. Switching back to browser language removes that preference. Language changes preserve the API key field, selected applications, and configuration values.

Translation resources are bundled with the app and require no external translation service. Product names, model IDs, commands, paths, configuration values, and unrecognized diagnostics retain their original text. User input is never translated.

Maintain the catalogs

Resources live in cometapi_helper/static/locales/*.json. English source strings are keys, and every locale must contain the same keys. Preserve placeholders such as {count} and literal URLs. When adding or changing user-facing strings, update all catalogs. The runtime inserts translations as text rather than HTML.

Run checks

With the development environment activated and Node.js 22 installed:

python -m pytest -q
node tests/i18n.test.cjs
npm install --no-save --package-lock=false playwright@1.62.1
npx playwright install chromium
node tests/i18n-browser.cjs

On Windows with Edge installed, set $env:BROWSER_CHANNEL = "msedge" before the browser test; Chromium installation is then unnecessary. PYTHON_BIN can select a virtual environment's Python executable.

Browser checks use a local fixture server. They cover every locale, automatic detection, manual persistence, preserved form state, preview/apply/restore flows, narrow layouts, and the absence of external requests. They do not modify real application configurations or contact model providers.

The frozen-build self-test checks that the localization runtime and all 16 catalogs are included. Browser checks and packaging checks complement native platform acceptance.