Localization
You can select the language in the settings page of the Artalk Dashboard, or set the language of Artalk through the environment variable ATK_LOCALE
and the locale
configuration item in the artalk.yml
configuration file.
locale: en-US
The locale
configuration item follows the Unicode BCP 47 standard and defaults to "en-US" (English).
Currently, Artalk supports the following languages:
- "en" (English)
- "zh-CN" (简体中文)
- "zh-TW" (繁体中文)
- "ja" (日本語)
- "ko" (한국어)
- "fr" (Français)
- "ru" (Русский)
Contributing to Translations
We welcome PRs to help translate Artalk into multiple languages and contribute to the community!
Translation Content | Language File Directory | Template File |
---|---|---|
Backend Program | /i18n/[LANG].yml | en.yml |
Frontend Interface | /ui/artalk/src/i18n/[LANG].ts | en.ts |
Backend Interface | /ui/artalk-sidebar/src/i18n/[LANG].ts | i18n-en.ts |
Configuration Files | /conf/artalk.example.[LANG].yml | artalk.example.yml |
Documentation | /docs/docs/[LANG]/**/*.md | en/**/*.md |
Official website home page | /docs/landing/src/i18n/[LANG].ts | en.ts |
For more details, refer to: Development Documentation / CONTRIBUTING.md
Advanced Configuration
Temporarily Changing Language on the Frontend
The frontend will use the backend's language configuration by default, but you can also set the language through the locale
configuration item on the frontend:
Artalk.init({
locale: 'en-US',
})
Automatically Switching Language on the Frontend
You can set the front-end locale to "auto"
to automatically switch the language based on the user's browser settings. If the language does not exist, it will default to "en-US".
Artalk.init({
locale: 'auto',
})
Custom Frontend Locale Content
You can pass an Object type to the frontend and customize the locale content according to the keys in the template file.
Artalk.init({
locale: {
email: 'Eメール',
//...
},
})
By following these steps, you can easily configure and customize the language settings for Artalk to better suit your audience.