[wp-hackers] Question about translation extensions during WP 2.8
heiko.rabe at code-styling.de
Sun Jun 21 22:34:39 GMT 2009
Thanks to Nikolay and Peter,
final question(s): This leads (or have to lead) to multiple occurances
at translation systems with the same phrase ?
The only difference is the context so the same term occuring in 50
different contexts but maybe translated the same way now consumes 50
times more space in mo file and PHP memory as would be required, right ?
> On 21 Jun 2009, at 20:07, Heiko Rabe wrote:
>> thanks for the answer. If understand it right, than the result of
>> *.mo file creation process will transform
>> _x('Published', 'page')
>> internally into
>> at the binary machine object file. If i now try to reverse a *.mo
>> file, i can't figure out, if
>> is a contextual separation string or just a menu item collection used
>> at __(), because such information about context are not stored inside
>> the binary format.
>> So how would the mo/po classes figure out this, because | becomes
>> unreliable during load of *.mo file ?
> That doesn't sound right to me.
> Looking at the code in pomo which parses the file in , and the code
> for the C gettext library, I believe the following is true
> In the binary mo file the context is stored at the start of the
> translation followed by ascii character EOT (character code 4) this is
> then followed by the translated string.
> In the plain text pot or po file it is stored in the context field,
> for example from 
> #: wp-admin/menu.php:62
> msgctxt "page"
> msgid "Add New"
> msgstr "Нова"
>  - http://svn.automattic.com/wordpress/trunk/wp-includes/pomo/mo.php
>  -
More information about the wp-hackers