Reward Loyalty Documentation

Managing Languages and Translations

When visitors visit the website without specifying a language (e.g. en-us), they are automatically redirected to the version in the language of their browser. This ensures that content is delivered in their native language, if available. In addition, multilingual URLs remain available for SEO and direct linking.

Multilingual Support

Our script offers multilingual support, including several pre-installed translations. These translations reside within the lang directory, each within its own folder named after its respective locale standard (e.g., en_US, pt_BR).

Content such as the Contact, Privacy Policy, and FAQ pages are located in the lang/<locale>/md directory. In this directory, you will find markdown files which can be edited to modify the content.

Note: The script only supports left-to-right (LTR) text direction.

Activating and Deactivating Languages

After the installation of the script, only en_US is active.

Activating a Language

To activate a language, navigate to the config.php file in the language's folder (lang/<locale>/config.php) and set the active attribute to true:

/*
| This configuration determines the active status of the language. 
| If set to 'false', the language will not appear in the language selection
| dropdown or in the dashboards.
*/

'active' => true,

Deactivating a Language

To deactivate a language, either:

  1. Remove the relevant folder in the lang directory (e.g., lang/<locale>/).

  2. Or, open the config.php file in the language folder (lang/<locale>/config.php) and set the active attribute to false:

/*
| This configuration determines the active status of the language. 
| If set to 'false', the language will not appear in the language selection
| dropdown or in the dashboards.
*/

'active' => false,

Important Note: If your application exclusively uses a language other than en_US, adjust the config/app.php file accordingly by altering both the locale and fallback_locale:

/*
|--------------------------------------------------------------------------
| Application Locale Configuration
|--------------------------------------------------------------------------
|
| The application locale defines the default locale that the translation 
| service provider will utilize. Feel free to set this value to any of 
| the locales supported by your application.
|
*/

'locale' => 'en_US',

/*
|--------------------------------------------------------------------------
| Application Fallback Locale
|--------------------------------------------------------------------------
|
| The fallback locale specifies the locale to use when the current one
| is unavailable. You can modify the value to match any of the 
| language folders provided in your application.
|
*/

'fallback_locale' => 'en_US',

When only one language is active, the language selection dropdown will not appear.

Adding New Languages

To add a new language, copy the main language directory lang/en_US/, translate all its files, and rename the new directory to correspond with the ISO-compatible locale name (language_COUNTRY).

The structure of the locale identifier incorporates a lower-case language code (as per ISO 639-1) and an uppercase country code (following ISO 3166-1), separated by an underscore. For example, 'en_US' represents American English, while 'pt_BR' stands for Brazilian Portuguese.