Skip to content

Languages & Localization

Supported Languages

CodeLanguage
ruRussian
enEnglish

Platform Language at Runtime

Admin Panel → General Settings (/admin-panel/settings/general) → Default language field.

The value is stored in the config table (key language) and applied at runtime via GetLanguageRepository and the SetLocaleFromConfig middleware:

  • HTML lang attribute and og:locale
  • Laravel PHP locale (config/app.php)
  • Moment.js (moment.locale in resources/js/app.js)
  • Frontend translation loading (laravel-vue-i18n)

Changing the language in the admin panel takes effect immediately without rebuilding the frontend.

VITE_APP_LOCALE vs Runtime

VITE_APP_LOCALE (.env)Admin panel language
PurposeInitial seed (ConfigSeeder) and production buildActive language of the running site
When to changeOn deploy / first runAny time via admin panel
ini
VITE_APP_LOCALE=en

After seeding, the runtime language is determined by the database setting, not the environment variable.

Translation Files

Frontend (Vue / JavaScript)

resources/lang/ru.json    — UI strings (Russian)
resources/lang/en.json    — UI strings (English)

Files are loaded dynamically in resources/js/app.js via laravel-vue-i18n:

js
resolve: (lang) => import(`../lang/${lang}.json`)

Add new strings to both files with matching keys.

PHP / Backend

resources/lang/ru/*.php     — auth, validation, mail, errors, meta, etc.
resources/lang/en/*.php     — same groups for English

Laravel uses fallback_locale = 'en'. The locale comes from admin panel settings, not .env.

Date Formatting

Moment.js uses ru (Russian) and en-gb (English) locales. The locale switches automatically with the platform language.

Adding a New Language

  1. Create resources/lang/{code}.json with translated strings
  2. Create resources/lang/{code}/ with PHP translation files (copy structure from en/)
  3. Add the Moment.js locale in resources/js/app.js
  4. Add the code to the allowed languages list in GeneralSettingsController (in:en,ru)

Released under the MIT License.