Skip to content

Commit

Permalink
Add change locale example to JS SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
german-b committed Jan 18, 2021
1 parent a8452d2 commit 0125501
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions js_sdk/change_locale.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Reference:
// https://sdk-docs.glia.com/visitor-js-api/current/Salemove.html#setLocale
// Sets the locale for the Glia Visitor App. Upon initialization the Visitor App
// is set to the default locale configured for the site. This function can be used
// to change the locale of the Visitor App at any time after initialization.

sm.getApi({ version: 'v1' }).then(function (api) {
api.setLocale('en-US'); //Set the locale key here
});

0 comments on commit 0125501

Please sign in to comment.