Internationalization
Internationalization (i18n) allows any custom theme to be translated into any number of languages. Some customers have run their referral program in 11 parallel languages, all managed through the Referral SaaSquatch custom theme engine.
- Internationalization
- Internationalisierung
- 国际化
- 국제화
- интернационализация
- միջազգայնացման
Internationalization is the process of translating your referral program into multiple languages, and uses custom themes to manage all the strings, HTML and CSS attached. Internationalization uses 5 parts, as follows:
- The
locale
widget parameter (see Squatch.js and Mobile widget) - The
locale
template field (see Template field reference) - The
i18n
handlebars helper (see i18n Helper reference) - Java
.properties
files (see i18n Helper reference) - Translation service integrations (e.g. Transifex and Crowdin)
🔗 A Simple Example
Say we wanted to translated a single string like Give a free month to a friend
.
Somewhere this would be in your custom theme, like so:
<h3>
Give a free month to a friend
</h3>
This would need to use the i18n
helper.
<h3>
{{i18n "callToAction"}}
</h3>
>> messages.properties
callToAction = Give a free month to a friend
Then to translate the file, we'd just need to include a separate .properties file.
For example, if your loaded Squatch.js or the mobile webview using locale=fr
,
it would use the messages from the messages_fr.properties
file.
>> messages_fr.properties
callToAction = Donnez un mois gratuit à un ami
So, the final rendered result in French would look like so:
<h3>
Donnez un mois gratuit à un ami
</h3>