Localization

Follow

The Po.st widget is designed to be a tool for global sharing. The Po.st menu can not only be set to display the reader's default language, but can also be set to display the most popular channels for that language. This page will outline how to detect your reader's language and how to display the popular sharing channels.

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 lc=auto to the end of the code when loading the widget.

Asynchronous load method

<script type="text/javascript">
var pwidget_config = {
	publisherKey:"[publisherKey]",	
        locale:"auto"
};
(function ()
{
	var s = document.createElement('script');
	s.type = 'text/javascript';
	s.async = true;
	s.src = 'http://i.po.st/share/script/post-widget.js';
	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 lc=[language code]-[country code] when loading the widget.

Asynchronous load method

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

*Country code can be omitted.

Languages Supported by Po.st

LocaleCode
Chinese zh
English en
French fr
German de
Italian it
Japanese ja
Portugese Brazil pt-br
Russian ru
Spanish Latin American es-la
Polish pl
Dutch nl
Danish da
Swedish sv
Norwegian no
Finnish fi
Czech cs
Arabic ar

Localizing Services

Po.st allows you to customize which sharing channels you would like to show as well as automatically detecting which channels are the most popular for that language.

This can be done by using <a class="pw-button-popular-[n]"></a>. N can be any number from 1-11.

Any button you explicitly define in your widget will not reappear as one of the popular channels listed. In the example below, Facebook is defined as the first button. If it was also popular channel #1, the widget would replace that popular channel with the next popular channel until it is one not explicitly defined.

<div class="pw-widget">
	<a class="pw-button-facebook"></a>
	<a class="pw-button-twitter"></a>
	<a class="pw-button-popular-1"></a>
	<a class="pw-button-popular-2"></a>
</div>

JavaScript API Reference

<script type="text/javascript">
var pwidget_config = {
	publisherKey:"[publisherKey]",	
        locale:auto or language code
};
</script>
Was this article helpful?
1 out of 1 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk