Internationalisation (i18n)
WhatsMine is fully translatable, with database-backed locales, JSON dictionaries and right-to-left support. Most translation work is done from Admin → Languages — this page covers the developer side.
Adding a language
- Admin → Languages → Add Locale — set the code (e.g.
fr), name, direction (ltr/rtl) and flag. - Run
php artisan i18n:scanto discover all translatable keys. - Fill in the translations in the admin translation editor (or use Auto-Translate).
Using translations
In PHP:
__('Your subscription has been cancelled.');
trans('billing.subscription_cancelled');
In React:
import { useTranslation } from 'react-i18next';
const { t } = useTranslation();
return <p>{t('billing.subscription_cancelled')}</p>;
How dictionaries are served
The frontend loads translations at runtime from a localized endpoint — so adding or editing translations does not require an asset rebuild. The flattened dictionary is cached for performance.
Editing locale JSON files directly
If you edit resources/js/locales/*.json by hand, the cached dictionary won't update until you invalidate it. The admin translation UI does this automatically; for manual edits, clear the i18n cache (e.g. re-run php artisan i18n:scan or clear the application cache). Translations editing via the admin panel is the recommended path.
RTL support
Set a locale's direction to rtl and the SetLocale middleware adds dir="rtl" to the page. Tailwind's logical properties (ms-, me-, ps-, pe-) mirror the layout automatically.
Multi-currency
Currencies are managed in Admin → Currencies — each with a symbol, decimals and exchange rate relative to the base currency.
Commands
| Command | Purpose |
|---|---|
php artisan i18n:scan | Scan PHP/JS for translation keys and create missing entries. |
php artisan i18n:seed-defaults | Seed the default locale and base strings. |
➡️ Next: Artisan Commands.