Kaydet (Commit) 68d0b397 authored tarafından Ali Rıza KESKİN's avatar Ali Rıza KESKİN

cli komut uzunluğu sınırı 2 yerine sonsuz oldu :D ve komutları artık yerel dilde…

cli komut uzunluğu sınırı 2 yerine sonsuz oldu :D ve komutları artık yerel dilde de algılayabiliyor.
üst 4bf93a4a
......@@ -35,18 +35,20 @@ class autocommand(type):
name = getattr(cls, 'name', None)
if name is None:
raise inary.cli.Error(_('Command lacks name.'))
longname, shortname = name
def add_cmd(cmd):
def add_cmd(cmd,skip_duplicate=False):
if cmd in Command.cmd_dict:
if not skip_duplicate:
raise inary.cli.Error(
_('Duplicate command \'{}\'').format(cmd))
else:
Command.cmd_dict[cmd] = cls
add_cmd(longname)
if shortname:
add_cmd(shortname)
for cmd_name in name:
if cmd_name:
add_cmd(cmd_name)
add_cmd(_(name[0]),True)
class Command(object):
......@@ -65,10 +67,10 @@ class Command(object):
commandcls = Command.cmd_dict[name]
trans = gettext.translation('inary', fallback=True)
summary = trans.gettext(commandcls.__doc__).split('\n')[0]
name = commandcls.name[0]
name = _(commandcls.name[0])
if commandcls.name[1]:
name += ' ({})'.format(commandcls.name[1])
s += util.colorize(' %23s ' % name, 'blue') + '- %s\n' % summary
s += util.colorize(' %23s ' % name, 'red') + '- %s\n' % summary
return s
@staticmethod
......
......@@ -28,7 +28,7 @@ class InitNothing(command.PackageOp, metaclass=command.autocommand):
def __init__(self, args):
super(InitNothing, self).__init__(args)
name = (_("init"), "i")
name = ("init", "i")
def options(self):
pass
......
......@@ -3708,6 +3708,7 @@ msgstr "\"{0}\" için dönüş değeri {1}"
msgid "Invalid version string: '{}'"
msgstr "Hatalı sürüm dizgisi: '{}'"
#~ msgid "Upgrade is not possible."
#~ msgstr "Yükseltme mümkün değil."
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment