|
Translations
Translations & What is i18n?We'd like to see K2 translated to as many languages as possible, and to do that, we need your help. This page contains instructions on how to get started with translating K2 and how we deal with translations in general. If you have any questions, let us know over at the support mailing list. i18n is short for 'internationalization' (the 18 being the 18 letters between the i and the n in internationalization), and the general denomination for the translation process used for K2. You can read more about the process at WordPress's translation page. The next release of K2, version 1.1 will most likely be the first release to include current translations. How to get WP/K2 translation workingK2 uses the same language set as WordPress (read more) and the appropriate language file (the .mo file) for K2 must be present in the /wp-content/themes/k2/languages/ folder in K2. Translations can be found at the K2 i18n repository. You only need the .mo file for your locale to get the translation working. You can also download the .po file (which is editable) to change anything you like in the translation. To set the language you want for Wordpress (which plugins, and themes like K2 also pick up on) simply edit your wp-config.php file and add (or change) the following line: define ('WPLANG', 'nl_NL'); Instead of ‘nl_NL’ (which is for Dutch) use the country code you need, such as ‘es_ES’ (for Spanish). The naming is done as follows:
To have the rest of your Wordpress installation in your own language, follow these instructions. How To Translate K2There are other ways to perform the actual translation, however the step-by-step outlined here, should work on most platforms:
And that's how that's done. How to Update From a New .POTWhenever something changes in K2 that requires new translations, we generate a new .POT file and put it in the subversion repository. Here's how you update your existing .PO and .MO files when a new one comes out:
That's that. Target SVN or Releases?We suggest going with the actual releases. In the past the release schedule has been a little erratic, and as a consequence nightlies were the best source for the latest K2. But from now on the releases will be the safest bet (to maintain ones sanity). Right now that means targeting K2 version 1.0.3. You can get the k2.pot for 1.0.3 here. When you're done you can share it via the 1.0.3 translation ticket. Note that K2 1.0.3 does not yet use plural forms, so no need to worry about those (yet). (If this is your first attempt at getting your translation included, it might be better to post on the K2 mailing list) How to share your translation with us (and others)For now, upload it somewhere and post the links on the K2 mailing list. If it’s a good one, we’ll add it to the SVN which means it’ll be included in the next release! Plural FormsWordpress (theme) translations allow for words to be translated in their singular and plural forms. Because different languages have different plural forms, Poedit needs to be told what kind of plural forms your language follows. Before creating new catalog from pot template in poedit, you have to manualy open the .POT file (in a text editor) and search for any instance of 'msgid_plural'. Below that add as many plurals your language has. For example, Croatian has 3, so you'd end up with 3 lines as follows: msgstr[0] "" msgstr[1] "" msgstr[2] "" In your "Project Info" screen, simply replace nplurals=INTEGER; plural=EXPRESSION; with the correct code for your language:
Plural-Forms: nplurals=2; plural=n != 1;
Plural-Forms: nplurals=2; plural=n>1;
Plural-Forms: nplurals=3; plural=n==1 ? 0 : n==2 ? 1 : 2;
Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;
Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2;
Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2;
Plural-Forms: nplurals=3; plural=n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < 20)) ? 1 : 2; Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;
Plural-Forms: nplurals=4; plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3;
Plural-Forms: nplurals=4; plural=(n==0 ? 0 : n==1 ? 1 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 2 : 3);
Plural-Forms: nplurals=1; plural=0; (compiled by Kreso & maciej.szudejko, from http://www.gnu.org/software/gettext/manual/gettext.html%23Plural-forms , thanks!) |