Configure and Implement Multi-Language

Configure and implement multi language.

Overview Implementation


Feature PSP OSP Emails Invoices Billing Portal Chargifyjs Advanced Billing Admin UI
Supports Multi Language Yes Yes Yes Yes No n/a No
Code Some code Some code No code No code n/a n/a n/a
Implementation Path JS JS Email variables + you write the email content (sample provided) Configure invoice language setting  n/a Make your app multi-lingual  n/a


All signup methods
You Need
An understanding of how customers subscribe to your services, and your post-signup flow (if any).


1. Set locale on customer creation HTML
The locale value determines the language. You can set it when creating the customer, or when creating the customer+subscription simultaneously (most common). 


1. When linking to your PSP, prepopulate the locale variable. For example, if you pass French, your PSP url will look like pspurl?locale=fr.
<!-- Syntax: PSPLINK?locale={locale}&reference=123?first_name=Tommy&last_name=Emmanuel-->
<a href="">
  <button type="button" class="w-100 btn btn-lg btn-primary">Subscribe to Pro</button>

2. When your page loads, the language will be set in the background, it is not visible to the user. To test, fill out your payment form and submit. When you visit the customer record, you will see the locale set accordingly.


2. Configure language on invoices
Use these steps from the configure invoices guide.

3. Configure language on emails
If you set the customer locale on the customer record, you can access the value within your emails, to determine which email content the customer receives. 

Customer Locale
Example showing French, German, and English, using if, elsif, and else.
{% if customer.locale == "fr" %}
  Bonjour {{customer.first_name}}
{% elsif customer.locale == "de" %}
  Hallo {{customer.first_name}}
{% else %}
  Hello {{customer.first_name}}
{% endif %}        
4. Configure language on PSPs JS
Use the resource from this step, from the configure PSP guide.
Was this article helpful?
0 out of 0 found this helpful