I have multiple languages configured in my Chargebee site but how will I know my customers' locale on the checkout or portal page?
How will Chargebee identify customers of different languages?
How to collect customer locale directly from the customer for hosted pages v2 and v3?
Multiple languages can be configured in the Chargebee site to better the end-user experience (from the 'Rise' plan and above). Once the languages are added the Chargebee system automatically identifies the language based on the locale of the customer. This can be either entered directly in the 'Admin console' by the merchant under customer details or collected directly from the customer in the portal.
Each site has a 'default' language which would be used unless a customer’s locale is set to a different language.
End customer choice of language:
For Hosted Pages V2
When you have more than one language on the same site, you can provide an option for the customers to choose their desired language. For this, you can enable "Allow language options" under Settings (Left-side panel) >> Configure Chargebee >> Checkout & Self-Serve Portal >> Field Configurations that would add a drop-down with the list of languages in the hosted pages.
You can also send the "locale" parameter along with plan specific hosted page URL so that the hosted pages can be opened in the specific language based on the locale by default.
Example link with the customer[locale] being passed: https://test.chargebee.com/hosted_pages/plans/free?customer[locale]=sv
For more on the localization feature, please check this doc.
For Checkout & Portal V3
You can enable the "Allow Customer to change the locale" by going to Settings (Left-side panel) >> Configure Chargebee >> Checkout & Self-Serve Portal >> and choosing "Advanced Settings" under the "Configurations" tab.