I have a "pseudo-multilanguage" site/blog hosted on Tumblr (so I don't have access to server-side programming) based on the solution of this stack.
<script>
var defaultLanguage = 'pt';
$.ajax({
url: "//ajaxhttpheaders.appspot.com",
dataType: 'jsonp',
success: function( headers ) {
var language = headers['Accept-Language'].substring( 0, 2 );
if( language != defaultLanguage ) {
$( 'span[lang="pt"], p[lang="pt"]' ).hide( 0 );
$( 'span[lang="' + language + '"], p[lang="' + language + '"]' ).show( 0 );
}
}
});
</script>
Very, very simple. I translate manually all the content in every post (phew!) and then I hide based upon the AJAX Request.
When I found it I was testing on Mozilla Firefox and it was working like a charm. Then I was forced to move to Google Chrome for other reasons and then the implementation didn't work anymore.
Is there a way I can force this code to overwrite whatever is up in Chrome's settings or, considering I'm using Tumblr, offer those little flags to the user change it in runtime?