The CopyBlogger theme is a WordPress theme by Chris Pearson (web developer from the US).
As I want to use the CopyBlogger theme as the new theme of my blog, I had to translate it to German. The code of the CopyBlogger Theme, as it is downloadable at Chris Pearson’s website, is English and not prepared for translations, which means, that each translator of the theme would have to dive through the code, translate every English word and then test, if he or she found each one. And then he or she had to do it again, just to be sure. To avoid this, WordPress has two special php functions for plugin or theme localization:
The parameter of these functions becomes translated, if a translation for the message is available. So you don’t need any language files, if you want the theme in English.
I did walk through the code of the CopyBlogger theme and substituted each occurrence of an English phrase.
Phrases which would be directly shown became substituted by
< ?php _e('Phrase','copyblogger') ?> and phrases in functions by
__('Phrase','copyblogger'). WordPress needs to know, in which localization context the translation is to be found. That’s the reason for the
'copyblogger' in the
$message and a change I had to make to functions.php:
Further additions were
< ?php _e('<*!-- - xyz translation by <*a href="your url">your name< */a> --*>','copyblogger'); ?> in the footer.php for the translator credit and a little change in index.php to make to phrase “Comments Off” translatable.
All thats left to do for a translator is, open a program like poEdit, generate a catalog of phrases (or load the de_DE.po) and translate the phrases.
There are three little flaws in the catalog, which have to be translated by hand:
- in searchform.php all three occurrences of “To search, type and hit enter“ have to be translated to the same words. I couldn’t add this to the catalog, as functionality would be lost by doing so.
- in 404.php Chris wrote a longer, colloquial text. Any translator has to decide if and how he wants to translate and style this text
- in nav_menu.php you’ll find the navigation menu links. As they are different at every blog, I see no use in translating them.
I will host the CopyBlogger_localizable theme for the moment, as I could not find the Email address from Chris Pearson to make the theme available for him.
I want to thank Chris Pearson for his cool theme and Tim Zylinski for his Localizing WordPress Themes tutorial. Without the tutorial I would have had no idea how to do this.
German CopyBlogger Theme (includes the German language files)