Loyalty Program Language Configuration Guide
Overview
This guide covers how to configure and customize language settings for the Loyalty Program system across both server (Lua) and client (Flutter) components.
Server Language Configuration (config.lua)
All server-side text is managed through the Config.Language
table in config.lua
:
Placeholders
Many strings contain placeholders that will be replaced at runtime:
%s
- For dynamic content (points, amounts, etc.)Example:
"Added %s points to your loyalty card!"
might display as "Added 500 points to your loyalty card!"
Client Language Configuration (/ui/assets/config.json)
All Flutter app text is managed through the translations
object in /ui/assets/config.json
:
Placeholders
The Flutter app uses a different placeholder format:
{$variableName}
- For dynamic contentExample:
"Successfully converted {$points} points"
might display as "Successfully converted 500 points"
How to Modify Language Settings
Changing Server-Side Text
Open
config.lua
Locate the relevant key in the
Config.Language
tableModify the value while preserving any placeholders (
%s
)Save the file
Example:
Changing Client-Side Text
Open
/ui/assets/config.json
Locate the relevant key in the
translations
objectModify the value while preserving any placeholders (
{$variableName}
)Save the file
Example:
Changing Currency Symbol
To ensure consistency, update the currency symbol in both files:
In
config.lua
:
In
/ui/assets/config.json
:
Translation Tips
Maintain Placeholders: Always preserve placeholders (
%s
in Lua,{$variableName}
in JSON) in the same order they appear.Test Changes: After modifying language settings, test the system to ensure all text displays correctly.
Special Characters: If using special characters, ensure your files are saved with UTF-8 encoding.
Length Considerations: Keep translations reasonably close to the original length to prevent UI display issues.
Last updated