If you’re like me, then English isn’t your first language and chances are you would like to see your Genesis powered website talking to you in your own language. It shouldn’t come to you as a surprise that Genesis is built to be translated and all you have to do is translate the genesis.pot file via a tool like PoEdit.
After uploading the translations to your /lib/languages/ folder in your Genesis folder you can see your translation active on your website. However, when Genesis offers updates, that update process will remove your language files, as it replaces the complete Genesis folder, reverting your site back to English.
Now, Genesis wouldn’t be Genesis if there wasn’t a solution for that. Here’s what you have to do in order to keep your Genesis powered website translated even after updates.
- Go to your active child theme folder and create a folder called languages
- Upload your translation files (your
.moand.pofiles) to the languages folder you just created - Next up, we need to tell Genesis we want it to look for translation files in your Child Theme folder instead of the Genesis folder.
We need the following code pasted in your Child Theme’s functions.php:
[php]//Child Theme Language override
define(‘GENESIS_LANGUAGES_DIR’, STYLESHEETPATH.’/languages’);
define(‘GENESIS_LANGUAGES_URL’, STYLESHEETPATH.’/languages’);[/php]
This snippet needs to go before the following code:
[php]// Start the engine
require_once(TEMPLATEPATH.’/lib/init.php’);[/php] but after the opening [php]<?php[/php]
That’s it. Now your site will always remain translated. Do keep in mind that a bigger Genesis update (e.g. from 1.3.x to 1.4) there will probably be new untranslated texts in the new Genesis .pot file found in the /lib/languages/ folder.
Just so that I understand correctly: Do I have to translate both the Genesis framework AND the child theme?
If your child theme is adding its own text strings, then yes. In most cases however you will only need the translation for Genesis itself.
When the Genesis.pot is updated for a new release of the framework, how do you compare it with older versions? This is useful to know so one doesn’t have to translate the complete Genesis.pot again.
I create a new project in the StudioPress GlotPress installation and copy over what I can. Only the new strings will have to be translated.
First I must say a big thank you for all your efforts to explain and support translations for Genesis. I really do appreciate your supportive attitude. It is a great help for us that have to deal with different languages.
However I am a little confused here when it comes to moving the .po and .mo files from the Genesis-folder to the Child Theme folder. Because, as far as I can see, there will be confusion between the .po and .mo-files for the Child Theme and those added fron the Genesis framework.
And there are not just the sv_SE.po andcorresponding .mo-files (for my language), but also files like: continents-cities-sv_SE.po, admin-sv_SE.po, admin-network-sv_SE.po twentytwelve-sv_SE.po and so on.
Does this mean that I can rename the framework file to for example: genesis-sv_SE.po and the child theme file to: child-theme-name_sv_SE.po, something like that.
Does this affect any settings elsewhere, like in config-files and such?
I would be glad if this could be clear to me.
Best regards
Thanks for the kind words
I do think however that you’re much better off with my Genesis Translations plugin (which includes Swedish).
Didn´t tink of the plugin at all. Now, I installed it and everything looks nice. The point is that it will be a lot easier for my clients to manage their website. Very simple, indeed.
Thank you for all help!
Hi, I can’t seem to grasp the concept of lang attribute.
If I want the admin end to be in english (it’s easier for me), but front end in russian (which uses cyrillic), is it enough just to type my posts in russian? What about html attribute lang and xml:lang, are they important for search engines? If yes, how do I change that without affecting the whole admin side of WP. Thank you very much.
In theory it’s enough to blog in Russian, but Google does look at the HTML language attribute to determine to which audience you are targeting your content. So, for starters, have
wp-config.phpbe configured with the proper language code alongside the plugin like WP Native Dashboard.ok, thanks. Today I also found admin-in-english. It’s light and mostly does what it’s says, but your suggested one has much more capabilities, including the toolbar on the front is also back in English, which I like. Thanks.