Localization

Follow

The Po.st widget is designed to be a tool for global sharing. This page will outline how to detect your reader's language and how to explicitly declare a language for all users.

Localizing Languages

Auto-detect

Po.st menu and buttons can be set to automatically display the language set by the locale of the user's browser.

You can do this by adding locale:"auto" in your pwidget_config variable. The dark blue code below is an example of what you would include with your load script. I've shown an example load script below. Yours can be found in the social tools tab of your dashboard.

Asynchronous load method

<script type="text/javascript">
var pwidget_config = {	
        locale:"auto"
};
</script>

<script type="text/javascript">
(function () {
var s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = ('https:' == document.location.protocol ? 'https://s' : 'http://i')
+ '.po.st/static/v4/post-widget.js#publisherKey=example';
var x = document.getElementsByTagName('script')[0];
x.parentNode.insertBefore(s, x);
})();
</script>

If the browser language settings can not be obtained, it uses the en-us locale.

Set Custom Language

Po.st menu and buttons can also be set to override a user's browser settings and display in a language you specify.

You can do this by adding locale: "[language code]-[country code]" when loading the widget.

 

Asynchronous load method

<script type="text/javascript">
var pwidget_config = {
	publisherKey:"[publisherKey]",	
        locale:"en-us"
};
</script>
<script type="text/javascript">
(function () {
var s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = ('https:' == document.location.protocol ? 'https://s' : 'http://i')
+ '.po.st/static/v4/post-widget.js#publisherKey=example';
var x = document.getElementsByTagName('script')[0];
x.parentNode.insertBefore(s, x);
})();
</script>
 

Languages Supported by Po.st

Locale Code
Chinese - People's Republic of China zh-cn
English - United States en-us
English - Great Britain en-gb
French - France fr-fr
French - Switzerland fr-ch
German - Germany de-de
German - Switzerland de-ch
Italian - Italy it-it
Italian - Switzerland it-ch
Japanese - Japan ja-jp
Portugese - Portugal pt-pt
Portugese - Brazil pt-br
Russian - Russia ru-ru
Spanish - Latin American es-la
Chinese People's Republic of China zh-cn
Polish - Poland pl-pl
Dutch - Netherlands nl-nl
Czech - Czech Republic cs-cs
Danish - Denmark da-da
Swedish - Sweden sv-sv
Norwegian - Norway no-no
Finnish - Finland fi-fi
Arabic - U.A.E. ar-ar

 

 
Was this article helpful?
1 out of 1 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk