Translations

Serve the Subscription Manager in multiple languages using Ordergroove’s built-in i18n support

View as Markdown

What Is Localization?

Localization allows you to serve the Subscription Manager in the language currently in use by your ecommerce store. Ordergroove has built extensive i18n support to ensure that all pieces of the Subscription Manager can be translated into many different languages to match the rest of your site.


How Does It Work?

Upon initialization, the Subscription Manager looks for the standard lang attribute on the <html> node of your ecommerce store. If there is no lang attribute, a default of en is used — for example, <html lang='en'>.

Because the Subscription Manager is built as a single-page application, it also listens for changes to the lang attribute on the <html> node and updates itself to render content in the currently selected locale. This means localization support works with both AJAX and page refresh/redirect methods of changing the site locale.


Where Can I Change My Localized Content?

All localizable content is stored in JSON-formatted files. You can alter existing locale files or add your own. The Subscription Manager will always attempt to load a file that matches the current lang attribute on the <html> node. For example, if the current locale is set to zh-cn, the Subscription Manager will load translation values from zh-cn.json.

You can find and manage these files in the locales folder: