diff options
| author | Huanxuan Ao <huanxuan.ao@easystack.cn> | 2016-06-07 19:16:24 +0800 |
|---|---|---|
| committer | Huanxuan Ao <huanxuan.ao@easystack.cn> | 2016-06-07 19:56:00 +0800 |
| commit | b36d521ff6d4f7a994d4472c25f8267b6e268d41 (patch) | |
| tree | 7b9abcef7d9e5308f5ec481fd66814588cbcf00f /openstackclient/common/parseractions.py | |
| parent | 5293bb103e75542d9defb9d0d5ed3c144f0657fe (diff) | |
| download | python-openstackclient-b36d521ff6d4f7a994d4472c25f8267b6e268d41.tar.gz | |
Fix i18n supports in commom
I checked all the files in openstackclient/common
and fixed the missing i18n supprots.
Change-Id: Id7f76a24aae663f5832ef9bcf1bd5a6b7081af24
Partial-bug: #1574965
Diffstat (limited to 'openstackclient/common/parseractions.py')
| -rw-r--r-- | openstackclient/common/parseractions.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/openstackclient/common/parseractions.py b/openstackclient/common/parseractions.py index 77798f90..c535b4f3 100644 --- a/openstackclient/common/parseractions.py +++ b/openstackclient/common/parseractions.py @@ -87,8 +87,8 @@ class MultiKeyValueAction(argparse.Action): if '=' in kv: params.update([kv.split('=', 1)]) else: - msg = ("Expected key=value pairs separated by comma, " - "but got: %s" % (str(kv))) + msg = _("Expected key=value pairs separated by comma, " + "but got: %s") % (str(kv)) raise argparse.ArgumentTypeError(msg) # Check key validation @@ -139,12 +139,13 @@ class RangeAction(argparse.Action): if int(range[0]) <= int(range[1]): setattr(namespace, self.dest, (int(range[0]), int(range[1]))) else: - msg = "Invalid range, %s is not less than %s" % \ - (range[0], range[1]) + msg = (_("Invalid range, %(range0)s is not " + "less than %(range1)s") + % {'range0': range[0], 'range1': range[1]}) raise argparse.ArgumentError(self, msg) else: # Too many values - msg = "Invalid range, too many values" + msg = _("Invalid range, too many values") raise argparse.ArgumentError(self, msg) @@ -158,5 +159,6 @@ class NonNegativeAction(argparse.Action): if int(values) >= 0: setattr(namespace, self.dest, values) else: - msg = "%s expected a non-negative integer" % (str(option_string)) + msg = (_("%s expected a non-negative integer") + % (str(option_string))) raise argparse.ArgumentTypeError(msg) |
