[PATCH 1 of 2] keyword: prepare kwdemo output for translation

Christian Ebert blacktrash at gmx.net
Tue Jul 21 12:16:55 CDT 2009


Hi Martin,

* Martin Geisler on Tuesday, July 21, 2009 at 18:48:02 +0200
> Christian Ebert <blacktrash at gmx.net> writes:
>> # HG changeset patch
>> # User Christian Ebert <blacktrash at gmx.net>
>> # Date 1248171792 -3600
>> # Node ID f713de0058b6f0c7e21a9c97936158ed1fa9d97b
>> # Parent  8864112d4f57815b11d49dff22d25969d3ae23a8
>> keyword: prepare kwdemo output for translation
>> 
>> Translatable strings must be complete sentences.
>> Thanks to Wagner Bruna for pointing this out.
>> 
>> diff --git a/hgext/keyword.py b/hgext/keyword.py
>> --- a/hgext/keyword.py
>> +++ b/hgext/keyword.py
>> @@ -285,7 +285,6 @@
>>         for k, v in items:
>>             ui.write('%s = %s\n' % (k, v))
>> 
>> -    msg = 'hg keyword config and expansion example'
>>     kwstatus = 'current'
>>     fn = 'demo.txt'
>>     branchname = 'demobranch'
>> @@ -319,7 +318,11 @@
>>         if k.endswith('keyword'):
>>             extension = '%s = %s' % (k, v)
>>             break
>> -    ui.status(_('\n\tconfig using %s keyword template maps\n') % kwstatus)
>> +    msg = {'current': _('config using current keyword template maps'),
>> +           'custom': _('config using custom keyword template maps'),
>> +           'default': _('config using default keyword template maps')
>> +           }[kwstatus]
> 
> Is it even necessary to output so much to the user?

I don't know, do you? ;-) Do you know how many users actually
look at "hg kwdemo -h" ... otoh, how many will run "hg kwdemo"
before actually using the extension ...

> He has 'hg kwdemo' with the --rcfile or --default flag and so
> he should know which kind of keywords he is seeing.

In theory, yes. As I said, I just think that the output of this
command should be especially user friendly. Personally, I'm fine
with a more terse output.

> Alternatively, the extension could output the right message instead of
> setting kwstatus -- it's not used for anything after being set at the
> beginning of the function.

kwstatus is used three times to determine the right kind of
message.

c
-- 
\black\trash movie    _C O W B O Y_  _C A N O E_  _C O M A_
Ein deutscher Western/A German Western
-->> http://www.blacktrash.org/underdogma/ccc.html
-->> http://www.blacktrash.org/underdogma/ccc-en.html


More information about the Mercurial-devel mailing list