Skip to content

Internationalization ​

Thinkrix keeps the same frontend i18n protocol as Trix.

php
'locale' => env('THINKRIX_LOCALE', 'zh-CN'),
'fallback_locale' => 'en-US',
'languages' => [
    'zh-CN' => ['label' => '中文', 'file' => 'zh-cn', 'naive_locale' => 'zh-CN'],
    'en-US' => ['label' => 'English', 'file' => 'en-us', 'naive_locale' => 'en-US'],
],

Loading Order ​

Later sources override earlier sources:

  1. Package lang/{locale}.php
  2. Project config/lang/{locale}.php
  3. Module lang/{locale}.php

Endpoints ​

  • GET /api/admin/translations?locale=zh-CN
  • POST /api/admin/locale

System routes also expose compatible aliases:

  • GET /api/admin/system/translations
  • POST /api/admin/system/locale

If a page shows keys such as system.dashboard.total_users, add the missing values to the active language file or translate the backend label with __t().

基于 MIT 许可发布