Internationalization
Multi-language support with locale routing and use-intl.
Raypx supports multiple languages through the app's internationalization system:
- App i18n -- handles the main application UI translations using
@raypx/i18nanduse-intl.
Supported Languages
| Language | App Locale |
|---|---|
| English | en-US |
| Chinese (Simplified) | zh-CN |
App Locale Routing
The main application uses a URL-based locale prefix for all pages:
/en-US/dashboard -- English
/zh-CN/dashboard -- Chinese
/api/health -- API routes (no locale prefix)
/__ -- Internal paths (no locale prefix)Every user-facing page URL includes the locale segment. The default locale (en-US) is also included in the URL -- there is no prefix-as-default mode.
Documentation
Documentation is available in English only at /docs.
Locale Detection Priority
For the app, the locale is determined in this order:
- URL path -- the first path segment is checked against supported locales.
- Cookie -- if the path has no locale prefix (e.g., API routes), the
raypx-localecookie is checked. - Default -- falls back to
en-US.
Cookie
The locale preference is stored in a cookie named raypx-locale with the following attributes:
raypx-locale=en-US; Path=/; Max-Age=31536000; SameSite=LaxThe cookie is set when a user switches languages and persists for one year.