commands: do not split a translated string
authorMartin Geisler <mg@lazybytes.net>
Mon, 19 Oct 2009 14:37:37 +0200
changeset 9607 8e0e0d854b60
parent 9603 220d39af2e57
child 9608 d097bc2d1945
commands: do not split a translated string Splitting the string after translation relies on the implicit assumption that translators will always translate the English words using single foreign words. Also, when translating we want as much context as possible so I've moved the string formatting into the translatable string.
mercurial/commands.py
--- a/mercurial/commands.py	Sun Oct 18 22:31:05 2009 -0500
+++ b/mercurial/commands.py	Mon Oct 19 14:37:37 2009 +0200
@@ -2901,11 +2901,13 @@
     st = list(repo.status(unknown=True))[:7]
     ms = merge_.mergestate(repo)
     st.append([f for f in ms if f == 'u'])
-    labels = _('modified added removed deleted unknown ignored unresolved')
+    labels = [_('%d modified'), _('%d added'), _('%d removed'),
+              _('%d deleted'), _('%d unknown'), _('%d ignored'),
+              _('%d unresolved')]
     t = []
-    for i,l in enumerate(labels.split()):
-        if st[i]:
-            t.append('%d %s' % (len(st[i]), l))
+    for s,l in zip(st, labels):
+        if s:
+            t.append(l % len(s))
 
     t = ', '.join(t)