How to create a multilingual blog in Blogger

Blogger doesn’t offer multilingual features, but we will show you how, with some tricks, you can create a multilingual blog.

As you can see at the right side, we offer our blog in more than one language and we achieved this using standard Blogger. Our strategy was pretty simple:

  • Create a separate blog for each language/country.
  • Configure each blog with the same template and settings, with the exception of the language and formatting, which should obviously be specific for each language/country.

This works best when you have a custom domain and you can create sub-domains for each language. In our case the www sub-domain points to the (default) English blog and the pt sub-domain points to the Portuguese blog.

Block with language links/redirects

Now, the tricky part is you have to create each article and each page with the same permalink (URL) on all your language blogs. Blogger allows you to customize the permalink when you first create a article/page or when you revert a page/article back to draft.

Blogger permalink settings
Blogger permalink settings

This will be key to offer proper language links/redirects based on the user language. Here is the code for your language block:

<div class='content-block' id='language'>
    <div class='block-wrapper'>
        <h3>Select language</h3>
        <ul>
            <li>English,</li>
            <li><a href='http://pt.broculos.net'>Português</a></li>
        </ul>
        <script type='text/javascript'>
            //<![CDATA[
                var a = document.URL.replace(document.domain, "pt.broculos.net");
                $("#language li > a").attr("href",a);
            //]]>
        </script>
    </div>
</div>

As you can see, we build each language link with some JavaScript code that picks the current URL and replaces the language’ specific sub-domain. A very simple thing, but it requires discipline when creating new articles/pages.

Limitations

There are some limitations to this approach. It requires JavaScript and, in our case, we decided not to do any automatic redirection based on the visitor’s country or browser settings.

You can do the automatic redirection in JavaScript, but you will need an external server to properly determine the visitor’s country and language settings and we decided it was not worth the hassle.

Nuno Freitas
Posted by Nuno Freitas on May 28, 2013

Related articles