mirror of
https://github.com/facebook/sapling.git
synced 2024-10-06 23:07:18 +03:00
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.
This commit is contained in:
parent
9d926f0131
commit
2c811cd701
116
i18n/de.po
116
i18n/de.po
@ -9744,86 +9744,9 @@ msgstr "(erwäge die Option --after)\n"
|
|||||||
msgid "child process failed to start"
|
msgid "child process failed to start"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. i18n: column positioning for "hg log"
|
|
||||||
#, python-format
|
|
||||||
msgid "changeset: %s\n"
|
|
||||||
msgstr "Änderung: %s\n"
|
|
||||||
|
|
||||||
#. i18n: column positioning for "hg log"
|
|
||||||
#, python-format
|
|
||||||
msgid "branch: %s\n"
|
|
||||||
msgstr "Zweig: %s\n"
|
|
||||||
|
|
||||||
#. i18n: column positioning for "hg log"
|
|
||||||
#, python-format
|
|
||||||
msgid "bookmark: %s\n"
|
|
||||||
msgstr "Lesezeichen: %s\n"
|
|
||||||
|
|
||||||
#. i18n: column positioning for "hg log"
|
|
||||||
#, python-format
|
|
||||||
msgid "tag: %s\n"
|
|
||||||
msgstr "Marke: %s\n"
|
|
||||||
|
|
||||||
#. i18n: column positioning for "hg log"
|
|
||||||
#, python-format
|
|
||||||
msgid "phase: %s\n"
|
|
||||||
msgstr "Phase: %s\n"
|
|
||||||
|
|
||||||
#. i18n: column positioning for "hg log"
|
|
||||||
#, python-format
|
|
||||||
msgid "parent: %s\n"
|
|
||||||
msgstr "Vorgänger: %s\n"
|
|
||||||
|
|
||||||
#. i18n: column positioning for "hg log"
|
|
||||||
#, python-format
|
|
||||||
msgid "manifest: %d:%s\n"
|
|
||||||
msgstr "Manifest: %d:%s\n"
|
|
||||||
|
|
||||||
#. i18n: column positioning for "hg log"
|
|
||||||
#, python-format
|
|
||||||
msgid "user: %s\n"
|
|
||||||
msgstr "Nutzer: %s\n"
|
|
||||||
|
|
||||||
#. i18n: column positioning for "hg log"
|
|
||||||
#, python-format
|
|
||||||
msgid "date: %s\n"
|
|
||||||
msgstr "Datum: %s\n"
|
|
||||||
|
|
||||||
#. i18n: column positioning for "hg log"
|
|
||||||
msgid "files:"
|
|
||||||
msgstr "Dateien:"
|
|
||||||
|
|
||||||
#. i18n: column positioning for "hg log"
|
|
||||||
msgid "files+:"
|
|
||||||
msgstr "Dateien+:"
|
|
||||||
|
|
||||||
#. i18n: column positioning for "hg log"
|
|
||||||
msgid "files-:"
|
|
||||||
msgstr "Dateien-:"
|
|
||||||
|
|
||||||
#. i18n: column positioning for "hg log"
|
|
||||||
#, python-format
|
|
||||||
msgid "files: %s\n"
|
|
||||||
msgstr "Dateien: %s\n"
|
|
||||||
|
|
||||||
#. i18n: column positioning for "hg log"
|
|
||||||
#, python-format
|
|
||||||
msgid "copies: %s\n"
|
|
||||||
msgstr "Kopien: %s\n"
|
|
||||||
|
|
||||||
#. i18n: column positioning for "hg log"
|
|
||||||
#, python-format
|
|
||||||
msgid "extra: %s=%s\n"
|
|
||||||
msgstr "Extra: %s=%s\n"
|
|
||||||
|
|
||||||
msgid "description:\n"
|
msgid "description:\n"
|
||||||
msgstr "Beschreibung:\n"
|
msgstr "Beschreibung:\n"
|
||||||
|
|
||||||
#. i18n: column positioning for "hg log"
|
|
||||||
#, python-format
|
|
||||||
msgid "summary: %s\n"
|
|
||||||
msgstr "Zusammenfassung: %s\n"
|
|
||||||
|
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "%s: no key named '%s'"
|
msgid "%s: no key named '%s'"
|
||||||
msgstr "%s: kein Schlüsselwort '%s'"
|
msgstr "%s: kein Schlüsselwort '%s'"
|
||||||
@ -23194,6 +23117,45 @@ msgstr ""
|
|||||||
":emailuser: Beliebiger Text. Gibt den Nutzerteil einer E-Mail-Adresse\n"
|
":emailuser: Beliebiger Text. Gibt den Nutzerteil einer E-Mail-Adresse\n"
|
||||||
" (vor dem @-Zeichen) zurück."
|
" (vor dem @-Zeichen) zurück."
|
||||||
|
|
||||||
|
#. i18n: column positioning for "hg log"
|
||||||
|
#, python-format
|
||||||
|
msgid ""
|
||||||
|
"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"
|
||||||
|
msgstr ""
|
||||||
|
"Lesezeichen: %s\n"
|
||||||
|
"Zweig: %s\n"
|
||||||
|
"Änderung: %s\n"
|
||||||
|
"Kopien: %s\n"
|
||||||
|
"Datum: %s\n"
|
||||||
|
"Extra: %s=%s\n"
|
||||||
|
"Dateien+: %s\n"
|
||||||
|
"Dateien-: %s\n"
|
||||||
|
"Dateien: %s\n"
|
||||||
|
"instability: %s\n"
|
||||||
|
"Manifest: %s\n"
|
||||||
|
"obsolete: %s\n"
|
||||||
|
"Vorgänger: %s\n"
|
||||||
|
"Phase: %s\n"
|
||||||
|
"Zusammenfassung: %s\n"
|
||||||
|
"Marke: %s\n"
|
||||||
|
"Nutzer: %s\n"
|
||||||
|
|
||||||
msgid ":author: String. The unmodified author of the changeset."
|
msgid ":author: String. The unmodified author of the changeset."
|
||||||
msgstr ":author: Zeichenkette. Der unveränderte Autor eines Änderungssatzes."
|
msgstr ":author: Zeichenkette. Der unveränderte Autor eines Änderungssatzes."
|
||||||
|
|
||||||
|
@ -1571,6 +1571,7 @@ class changeset_printer(object):
|
|||||||
self.hunk = {}
|
self.hunk = {}
|
||||||
self.lastheader = None
|
self.lastheader = None
|
||||||
self.footer = None
|
self.footer = None
|
||||||
|
self._columns = templatekw.getlogcolumns()
|
||||||
|
|
||||||
def flush(self, ctx):
|
def flush(self, ctx):
|
||||||
rev = ctx.rev()
|
rev = ctx.rev()
|
||||||
@ -1610,8 +1611,8 @@ class changeset_printer(object):
|
|||||||
label='log.node')
|
label='log.node')
|
||||||
return
|
return
|
||||||
|
|
||||||
# i18n: column positioning for "hg log"
|
columns = self._columns
|
||||||
self.ui.write(_("changeset: %s\n") % scmutil.formatchangeid(ctx),
|
self.ui.write(columns['changeset'] % scmutil.formatchangeid(ctx),
|
||||||
label=_changesetlabels(ctx))
|
label=_changesetlabels(ctx))
|
||||||
|
|
||||||
# branches are shown first before any other names due to backwards
|
# branches are shown first before any other names due to backwards
|
||||||
@ -1619,9 +1620,7 @@ class changeset_printer(object):
|
|||||||
branch = ctx.branch()
|
branch = ctx.branch()
|
||||||
# don't show the default branch name
|
# don't show the default branch name
|
||||||
if branch != 'default':
|
if branch != 'default':
|
||||||
# i18n: column positioning for "hg log"
|
self.ui.write(columns['branch'] % branch, label='log.branch')
|
||||||
self.ui.write(_("branch: %s\n") % branch,
|
|
||||||
label='log.branch')
|
|
||||||
|
|
||||||
for nsname, ns in self.repo.names.iteritems():
|
for nsname, ns in self.repo.names.iteritems():
|
||||||
# branches has special logic already handled above, so here we just
|
# branches has special logic already handled above, so here we just
|
||||||
@ -1634,33 +1633,25 @@ class changeset_printer(object):
|
|||||||
self.ui.write(ns.logfmt % name,
|
self.ui.write(ns.logfmt % name,
|
||||||
label='log.%s' % ns.colorname)
|
label='log.%s' % ns.colorname)
|
||||||
if self.ui.debugflag:
|
if self.ui.debugflag:
|
||||||
# i18n: column positioning for "hg log"
|
self.ui.write(columns['phase'] % ctx.phasestr(), label='log.phase')
|
||||||
self.ui.write(_("phase: %s\n") % ctx.phasestr(),
|
|
||||||
label='log.phase')
|
|
||||||
for pctx in scmutil.meaningfulparents(self.repo, ctx):
|
for pctx in scmutil.meaningfulparents(self.repo, ctx):
|
||||||
label = 'log.parent changeset.%s' % pctx.phasestr()
|
label = 'log.parent changeset.%s' % pctx.phasestr()
|
||||||
# i18n: column positioning for "hg log"
|
self.ui.write(columns['parent'] % scmutil.formatchangeid(pctx),
|
||||||
self.ui.write(_("parent: %s\n") % scmutil.formatchangeid(pctx),
|
|
||||||
label=label)
|
label=label)
|
||||||
|
|
||||||
if self.ui.debugflag and rev is not None:
|
if self.ui.debugflag and rev is not None:
|
||||||
mnode = ctx.manifestnode()
|
mnode = ctx.manifestnode()
|
||||||
mrev = self.repo.manifestlog._revlog.rev(mnode)
|
mrev = self.repo.manifestlog._revlog.rev(mnode)
|
||||||
# i18n: column positioning for "hg log"
|
self.ui.write(columns['manifest']
|
||||||
self.ui.write(_("manifest: %s\n")
|
|
||||||
% scmutil.formatrevnode(self.ui, mrev, mnode),
|
% scmutil.formatrevnode(self.ui, mrev, mnode),
|
||||||
label='ui.debug log.manifest')
|
label='ui.debug log.manifest')
|
||||||
# i18n: column positioning for "hg log"
|
self.ui.write(columns['user'] % ctx.user(), label='log.user')
|
||||||
self.ui.write(_("user: %s\n") % ctx.user(),
|
self.ui.write(columns['date'] % util.datestr(ctx.date()),
|
||||||
label='log.user')
|
|
||||||
# i18n: column positioning for "hg log"
|
|
||||||
self.ui.write(_("date: %s\n") % util.datestr(ctx.date()),
|
|
||||||
label='log.date')
|
label='log.date')
|
||||||
|
|
||||||
if ctx.isunstable():
|
if ctx.isunstable():
|
||||||
# i18n: column positioning for "hg log"
|
|
||||||
instabilities = ctx.instabilities()
|
instabilities = ctx.instabilities()
|
||||||
self.ui.write(_("instability: %s\n") % ', '.join(instabilities),
|
self.ui.write(columns['instability'] % ', '.join(instabilities),
|
||||||
label='log.instability')
|
label='log.instability')
|
||||||
|
|
||||||
elif ctx.obsolete():
|
elif ctx.obsolete():
|
||||||
@ -1670,31 +1661,22 @@ class changeset_printer(object):
|
|||||||
|
|
||||||
if self.ui.debugflag:
|
if self.ui.debugflag:
|
||||||
files = ctx.p1().status(ctx)[:3]
|
files = ctx.p1().status(ctx)[:3]
|
||||||
for key, value in zip([# i18n: column positioning for "hg log"
|
for key, value in zip(['files', 'files+', 'files-'], files):
|
||||||
_("files:"),
|
|
||||||
# i18n: column positioning for "hg log"
|
|
||||||
_("files+:"),
|
|
||||||
# i18n: column positioning for "hg log"
|
|
||||||
_("files-:")], files):
|
|
||||||
if value:
|
if value:
|
||||||
self.ui.write("%-12s %s\n" % (key, " ".join(value)),
|
self.ui.write(columns[key] % " ".join(value),
|
||||||
label='ui.debug log.files')
|
label='ui.debug log.files')
|
||||||
elif ctx.files() and self.ui.verbose:
|
elif ctx.files() and self.ui.verbose:
|
||||||
# i18n: column positioning for "hg log"
|
self.ui.write(columns['files'] % " ".join(ctx.files()),
|
||||||
self.ui.write(_("files: %s\n") % " ".join(ctx.files()),
|
|
||||||
label='ui.note log.files')
|
label='ui.note log.files')
|
||||||
if copies and self.ui.verbose:
|
if copies and self.ui.verbose:
|
||||||
copies = ['%s (%s)' % c for c in copies]
|
copies = ['%s (%s)' % c for c in copies]
|
||||||
# i18n: column positioning for "hg log"
|
self.ui.write(columns['copies'] % ' '.join(copies),
|
||||||
self.ui.write(_("copies: %s\n") % ' '.join(copies),
|
|
||||||
label='ui.note log.copies')
|
label='ui.note log.copies')
|
||||||
|
|
||||||
extra = ctx.extra()
|
extra = ctx.extra()
|
||||||
if extra and self.ui.debugflag:
|
if extra and self.ui.debugflag:
|
||||||
for key, value in sorted(extra.items()):
|
for key, value in sorted(extra.items()):
|
||||||
# i18n: column positioning for "hg log"
|
self.ui.write(columns['extra'] % (key, util.escapestr(value)),
|
||||||
self.ui.write(_("extra: %s=%s\n")
|
|
||||||
% (key, util.escapestr(value)),
|
|
||||||
label='ui.debug log.extra')
|
label='ui.debug log.extra')
|
||||||
|
|
||||||
description = ctx.description().strip()
|
description = ctx.description().strip()
|
||||||
@ -1706,9 +1688,7 @@ class changeset_printer(object):
|
|||||||
label='ui.note log.description')
|
label='ui.note log.description')
|
||||||
self.ui.write("\n\n")
|
self.ui.write("\n\n")
|
||||||
else:
|
else:
|
||||||
# i18n: column positioning for "hg log"
|
self.ui.write(columns['summary'] % description.splitlines()[0],
|
||||||
self.ui.write(_("summary: %s\n") %
|
|
||||||
description.splitlines()[0],
|
|
||||||
label='log.summary')
|
label='log.summary')
|
||||||
self.ui.write("\n")
|
self.ui.write("\n")
|
||||||
|
|
||||||
@ -1719,8 +1699,7 @@ class changeset_printer(object):
|
|||||||
|
|
||||||
if obsfate:
|
if obsfate:
|
||||||
for obsfateline in obsfate:
|
for obsfateline in obsfate:
|
||||||
# i18n: column positioning for "hg log"
|
self.ui.write(self._columns['obsolete'] % obsfateline,
|
||||||
self.ui.write(_("obsolete: %s\n") % obsfateline,
|
|
||||||
label='log.obsfate')
|
label='log.obsfate')
|
||||||
|
|
||||||
def _exthook(self, ctx):
|
def _exthook(self, ctx):
|
||||||
|
@ -25,6 +25,7 @@ class namespaces(object):
|
|||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self._names = util.sortdict()
|
self._names = util.sortdict()
|
||||||
|
columns = templatekw.getlogcolumns()
|
||||||
|
|
||||||
# we need current mercurial named objects (bookmarks, tags, and
|
# we need current mercurial named objects (bookmarks, tags, and
|
||||||
# branches) to be initialized somewhere, so that place is here
|
# branches) to be initialized somewhere, so that place is here
|
||||||
@ -32,8 +33,7 @@ class namespaces(object):
|
|||||||
bmknamemap = lambda repo, name: tolist(repo._bookmarks.get(name))
|
bmknamemap = lambda repo, name: tolist(repo._bookmarks.get(name))
|
||||||
bmknodemap = lambda repo, node: repo.nodebookmarks(node)
|
bmknodemap = lambda repo, node: repo.nodebookmarks(node)
|
||||||
n = namespace("bookmarks", templatename="bookmark",
|
n = namespace("bookmarks", templatename="bookmark",
|
||||||
# i18n: column positioning for "hg log"
|
logfmt=columns['bookmark'],
|
||||||
logfmt=_("bookmark: %s\n"),
|
|
||||||
listnames=bmknames,
|
listnames=bmknames,
|
||||||
namemap=bmknamemap, nodemap=bmknodemap,
|
namemap=bmknamemap, nodemap=bmknodemap,
|
||||||
builtin=True)
|
builtin=True)
|
||||||
@ -43,8 +43,7 @@ class namespaces(object):
|
|||||||
tagnamemap = lambda repo, name: tolist(repo._tagscache.tags.get(name))
|
tagnamemap = lambda repo, name: tolist(repo._tagscache.tags.get(name))
|
||||||
tagnodemap = lambda repo, node: repo.nodetags(node)
|
tagnodemap = lambda repo, node: repo.nodetags(node)
|
||||||
n = namespace("tags", templatename="tag",
|
n = namespace("tags", templatename="tag",
|
||||||
# i18n: column positioning for "hg log"
|
logfmt=columns['tag'],
|
||||||
logfmt=_("tag: %s\n"),
|
|
||||||
listnames=tagnames,
|
listnames=tagnames,
|
||||||
namemap=tagnamemap, nodemap=tagnodemap,
|
namemap=tagnamemap, nodemap=tagnodemap,
|
||||||
deprecated={'tip'},
|
deprecated={'tip'},
|
||||||
@ -55,8 +54,7 @@ class namespaces(object):
|
|||||||
bnamemap = lambda repo, name: tolist(repo.branchtip(name, True))
|
bnamemap = lambda repo, name: tolist(repo.branchtip(name, True))
|
||||||
bnodemap = lambda repo, node: [repo[node].branch()]
|
bnodemap = lambda repo, node: [repo[node].branch()]
|
||||||
n = namespace("branches", templatename="branch",
|
n = namespace("branches", templatename="branch",
|
||||||
# i18n: column positioning for "hg log"
|
logfmt=columns['branch'],
|
||||||
logfmt=_("branch: %s\n"),
|
|
||||||
listnames=bnames,
|
listnames=bnames,
|
||||||
namemap=bnamemap, nodemap=bnodemap,
|
namemap=bnamemap, nodemap=bnodemap,
|
||||||
builtin=True)
|
builtin=True)
|
||||||
|
@ -17,6 +17,7 @@ from . import (
|
|||||||
encoding,
|
encoding,
|
||||||
error,
|
error,
|
||||||
hbisect,
|
hbisect,
|
||||||
|
i18n,
|
||||||
obsutil,
|
obsutil,
|
||||||
patch,
|
patch,
|
||||||
pycompat,
|
pycompat,
|
||||||
@ -301,6 +302,30 @@ def getrenamedfn(repo, endrev=None):
|
|||||||
|
|
||||||
return getrenamed
|
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
|
# default templates internally used for rendering of lists
|
||||||
defaulttempl = {
|
defaulttempl = {
|
||||||
'parent': '{rev}:{node|formatnode} ',
|
'parent': '{rev}:{node|formatnode} ',
|
||||||
|
Loading…
Reference in New Issue
Block a user