Languages & Translations
Manage supported languages, translations, and default locales.
Reward Loyalty is designed to be global. It supports multiple languages and automatically detects a visitor's preferred language based on their browser settings. You can easily manage active languages, add new translations, and configure text direction.
How It Works
The platform uses a folder-based structure for languages. Each language lives in its own directory within lang/ (e.g., lang/en_US/, lang/pt_BR/).
When a user visits your site:
- The system checks their browser language
- If that language is active, it's shown
- If not, the system falls back to your default language (usually
en_US)
Managing Languages
Activating a Language
To enable a language so it appears in the language selector:
- Navigate to the language's directory:
lang/<locale>/ - Open the
config.phpfile - Set
'active' => true
return [
'active' => true,
'dir' => 'ltr', // 'ltr' for Left-to-Right, 'rtl' for Right-to-Left
];
Deactivating a Language
To hide a language:
- Open
lang/<locale>/config.php - Set
'active' => false
Alternatively, you can delete the language folder entirely if you're sure you won't need it.
Adding a New Language
Want to add a language that isn't included?
- Copy the Base: Duplicate the
lang/en_US/folder. - Rename: Rename the new folder to your target locale (e.g.,
fr_FRfor French).- Format:
language_COUNTRY(ISO 639-1 language code + ISO 3166-1 country code).
- Format:
- Translate: Open the files inside the new folder and translate the values.
- Activate: Ensure
'active' => truein your newconfig.php.
Editing Content
Some content, like the Privacy Policy, Terms, and FAQ, is stored as Markdown files.
To edit these pages:
- Go to
lang/<locale>/md/ - Open the relevant
.mdfile (e.g.,privacy.md) - Edit the text using Markdown syntax
Setting the Default Language
If your application should default to a language other than English:
- Open
config/app.php - Update the
localeandfallback_localevalues:
'locale' => 'pt_BR',
'fallback_locale' => 'pt_BR',
Note: If only one language is active, the language selector will automatically hide itself.