Your plugins ready for WordPress PolyGlots

Perhaps, you are writing a new WordPress plugin and perhaps, you do want to translate it… If this is your case, there are two approaches: to translate the code via a code translator programme, for example PoEdit, or to use the translations WordPress system called PolyGlots.

Close up of the Rosetta Stone replica

In the first case –translating via an external programme– you just follow the general i18n WordPress developement recomendations for local languages but, if you have choosen WordPress PolyGlots plataform then, in addition to the general i18n rules, you have to do some little changes in the code of your plugin. In fact, there are not a lot of changes to do, just a few ones. Continue reading…

Constructing WP themes or plugins that take into account future gender translations (2)

Few days ago I began a serie of articles about how to design a WordPress Theme that facilitates that in the future it is possible to make a translation that takes into account the gender. In the first article I suggested a little technique to mark the Post Type (and for extension Taxonomy) objects including a new property that keeps the gender of the object and that depends on the translation today I’m going to extend this technique also for the labels of the Post type inside the Admin interface.

The #superhero bathroom at  @CommonDesk #fordtx #digitaldallas

As we saw, the core of the first proposal consists of adding one more line inside the array that is used to register any post type Continue reading…

Constructing WP themes or plugins that take into account future gender translations

Actually, there is not a simple solution for avoid the gender issue if you are translating a WP theme or plugin to languages that take into account the gender for selecting the words of a sentence. Simple, try to substitute the gendered words or expression for others that feet into the sentence without too many problems… But if you are not translating but creating a new theme or plugin you can use a simple set of techniques –better maybe suggestions–, that will allow future translators for dealing to this kind of problems with better results. Let’s go to see three simple proposals.

Rest area

But, before to go to the solution, let me show you a tiny example of this kind of gender issues. Continue reading…

Loading a language translation in a Child Theme

When we need introduce some changes in the behaviour, features or style of the theme that we are using, Best practices in the WordPress environment advises us to never change the principal theme but writting a small child theme containing those modifications. In that case, when those modifications show text on the screen, of course we can opt for outputting directly this text but it’s usually better to use the translation functions. But then, How to read a child theme translation keeping the principal (parent) theme translation?

Loading a language translation in a Child Theme

The solution is very simple because in fact there are two different functions to do that. For reading the translation of the parent theme, we have to use the function called load_theme_textdomain however, for reading the translation of the child theme Continue reading…