Documentação do Reward Loyalty

Managing Languages and Translations

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: After the initial installation, only en_US is active.

Activating and Deactivating Languages

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.