![]() Then put those two file into "languages" folder.Īfter this, open wp-config.php and find this code: define ('WPLANG, '') mo file automatically, just go to File -> Preferences -> Editor and check the box that says "Automatically compile. There will be generated two files ( If poEdit does not generate the second. then edit the "translation" field, and then save as "my-pluginname-de_DE" Then download POEDIT software, and open this file. po is an extension of file, so check that your text editor program has not saved to "my-pluginname-en_US.po.TXT"). Then save this file as "my-pluginname-en_US.po" (note, that. #: mypluginindex.php:87 (it is just a line of a note, to remind where our code appears) "Plural-Forms: nplurals=2 plural=(n != 1) \n" "Content-Type: text/plain charset=utf-8\n" "Last-Translator: Automatically generated\n" "Project-Id-Version: my-pluginname 1.0\n" # This file is distributed under the same license as the PACKAGE package. # Copyright (C) 2012 THE PACKAGE'S COPYRIGHT HOLDER # English translations for PACKAGE package. Then open any text editor, then insert like this code (NOTE, THAT we are only adding two sample messages, "hello" and "bye", so, you can ADD AS MANY messages AS YOU WANT with the similar lines). Load_plugin_textdomain('my-pluginname', FALSE, dirname(plugin_basename(_FILE_)).'/languages/') php file (somewhere in the top), insert the initialization code: class load_languageĪdd_action('init', array($this, 'load_my_transl')) Then, in that plugin's folder, create a folder "languages" In every plugins head, there is an unique name. CHANGE the customs to YOUR DESIRED ones.) (Here is an EXAMPLE of translation to DEUTSCH. plugin suggestion is quite nice, but I never used it much.Don't forget to make a backup of your translation, because if you upgrade the plugin your file will be lost.If you do a full or a decent partial translation, submit it to the plugin author so he can include it in the Repository and you get credited for it.mo file, which is the one WordPress uses and basically the only one you need to upload po file, PoEdit automatically generates a. WPLANG in wp-config.php file must be set to your language, e.g., pt_BR.you'll have to fill in with your own language pt_BR means Portuguese Brazil, but many languages don't have a country variation. Example for the referenced plugin case: subscribe-reloaded-pt_BR.po.pot file and rename it to plugin-basename-lang_COUNTRY.po editable text file used to grab all the translatable strings from WordPress itself and Themes and Plugins, using Update from Sources PoEdit function some folks distribute this as a master file, but it should be used only for translations pot file, using Update from POT file PoEdit function editable text file with the translations strings There are others, but this is most used: Poedit, a cross-platform gettext catalogs (.po files) editor.
0 Comments
Leave a Reply. |