A translatable WordPress theme
A translatable WordPress theme is a good way to interact with the audience with the language you desire it to present itself. There are many resources available over the Internet, and most of them worked actually. I don’t know why you find them not working for you. Anyways, I found the following tutorial nicely explained the matter so that you can proceed step by step to translate your theme:
- Translating Your Theme – by Robert Treacy — WPTuts+
The article explained the way more details. You will need a mini software named PO Edit.
Installing the software will require your email and password one time.
Then opening the .po file into the software you will get a screen like
below:
On the portion top, the translatable strings are there. Click on each string, and you will get it selected on the screen below-top, i.e. Here in this image the “Category Archives:” is selected. To translate the string just type your translating string in your language on the portion at the bottom, i.e. Here in this image “Translate here…” is the string will replace the original string “Category Archives:”.
Please remember:
- Translate being with the syntax, like: the string “Category Archives:” should translate into something that has a colon (:) at the end, for example: “My Archives:”.
- Do not change any code, like:
%s
,%1$s
etc.
And finally you have to change your WordPress’ wp-config.php
file to support your language. In your case the language code would be ar
for Arabic:
define('WPLANG', 'ar');
You can find all the language code here in Codex. I recommend following the tutorial and it will guide you to success inshALLAH.