i18n: translate each paragraph separately
authorWagner Bruna <wbruna@yahoo.com>
Tue, 06 Apr 2010 22:30:50 -0300
changeset 11390 11cd65611f3f
parent 11389 4fd49329a1b5
child 11391 9b404640d795
i18n: translate each paragraph separately Makes translation work easier by reducing message sizes and avoiding invalidating whole messages on small changes or additions to the original text.
Makefile
mercurial/i18n.py
--- a/Makefile	Thu Jun 17 20:10:34 2010 -0300
+++ b/Makefile	Tue Apr 06 22:30:50 2010 -0300
@@ -100,6 +100,7 @@
 	  --copyright-holder "Matt Mackall <mpm@selenic.com> and others" \
 	  --from-code ISO-8859-1 --join --sort-by-file \
 	  -d hg -p i18n -o hg.pot
+	$(PYTHON) i18n/posplit i18n/hg.pot
 
 %.po: i18n/hg.pot
 	msgmerge --no-location --update $@ $^
--- a/mercurial/i18n.py	Thu Jun 17 20:10:34 2010 -0300
+++ b/mercurial/i18n.py	Tue Apr 06 22:30:50 2010 -0300
@@ -36,7 +36,7 @@
     if message is None:
         return message
 
-    u = t.ugettext(message)
+    u = u'\n\n'.join([t.ugettext(m) for m in message.split('\n\n')])
     try:
         # encoding.tolocal cannot be used since it will first try to
         # decode the Unicode string. Calling u.decode(enc) really