changeset 19070:290a61833b99 stable

translations: change label integer error to not specify the kind of label The current error message used the kind (bookmark, branch, tag) in the message. Unfortunately this isn't easily translatable since some languages give different genders to these words. The fix is to not specify it at all, since it should be implicit based on the command the user just ran. Relevant discussions around this area: http://selenic.com/pipermail/mercurial-devel/2012-October/045567.html http://selenic.com/pipermail/mercurial-devel/2012-October/045600.html
author Durham Goode <durham@fb.com>
date Fri, 19 Apr 2013 10:55:11 -0700
parents 96e9081e968b
children 64ea454e7d76
files mercurial/scmutil.py tests/test-bookmarks.t
diffstat 2 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/scmutil.py	Thu Apr 18 23:50:15 2013 -0500
+++ b/mercurial/scmutil.py	Fri Apr 19 10:55:11 2013 -0700
@@ -41,6 +41,8 @@
         ui.status(_("no changes found\n"))
 
 def checknewlabel(repo, lbl, kind):
+    # Do not use the "kind" parameter in ui output.
+    # It makes strings difficult to translate.
     if lbl in ['tip', '.', 'null']:
         raise util.Abort(_("the name '%s' is reserved") % lbl)
     for c in (':', '\0', '\n', '\r'):
@@ -48,7 +50,7 @@
             raise util.Abort(_("%r cannot be used in a name") % c)
     try:
         int(lbl)
-        raise util.Abort(_("a %s cannot have an integer as its name") % kind)
+        raise util.Abort(_("cannot use an integer as a name"))
     except ValueError:
         pass
 
--- a/tests/test-bookmarks.t	Thu Apr 18 23:50:15 2013 -0500
+++ b/tests/test-bookmarks.t	Fri Apr 19 10:55:11 2013 -0700
@@ -260,7 +260,7 @@
 bookmark with integer name
 
   $ hg bookmark 10
-  abort: a bookmark cannot have an integer as its name
+  abort: cannot use an integer as a name
   [255]
 
 incompatible options