Languages & Localization
Supported Languages
| Code | Language |
|---|---|
ru | Russian |
en | English |
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
langattribute andog:locale - Laravel PHP locale (
config/app.php) - Moment.js (
moment.localeinresources/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 | |
|---|---|---|
| Purpose | Initial seed (ConfigSeeder) and production build | Active language of the running site |
| When to change | On deploy / first run | Any time via admin panel |
VITE_APP_LOCALE=enAfter 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:
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 EnglishLaravel 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
- Create
resources/lang/{code}.jsonwith translated strings - Create
resources/lang/{code}/with PHP translation files (copy structure fromen/) - Add the Moment.js locale in
resources/js/app.js - Add the code to the allowed languages list in
GeneralSettingsController(in:en,ru)