Mercurial > public > mercurial-scm > hg-stable
diff mercurial/templatekw.py @ 35222: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 |
line wrap: on
line diff
--- a/mercurial/templatekw.py Sat Dec 02 16:08:24 2017 +0900 +++ b/mercurial/templatekw.py Sat Dec 02 16:29:49 2017 +0900 @@ -17,6 +17,7 @@ encoding, error, hbisect, + i18n, obsutil, patch, pycompat, @@ -301,6 +302,30 @@ return getrenamed +def getlogcolumns(): + """Return a dict of log column labels""" + _ = pycompat.identity # temporarily disable gettext + # i18n: column positioning for "hg log" + columns = _('bookmark: %s\n' + 'branch: %s\n' + 'changeset: %s\n' + 'copies: %s\n' + 'date: %s\n' + 'extra: %s=%s\n' + 'files+: %s\n' + 'files-: %s\n' + 'files: %s\n' + 'instability: %s\n' + 'manifest: %s\n' + 'obsolete: %s\n' + 'parent: %s\n' + 'phase: %s\n' + 'summary: %s\n' + 'tag: %s\n' + 'user: %s\n') + return dict(zip([s.split(':', 1)[0] for s in columns.splitlines()], + i18n._(columns).splitlines(True))) + # default templates internally used for rendering of lists defaulttempl = { 'parent': '{rev}:{node|formatnode} ',