From the article you'll learn how your favorite Russify theme to WordPress or new, but very useful English-language plugin (so that users on your blog did not bother with English). And make it so that after the update this hypothetical theme or plug-in did not have to translate it again. The article also helps you if you need only update the translation theme or plugin. This happens if the plugin drastically altered, and scored on a translator Update and some new or updated phrases were in English. As I suspect, this method works not only with WordPress'om, but also with other CMS programs and open source. In an Internet there are plenty of articles with tips such as: "Open the footer.php file and replace all the text that was found there, the Russian equivalent of (do not forget the encoding). Repeat for all files in a folder of your theme.
" And once you've listened to this advice – a theme picked up and refreshed, and you have to translate everything again. What do I suggest? I propose to create (or edit an existing) language file. Then when you update the plugin or WordPress theme translation is not going anywhere. What is the language file. Po? Theory. You've probably often seen the files with the extension. Po or. Mo in the folder with the theme for WordPress or folder ochen_poleznogo plugin? If you have not found immediately, then they can still hide in a folder "languages". Viacom has plenty of information regarding this issue.
Well, if you do not see, now you hear about them first (Very useful and free files, among other things). . Po files – if crudely, this localization. Many popular programming languages (C, C + +, scripts sh, Python, Perl, PHP, Java, Pascal and a bunch of others) have the function gettext, ngettext or the like, which mark the text for a future transfer. But, you say nothing of the sort seen in the file footer.php, header.php or ochen_poleznyy_plagin.php and you're right. Because these functions, for readability, replacing short-synonymous __ (two characters underscore) or _e _c or or something else. As a result, the code: printf (gettext ('My name is% s.'), my_name) looks like this: printf (__(' My name is% s. '), my_name) then a special extractor extract all such lines in a special file template with the extension. pot. The same line in the. Pot file will look like: #: Header.php: 19 msgid 'My name is% s.' msgstr''where header.php – this is the file from which you removed the line 'My name is% s.', and the number 19 – is the number of the line. Then create a translator from this template file localization file with the extension. Po. And in this file you can write a line break. It will look so: #: header.php: 19 msgid 'My name is% s.' msgstr 'And my name is% s.' But this is not the end. But not the beginning:). As a last touch translator program creates a binary file (compiled) extension. Mo, who fed engine WordPress. The sequence of actions to translate WordPress