[libreoffice-l10n] .src and .ui gettext migration

Caolán McNamara caolanm at redhat.com
Thu Jul 13 13:33:25 UTC 2017

On Thu, 2017-07-13 at 12:54 +0300, Mihkel Tõnnov wrote:
> Hi Caolán, *,
> 2017-07-13 12:43 GMT+03:00 Caolán McNamara <caolanm at redhat.com>:
> > [snip]
> > In our code I've autogenerated matching initial contexts for the
> > matching .ui and .hrc source strings.
> > 
> Could you clarify what do you mean by that?

I'll take a pair of real examples:

Currently a .hrc/.src entry of SV_APP_CPUTHREADS

//in vcl/inc/svids.hrc
#define SV_APP_CPUTHREADS                           10800

//in vcl/source/src/app.src
    Text [en-US] = "CPU threads: ";

corresponding .po entry where the msgctxt is currently autogenerated on
extraction from .src to .po

msgctxt ""
msgid "CPU threads: "
msgstr "something or other"

turns into

//in our source where the 1st arg is the context and all existing
//entries contexts are simply derived from the define name

corresponding .po entry
msgid "CPU threads: "
msgstr "something or other"

and the msgctxt is no longer generated on export to .po just taken from
the source entry

The other case is .ui entries, they go from e.g.

<property name="label" translatable="yes">Options</property>

with a .po entry of

msgctxt ""
msgid "Options"
msgstr "Optionen"

where the msgctxt is similarly autogenerated on export to .po


<property name="label" translatable="yes"

where the context/msgctxt for existing strings has been one-time
derived from the .ui filename and widget/object the string belong to

with a corresponding .po entry of

msgctxt "printdialog|label21"
msgid "Options"
msgstr "Optionen"

More information about the LibreOffice mailing list