`temporal` modules produces a lot of gettext warnings
cd locale
make pot
...
../lib/python/temporal/datetime_math.py:227: warning: 'msgid' format
string with unnamed arguments cannot be properly localized:
The translator
cannot reorder the arguments.
Please consider
using a format string with named arguments,
and a mapping
instead of a tuple for the arguments.
../lib/python/temporal/abstract_map_dataset.py:167: warning: 'msgid'
format string with unnamed arguments cannot be properly localized:
The
translator cannot reorder the arguments.
Please
consider using a format string with named arguments,
and a
mapping instead of a tuple for the arguments.
../lib/python/temporal/abstract_map_dataset.py:169: warning: 'msgid'
format string with unnamed arguments cannot be properly localized:
The
translator cannot reorder the arguments.
Please
consider using a format string with named arguments,
and a
mapping instead of a tuple for the arguments.
...
They are harmless, anyway they should be fixed. They are caused by the
fact that the strings marked for translation contains more formatting
marks. They could be fixed by splitting the message [1] or using named
convention [2].
They could be fixed by splitting the message [1] or using named
convention [2].
[1] is the wrong thing to do (and that particular example should be
reverted). It eliminates the warning without addressing the issue
which caused the warning.
Warnings provide clues as to how the code can be improved. They
shouldn't be silenced by making the code worse.
If it isn't possible to eliminate a warning without degrading the
code, then the warning should just be allowed to happen.
In Python code, using named substitutions is the right approach; it's
guaranteed to be supported by any version of Python which will work
with GRASS. With C code, not all platforms support numbered
specifications, but I don't think that xgettext warns about that.
They could be fixed by splitting the message [1] or using named
convention [2].
[1] is the wrong thing to do (and that particular example should be
reverted). It eliminates the warning without addressing the issue
which caused the warning.
Warnings provide clues as to how the code can be improved. They
shouldn't be silenced by making the code worse.
I am not sure if we are speaking about same thing.
../lib/python/temporal/datetime_math.py:227: warning: 'msgid' format
string with unnamed arguments cannot be properly localized:
The translator cannot reorder the arguments.
>> They could be fixed by splitting the message [1] ...
> [1] is the wrong thing to do ...
I am not sure if we are speaking about same thing.
I'm talking about "splitting the message".
IIUC, the issue relates to strings with more than one substitution. If
the substitutions are matched with parameters by position (i.e. the
first substitution uses the first parameter, etc), the translated
string cannot have the parameters in a different order, even if that
would be appropriate for a particular language.
Splitting the message (so that each translated string contains a
single substitution) might eliminate the warnings (I don't know
whether it does, but I assumed that was the idea behind the "splitting
the message" suggestion), but it won't do anything about the issue
which caused the warning.
../lib/python/temporal/datetime_math.py:227: warning: 'msgid' format
string with unnamed arguments cannot be properly localized:
The translator cannot reorder the arguments.
>> They could be fixed by splitting the message [1] ...
> [1] is the wrong thing to do ...
I am not sure if we are speaking about same thing.
I'm talking about "splitting the message".
IIUC, the issue relates to strings with more than one substitution. If
the substitutions are matched with parameters by position (i.e. the
first substitution uses the first parameter, etc), the translated
string cannot have the parameters in a different order, even if that
would be appropriate for a particular language.
Splitting the message (so that each translated string contains a
single substitution) might eliminate the warnings (I don't know
whether it does, but I assumed that was the idea behind the "splitting
the message" suggestion), but it won't do anything about the issue
which caused the warning.