Mercurial > hg
changeset 6953:63b5f4c73c98
i18n: mark strings for translation in Mercurial
author | Martin Geisler <mg@daimi.au.dk> |
---|---|
date | Sun, 31 Aug 2008 16:12:02 +0200 |
parents | 3fffba1c87d0 |
children | f7d545a866e8 |
files | mercurial/bundlerepo.py mercurial/cmdutil.py mercurial/commands.py mercurial/hgweb/server.py mercurial/localrepo.py mercurial/merge.py mercurial/patch.py mercurial/repair.py mercurial/sshrepo.py mercurial/streamclone.py |
diffstat | 10 files changed, 17 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/bundlerepo.py Sun Aug 31 16:12:02 2008 +0200 +++ b/mercurial/bundlerepo.py Sun Aug 31 16:12:02 2008 +0200 @@ -39,7 +39,7 @@ for chunk, start in chunkpositer(): size = len(chunk) if size < 80: - raise util.Abort("invalid changegroup") + raise util.Abort(_("invalid changegroup")) start += 80 size -= 80 node, p1, p2, cs = struct.unpack("20s20s20s20s", chunk[:80])
--- a/mercurial/cmdutil.py Sun Aug 31 16:12:02 2008 +0200 +++ b/mercurial/cmdutil.py Sun Aug 31 16:12:02 2008 +0200 @@ -936,7 +936,7 @@ results[rev] = d elif st == 'iter': if rev in results: - ui.status("Found revision %s from %s\n" % + ui.status(_("Found revision %s from %s\n") % (rev, util.datestr(results[rev]))) return str(rev)
--- a/mercurial/commands.py Sun Aug 31 16:12:02 2008 +0200 +++ b/mercurial/commands.py Sun Aug 31 16:12:02 2008 +0200 @@ -2129,7 +2129,7 @@ cmdutil.setremoteconfig(ui, opts) other = hg.repository(ui, dest) - ui.status('pushing to %s\n' % util.hidepassword(dest)) + ui.status(_('pushing to %s\n') % util.hidepassword(dest)) if revs: revs = [repo.lookup(rev) for rev in revs] r = repo.push(other, opts['force'], revs=revs)
--- a/mercurial/hgweb/server.py Sun Aug 31 16:12:02 2008 +0200 +++ b/mercurial/hgweb/server.py Sun Aug 31 16:12:02 2008 +0200 @@ -259,7 +259,7 @@ from OpenSSL import SSL ctx = SSL.Context(SSL.SSLv23_METHOD) except ImportError: - raise util.Abort("SSL support is unavailable") + raise util.Abort(_("SSL support is unavailable")) ctx.use_privatekey_file(ssl_cert) ctx.use_certificate_file(ssl_cert) sock = socket.socket(self.address_family, self.socket_type)
--- a/mercurial/localrepo.py Sun Aug 31 16:12:02 2008 +0200 +++ b/mercurial/localrepo.py Sun Aug 31 16:12:02 2008 +0200 @@ -1098,7 +1098,7 @@ wlock = self.wlock() for f in list: if self.dirstate[f] != 'r': - self.ui.warn("%s not removed!\n" % f) + self.ui.warn(_("%s not removed!\n") % f) else: m = f in manifests[0] and manifests[0] or manifests[1] t = self.file(f).read(m[f]) @@ -2022,7 +2022,7 @@ except ValueError, TypeError: raise util.UnexpectedOutput( _('Unexpected response from remote server:'), l) - self.ui.debug('adding %s (%s)\n' % (name, util.bytecount(size))) + self.ui.debug(_('adding %s (%s)\n') % (name, util.bytecount(size))) ofp = self.sopener(name, 'w') for chunk in util.filechunkiter(fp, limit=size): ofp.write(chunk)
--- a/mercurial/merge.py Sun Aug 31 16:12:02 2008 +0200 +++ b/mercurial/merge.py Sun Aug 31 16:12:02 2008 +0200 @@ -347,7 +347,7 @@ updated += 1 elif m == "dr": # divergent renames fl = a[2] - repo.ui.warn("warning: detected divergent renames of %s to:\n" % f) + repo.ui.warn(_("warning: detected divergent renames of %s to:\n") % f) for nf in fl: repo.ui.warn(" %s\n" % nf) elif m == "e": # exec
--- a/mercurial/patch.py Sun Aug 31 16:12:02 2008 +0200 +++ b/mercurial/patch.py Sun Aug 31 16:12:02 2008 +0200 @@ -229,7 +229,7 @@ return internalpatch(patchname, ui, strip, cwd, files) except NoHunks: patcher = util.find_exe('gpatch') or util.find_exe('patch') - ui.debug('no valid hunks found; trying with %r instead\n' % + ui.debug(_('no valid hunks found; trying with %r instead\n') % patcher) if util.needbinarypatch(): args.append('--binary')
--- a/mercurial/repair.py Sun Aug 31 16:12:02 2008 +0200 +++ b/mercurial/repair.py Sun Aug 31 16:12:02 2008 +0200 @@ -8,6 +8,7 @@ import changegroup, os from node import nullrev, short +from i18n import _ def _bundle(repo, bases, heads, node, suffix, extranodes=None): """create a bundle with the specified revisions as a backup""" @@ -16,7 +17,7 @@ if not os.path.isdir(backupdir): os.mkdir(backupdir) name = os.path.join(backupdir, "%s-%s" % (short(node), suffix)) - repo.ui.warn("saving bundle to %s\n" % name) + repo.ui.warn(_("saving bundle to %s\n") % name) return changegroup.writebundle(cg, name, "HG10BZ") def _collectfiles(repo, striprev): @@ -125,7 +126,7 @@ f.strip(striprev) if saveheads or extranodes: - ui.status("adding branch\n") + ui.status(_("adding branch\n")) f = open(chgrpfile, "rb") gen = changegroup.readbundle(f, chgrpfile) repo.addchangegroup(gen, 'strip', 'bundle:' + chgrpfile, True)
--- a/mercurial/sshrepo.py Sun Aug 31 16:12:02 2008 +0200 +++ b/mercurial/sshrepo.py Sun Aug 31 16:12:02 2008 +0200 @@ -42,7 +42,7 @@ cmd = '%s %s "%s init %s"' cmd = cmd % (sshcmd, args, remotecmd, self.path) - ui.note('running %s\n' % cmd) + ui.note(_('running %s\n') % cmd) res = util.system(cmd) if res != 0: self.raise_(repo.RepoError(_("could not create remote repo"))) @@ -60,7 +60,7 @@ cmd = cmd % (sshcmd, args, remotecmd, self.path) cmd = util.quotecommand(cmd) - ui.note('running %s\n' % cmd) + ui.note(_('running %s\n') % cmd) self.pipeo, self.pipei, self.pipee = os.popen3(cmd, 'b') # skip any noise generated by remote shell
--- a/mercurial/streamclone.py Sun Aug 31 16:12:02 2008 +0200 +++ b/mercurial/streamclone.py Sun Aug 31 16:12:02 2008 +0200 @@ -6,6 +6,7 @@ # of the GNU General Public License, incorporated herein by reference. import util, lock +from i18n import _ class StreamException(Exception): def __init__(self, code): @@ -42,7 +43,7 @@ try: l = None try: - repo.ui.debug('scanning\n') + repo.ui.debug(_('scanning\n')) # get consistent snapshot of repo, lock during scan l = repo.lock() for name, ename, size in repo.store.walk(): @@ -54,11 +55,11 @@ raise StreamException(2) yield '0\n' - repo.ui.debug('%d files, %d bytes to transfer\n' % + repo.ui.debug(_('%d files, %d bytes to transfer\n') % (len(entries), total_bytes)) yield '%d %d\n' % (len(entries), total_bytes) for name, size in entries: - repo.ui.debug('sending %s (%d bytes)\n' % (name, size)) + repo.ui.debug(_('sending %s (%d bytes)\n') % (name, size)) yield '%s\0%d\n' % (name, size) for chunk in util.filechunkiter(repo.sopener(name), limit=size): yield chunk