From 95d5d9f76164628a6914f69255fdcd7a23179f38 Mon Sep 17 00:00:00 2001 From: Huanxuan Ao Date: Fri, 3 Jun 2016 10:23:58 +0800 Subject: [PATCH] Fix some missing i18n support problems in compute Found and Fix some missing i18n support problems in compute/client.py Change-Id: I54374f4eddafd9f80b6ccdaf8f8c30e098df105e Partial-bug: #1574965 --- openstackclient/compute/client.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/openstackclient/compute/client.py b/openstackclient/compute/client.py index 82f09cec0f..8e6eedcf39 100644 --- a/openstackclient/compute/client.py +++ b/openstackclient/compute/client.py @@ -17,6 +17,7 @@ import logging from openstackclient.common import exceptions from openstackclient.common import utils +from openstackclient.i18n import _ LOG = logging.getLogger(__name__) @@ -82,9 +83,9 @@ def build_option_parser(parser): '--os-compute-api-version', metavar='', default=utils.env('OS_COMPUTE_API_VERSION'), - help='Compute API version, default=' + - DEFAULT_API_VERSION + - ' (Env: OS_COMPUTE_API_VERSION)') + help=_("Compute API version, default=%s " + "(Env: OS_COMPUTE_API_VERSION)") % DEFAULT_API_VERSION + ) return parser @@ -118,10 +119,9 @@ def check_api_version(check_version): novaclient.API_MIN_VERSION, novaclient.API_MAX_VERSION, ): - raise exceptions.CommandError( - "versions supported by client: %s - %s" % ( - novaclient.API_MIN_VERSION.get_string(), - novaclient.API_MAX_VERSION.get_string(), - ), - ) + msg = _("versions supported by client: %(min)s - %(max)s") % { + "min": novaclient.API_MIN_VERSION.get_string(), + "max": novaclient.API_MAX_VERSION.get_string(), + } + raise exceptions.CommandError(msg) return True