[PATCH] bookmark: don't allow integers as bookmark/branch/tag names

Kevin Bullock kbullock+mercurial at ringworld.org
Fri Apr 19 13:46:14 CDT 2013


On 19 Apr 2013, at 12:51 PM, Durham Goode wrote:

> On 4/19/13 10:25 AM, "Mads Kiilerich" <mads at kiilerich.com> wrote:
> 
>> On 04/19/2013 06:59 PM, Wagner Bruna wrote:
>>> I noticed this during translation:
>>> 
>>>> +    try:
>>>> +        int(lbl)
>>>> +        raise util.Abort(_("a %s cannot have an integer as its name")
>>>> % kind)
>>> This message can't be translated, since it'd need to match the unknown
>>> parameter's particular grammatical rules (for instance, in the Brazilian
>>> Portuguese translation, 'bookmark' and 'branch' are masculine nouns,
>>> but 'tag'
>>> is feminine; the article at the beginning would need to match both).
>>> 
>>> But I'm not sure what would be a good message here... Some related
>>> translation
>>> discussions (dealing with the same function!):
>>> 
>>> http://selenic.com/pipermail/mercurial-devel/2012-October/045542.html
>>> http://selenic.com/pipermail/mercurial-devel/2012-October/045567.html
>> 
>> I suggest making
>> a patch for stable that change 'name' to 'label'
>> a patch for stable that changes the new integer message to use 'label'
>> too and thus make the kind parameter unused again
>> a patch for default after 2.6 that removes the kind parameter
> 
> Matt's comment in that original thread is to not remove the 'kinds'
> parameter since it might be used in the future.  I'll just add a comment
> in the function saying not to use it in ui output.

+1

> I'll submit a patch for stable to change it to "cannot use an integer as a
> label"

We currently use 'name', so unless you're planning to change every message in checknewlabel (which I think is unnecessary and would just create more work for translators), I'd suggest you go with that.

pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和
Kevin R. Bullock



More information about the Mercurial-devel mailing list