[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bug finding arguments past the first one in C# code
From: |
Bruno Haible |
Subject: |
Re: bug finding arguments past the first one in C# code |
Date: |
Fri, 3 Apr 2009 01:27:49 +0200 |
User-agent: |
KMail/1.9.9 |
Hello,
Thomas Colin wrote:
> Here is the command I would like to use:
> * >find . -name '*.cs' -o -name '*.c' | xgettext -f - -k_ -kDescription
> -kRightDescription:1,2 -kEditorParams:3 -L 'C#' -L C --from-code UTF-8 -o
> po/myprogram.pot*
The -L option is not cumulative. Only the last -L option matters. If you have
sources in several programming languages and want to create a single POT
file from them, the best way to do this is:
1. one invocation of xgettext for each programming language, each producing
a partial POT file,
2. afterwards, an invocation of xgettext with all the partial POT files
as arguments; this will combine the POT files.
> PS: I don't think this plays any role at all, but here is an example of the
> C# code involved:
> *class Rights
> {
> [RightDescription("right1", "rightgroup1")]
> public bool myright;
>
> [RightDescription("right2","rightgroup1")]
> public bool myotherright;
> }*
> ...
> -kRightDescription:1,2
> ...
> the second argument of RightDescription, which isn't translated.
The argument -kRightDescription:1,2 means that RightDescription should
be treated like a function that takes a singular and a plural variant of the
same string in the 1st and 2nd argument. Not what you want.
> We've made other attempts, such as (...)* -kRightDescription:1
> -kRightDescription:2* (...), but nothing seemed to work.
You're getting closer: The two arguments
-kRightDescription:1 -kRightDescription:2
mean that RightDescription is an overloaded function, either getting the
string as the first argument or as the second argument. The first among
these two argument recognition rules will always match before the second
one. Still not what you want.
xgettext cannot extract multiple translatable arguments from a single
function call, so far. The workaround is that you run xgettext twice,
once with
-kRightDescription:1
and another time with
-kRightDescription:2
and then combine the two partial POT files, using "xgettext --sort-by-file".
Bruno
PS: When writing to a mailing list, please turn off the HTML format in your
mail program. This is not only necessary because many recipients are
annoyed by HTML mails, but also because your mail does not appear in the
public archives if it is in HTML format. (Probably the mailing list
software treats is like spam.)