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.
Available Languages
The platform includes 12 pre-built translations:
| Code | Language | Direction | Status |
|---|---|---|---|
en_US |
English (United States) | LTR | Active by default |
de_DE |
German (Germany) | LTR | Inactive by default |
es_ES |
Spanish (Spain) | LTR | Inactive by default |
fr_FR |
French (France) | LTR | Inactive by default |
id_ID |
Indonesian (Indonesia) | LTR | Inactive by default |
it_IT |
Italian (Italy) | LTR | Inactive by default |
ja_JP |
Japanese (Japan) | LTR | Inactive by default |
nl_NL |
Dutch (Netherlands) | LTR | Inactive by default |
pl_PL |
Polish (Poland) | LTR | Inactive by default |
pt_BR |
Portuguese (Brazil) | LTR | Inactive by default |
tr_TR |
Turkish (Turkey) | LTR | Inactive by default |
ar_SA |
Arabic (Saudi Arabia) | RTL | Inactive by default |
RTL Support: Arabic includes full right-to-left support. All interface elements automatically adjust for RTL languages.
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.
Note: If only one language is active, the language selector automatically hides itself.
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.,
nl_NLfor Dutch)- 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: Set
'active' => truein your newconfig.php
Language File Structure
Each language folder contains:
lang/en_US/
├── config.php # Active status and text direction
├── common.php # Main interface strings
├── validation.php # Form validation messages
├── otp.php # Login and verification messages
├── faq.php # FAQ questions and answers (the qa array)
├── install.php # Installer text
├── javascript.php # Strings used by front-end scripts
├── agent.php # AI assistant strings
└── md/ # Markdown content pages
├── about.md # About page
├── contact.md # Contact page
├── privacy.md # Privacy policy
└── terms.md # Terms of service
Editing Content Pages
The About, Contact, Privacy Policy, and Terms pages are stored as Markdown files.
To edit one of these pages:
- Go to
lang/<locale>/md/ - Open the relevant
.mdfile (for example,privacy.md) - Edit the text using Markdown syntax. The
title,description, andiconat the top of the file (the frontmatter) set the page's heading and hero.
The FAQ is different. It is not a Markdown page. Its questions and answers live in
lang/<locale>/faq.php, inside theqaarray — each entry has aq(question) and ana(answer), and answers may include light HTML. Edit that file to change, add, or remove questions.
Setting the Default Language
If your application should default to a language other than English, add these variables to your .env file:
APP_LOCALE=pt_BR
APP_FALLBACK_LOCALE=pt_BR
| Variable | Purpose |
|---|---|
APP_LOCALE |
The primary language shown to visitors |
APP_FALLBACK_LOCALE |
Used when a translation key is missing in the current language |
Protecting Custom Translations During Updates
⚠️ Important: When you add or modify translations, you must protect them from being overwritten during automatic updates.
Add your custom translation directories to your .env file:
# Protect custom German and French translations
PROTECTED_TRANSLATIONS="de_DE,fr_FR"
Multiple directories are separated by commas. These paths are relative to the lang/ folder.
Why This Matters
When you update Reward Loyalty:
- The updater replaces core language files with new versions
- Any customizations you made would be lost
- Protected paths are automatically backed up and restored
What to Protect
Protect any language folder where you have:
- Translated content for a new language
- Modified existing translations
- Added custom Markdown content (privacy policy, terms, etc.)
Protecting Other Custom Files
For custom files or directories outside of translations:
# Protect additional custom paths
PROTECTED_PATHS="custom/branding/,my-config.php"
Learn more: See Updating for complete documentation on how updates work and file preservation.
Related Topics
- Updating — How updates work and protecting custom files
- Branding — Customize your platform appearance
- System Settings — All admin configuration options