» hard'n'software

The Morning After – localization, anyone?

25 June 2008 69 gości One comment

Not everyone speaks English. You don’t have to, nor the visitors of your TMA-powered blog. However, translating the theme to any language other than English has always been a tedious task. Rejoice, o nations! I prepared this excellent theme for localisation. Check here for a test site up and running in my native tongue. This very site also uses the localized files. I have been using The Morning After by Arun Kale on my magazine’s webpage for ages now and I must say I couldn’t find a better WordPress theme to suit my needs. It’s a plain, simple, magazine-style theme that turns WordPress into a CMS. However, it lacks localization. It’s in plain and simple .php, which means that one would have to translate all the files in his/hers favourite text editor. What’s more, one would have to repeat the process every time the TMA is updated. A tedious task. Believe me, been there, done that.

Theory

There’s an easier way. In short, internationalization and localization could be achieved by wrapping all texts within the .php files in __, _e and __ngettext tags. Then a program like PoEdit automagically searches through all the files and returns the list of all English terms that should be translated – in one .po file. Once the file is uploaded to a localized WP installation, the entire site is translated and localised.

The Morning After theme

The Morning After theme

So, why didn’t Arun prepare the theme for localisation? No idea. Nick Bohle from the official TMA forum asked himself the very same question and… here we are. He started off with some files and a lengthy explanation of how does it work and prepared some of the files for localisation. Then my previous personal WordPress blog installation broke down (okay, okay, it didn’t broke down by itself, I helped it a lot) and I decided to try installing TMA for personal use. I picked up the task Nick started, finished all the work, prepared a Polish translation and voila!

Localization

So, how do you localize the TMA to your language (or any theme for that matter)? Here’s a brief how-to:

1. Download the following package. If you still want to use English – that’s fine, you won’t notice a difference as TMA uses English as a default language where there is no localization file present (.mo)
2. Upload the /tma folder to your /wp-content/themes/ folder.
3. If you already have TMA installed and running, be sure to back up all the hacks you applied. This is a clean, vanilla installation and you’ll loose them should you overwrite the files.
4. Turn the theme on in your wp-admin. If Polish language is what you want (and what you already applied to your entire WP installation), you’re done, you don’t have to move a finger.

Translation

The default language is English. If you want to translate the theme to your own language, download PoEdit, install it, and then open the TMA.po file (provided in the download package – link below). Now browse through all the texts and translate all of them to your preferred language/dialect. Detailed how-to is available here

After you’re done, just upload the new .mo file to your theme’s directory (/wp-content/themes/tma) and refresh your site. That’s it.

Help and troubleshooting

I tested the localised files and they worked just fine in Polish (check the test site). However, should you spot something, prepare a translation to your own language or simply need some help with translation, please drop me a line (either in the comments here, or through the contact form in the header). Should you have any problems with the theme itself, please leave a note at the forums.

Download

Download The Morning After 1.3 - localised and localisable version of The Morning After theme for WordPress. Polish language version included, other language versions easily preparable.

1 gwiazdka2 gwiazdki3 gwiazdki4 gwiazdki5 gwiazdek (ten tekst jest nieoceniony)
Loading ... Loading ...

One comment »

  • SelaIrrable

    Awesome stuff

    Thanks for posting!

subscribe to these commentsComments Feed

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.