English and Greek use the same plural form:
Indeed, each language has it’s own peculiarities on plurals, and gettext needs to know how to handle them. Some of the tutorials mention that you need to add a plural form. From that time on, everything is built is English and then translated to any other language, even if the “other” language will be the only one.Īnyway, this post is really about Poedit and gettext secrets, so… voila! Plural forms I really don’t want to remember that project. Since I set on the plugin that I want Greek as the primary language, I was able to translate Greek to English, but how could I translate English to English?
Problem is, both gettext and most plugins assume that the files and gettext calls are written in English. “No problem” you say, “I’ll use that premium plugin that allows me to translate from within WordPress”. You have an English WordPress installation, with a hard-coded Greek theme. Then, you need to work on the English version. You end up translating the whole theme to Greek that way, and the client is happy. Of course, clients being clients, start whining about that section of the theme that says “Latest videos” instead of “Πρόσφατα βίντεο”, so you think you’ll just edit the theme’s files, and change that _e(‘Latest videos’, ‘theme’) call to _e(‘Πρόσφατα βίντεο’, ‘theme’)
You install WordPress, install a theme, install all necessary plugins, and start copying the content that he gave you. The client also wants to see progress, so you give him access to the development server. The person that will be managing the site prefers the back-end to be in English. The client (or you) needs the website up and running ASAP of course, so he/she wants the Greek version delivered tomorrow and the English version next week. Let’s start by a simple rule: Use English as your base language during development, and only use English with the localization functions.Īnd here is why: It’s very common that you need a website in (let’s call it Greek) and English. I also found troubles when actually translating a website from Greek to English. I quoted the word configure, because it’s not really Poedit’s configuration, rather than what options Poedit will pass to gettext, but whatever, I’ll be writing Poedit for easiness. The reason I’m writing this post, is the failure of every other post I’ve read to properly inform me on how to “configure” Poedit for use with WordPress. Now comes my time to speak… write… whatever…Īt this point, I’m assuming that you have read and understood what has been written on the articles/tutorials I gave you, and that you are familiar with all WordPress’ localization functions, as well as the other related functions mentioned in the same page. Internationalization: You’re probably doing it wrong.You definitely need to read the following two articles by Otto: These should be enough to get things started and do things properly, right? Probably, you already thought that instead of typing a text-domain over and over, you will use a variable or a constant, so that you can easily copy-paste from theme to theme, right? Translation with POEdit – Internationalize / Localize WP Themes Guide – Part 1 – Part 2 – Part 3.I am not going to repeat what already has been written, so here is a small list of tutorials on the subject (in case you are too lazy to search for them): There are a lot of excellent tutorials on the web regarding how to prepare your WordPress theme for translation, as well as how to translate it using Poedit. pot you can create translation files without much of the following information.
If your theme provides an up-to-date language file, either. Please note: The following tutorial is mostly about creating language files from scratch.