Duplicate source text and domain support

10 views
Skip to first unread message

Yves

unread,
Jan 30, 2011, 9:44:53 AM1/30/11
to transifex-devel
Hi,

Since a PO file uses the source text as its ID I cannot upload a file
like the example below to Transifex:

msgid "simple text"
msgstr ""

msgid "simple text"
msgstr ""

To work around the problem of text being IDs PO is normally using
domains:
So something like the following should work:

msgid "simple text"
msgstr ""

domain "second"
msgid "simple text"
msgstr ""

But it doesn't. I also get an error when trying to upload such file.
However, according the 0.9 release notes, There is support for domain:
"dded support for intltool multi-domain projects."
(http://help.transifex.net/technical/releases/0.9.html?
highlight=domain)

Would it be possible to have an example of how domains can be used
with Transifex (or how to deal with duplicate source text)?

Many thanks,
-yves

Asgeir Frimannsson

unread,
Jan 31, 2011, 3:01:57 AM1/31/11
to transif...@googlegroups.com
On Sun, Jan 30, 2011 at 3:44 PM, Yves <yv...@opentag.com> wrote:
Hi,

Since a PO file uses the source text as its ID I cannot upload a file
like the example below to Transifex:

msgid "simple text"
msgstr ""

msgid "simple text"
msgstr ""

To work around the problem of text being IDs PO is normally using
domains:
So something like the following should work:

msgid "simple text"
msgstr ""

domain "second"
msgid "simple text"
msgstr ""

But it doesn't.

Just a general comment on 'domain' in gettext: While there are a few examples of the use of 'domain' in PO/gettext [1], in my experience this is in 99.9% of projects not used and considered a somewhat obscure feature. If you really want duplicate msgid's (and you can control what's being generated) i would suggest perhaps using msgctx. for instance:

msgid "simple text"
msgstr ""

msgctxt "second"
msgid "simple text"
msgstr ""

Take for instance java properties or other key/value pair style formats, cou could use msgctxt as the "key" and msgid as the "value".

cheers,
asgeir

[1] http://google.com/codesearch?hl=en&lr=&q=file:^.*\.po$+^domain&sbtn=Search

Dimitris Glezos

unread,
Jan 31, 2011, 3:20:01 AM1/31/11
to transif...@googlegroups.com
On Mon, Jan 31, 2011 at 12:01 AM, Asgeir Frimannsson <asg...@gmail.com> wrote:
> Just a general comment on 'domain' in gettext: While there are a few
> examples of the use of 'domain' in PO/gettext [1], in my experience this is
> in 99.9% of projects not used and considered a somewhat obscure feature. If
> you really want duplicate msgid's (and you can control what's being
> generated) i would suggest perhaps using msgctx.

+1.

msgctxt should work perfectly with Transifex.

-d


> for instance:
> msgid "simple text"
> msgstr ""
>
> msgctxt "second"
> msgid "simple text"
> msgstr ""
>
> Take for instance java properties or other key/value pair style formats, cou
> could use msgctxt as the "key" and msgid as the "value".
> cheers,
> asgeir
> [1]
> http://google.com/codesearch?hl=en&lr=&q=file:^.*\.po$+^domain&sbtn=Search

--
Dimitris Glezos

Transifex: The Multilingual Publishing Revolution
http://www.transifex.net/ -- http://www.indifex.com/

Yves Savourel

unread,
Jan 31, 2011, 6:28:06 AM1/31/11
to transif...@googlegroups.com
> If you really want duplicate msgid's (and you
> can control what's being generated) i would suggest
> perhaps using msgctx. for instance:
> ...

> Take for instance java properties or other key/value
> pair style formats, cou could use msgctxt as the
> "key" and msgid as the "value".

Perfect. Thanks Asgeir.
-ys

Yves Savourel

unread,
Jan 31, 2011, 6:38:35 AM1/31/11
to transif...@googlegroups.com
>> generated) i would suggest perhaps using msgctx.
>
> +1.
> msgctxt should work perfectly with Transifex.

It does. Thanks Dimitris.

-ys

Reply all
Reply to author
Forward
0 new messages