Skip to content

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.

yml
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 ContentLanguage File DirectoryTemplate File
Backend Program/i18n/[LANG].ymlen.yml
Frontend Interface/ui/artalk/src/i18n/[LANG].tsen.ts
Backend Interface/ui/artalk-sidebar/src/i18n/[LANG].tsi18n-en.ts
Configuration Files/conf/artalk.example.[LANG].ymlartalk.example.yml
Documentation/docs/docs/[LANG]/**/*.mden/**/*.md
Official website home page/docs/landing/src/i18n/[LANG].tsen.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:

js
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".

js
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.

js
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.

Contributors

Changelog