[wp-trac] [WordPress Trac] #9112: Use gettext's contexts and
extracted comments instead of our pipe syntax
WordPress Trac
wp-trac at lists.automattic.com
Thu Feb 12 14:51:18 GMT 2009
#9112: Use gettext's contexts and extracted comments instead of our pipe syntax
-------------------------+--------------------------------------------------
Reporter: nbachiyski | Owner: nbachiyski
Type: enhancement | Status: new
Priority: normal | Milestone: 2.8
Component: i18n | Version: 2.7
Severity: minor | Keywords:
-------------------------+--------------------------------------------------
Our current (#3687) functionality for disambiguating and adding
descriptions to translated strings has some flaws:
* We are using the same syntax (the pipe) for both disambiguating and
adding descriptions
* It screws translation memories, because {{{Approved|main page}}} and
{{{Approved|adjective}}} are different strings for them
* Translations get confused and often don't get that the text after | is
a description or context
Instead, the recent gettext versions provide the following functionality:
* Contexts, which are part of the PO syntax:
{{{
msgctxt "context"
msgid "term"
msgstr "translation"
}}}
xgettext supports it and most translation tools too. poEdit works
correctly with them, but still doesn't show the context anywhere.
* Extracted comments. If there is a comment directly preceding the
gettext call, starting with, let's say {{{translators}}}, it is inserted
as a comment in the PO file.
{{{
/* translators, see http://php.net/date */
$date = date(__('d.m.Y'));
}}}
becomes:
{{{
#. translators, see http://php.net/date
msgid "d.m.Y"
msgstr ""
}}}
These comments are shown by all translation software.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/9112>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list