Mercurial > public > mercurial-scm > hg
comparison mercurial/templatekw.py @ 35212:c7b45db8f317
log: translate column labels at once (issue5750)
This makes sure that all columns are aligned. getlogcolumns() is hosted by
templatekw so the namespaces module can see it.
i18n/de.po is updated so test-log.t passes with no error. "obsolete:" and
"instability:" are kept untranslated.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 02 Dec 2017 16:29:49 +0900 |
parents | 6fe99a8e266d |
children | 9b3f95d9783d |
comparison
equal
deleted
inserted
replaced
35211:1df2f0e1dfd2 | 35212:c7b45db8f317 |
---|---|
15 | 15 |
16 from . import ( | 16 from . import ( |
17 encoding, | 17 encoding, |
18 error, | 18 error, |
19 hbisect, | 19 hbisect, |
20 i18n, | |
20 obsutil, | 21 obsutil, |
21 patch, | 22 patch, |
22 pycompat, | 23 pycompat, |
23 registrar, | 24 registrar, |
24 scmutil, | 25 scmutil, |
299 except error.LookupError: | 300 except error.LookupError: |
300 return None | 301 return None |
301 | 302 |
302 return getrenamed | 303 return getrenamed |
303 | 304 |
305 def getlogcolumns(): | |
306 """Return a dict of log column labels""" | |
307 _ = pycompat.identity # temporarily disable gettext | |
308 # i18n: column positioning for "hg log" | |
309 columns = _('bookmark: %s\n' | |
310 'branch: %s\n' | |
311 'changeset: %s\n' | |
312 'copies: %s\n' | |
313 'date: %s\n' | |
314 'extra: %s=%s\n' | |
315 'files+: %s\n' | |
316 'files-: %s\n' | |
317 'files: %s\n' | |
318 'instability: %s\n' | |
319 'manifest: %s\n' | |
320 'obsolete: %s\n' | |
321 'parent: %s\n' | |
322 'phase: %s\n' | |
323 'summary: %s\n' | |
324 'tag: %s\n' | |
325 'user: %s\n') | |
326 return dict(zip([s.split(':', 1)[0] for s in columns.splitlines()], | |
327 i18n._(columns).splitlines(True))) | |
328 | |
304 # default templates internally used for rendering of lists | 329 # default templates internally used for rendering of lists |
305 defaulttempl = { | 330 defaulttempl = { |
306 'parent': '{rev}:{node|formatnode} ', | 331 'parent': '{rev}:{node|formatnode} ', |
307 'manifest': '{rev}:{node|formatnode}', | 332 'manifest': '{rev}:{node|formatnode}', |
308 'file_copy': '{name} ({source})', | 333 'file_copy': '{name} ({source})', |