Skip to content

Commit 0ef8535

Browse files
committed
translate all command help strings
Leverage the new cliff command class attribute (_description) to get the help of a command, this allows us to mark strings for translation. We could not do this before since the help was grabbed from the docstring. This also depends on a new release of cliff and a bump to the minimum level in osc's requirements. Closes-Bug: 1636209 Depends-On: Id915f6aa7d95a0ff3dc6e2ceaac5decb3f3bf0da Change-Id: I8673080bb5625e8e3c499feaefd42dfc7121e96f
1 parent 6eef327 commit 0ef8535

87 files changed

Lines changed: 429 additions & 422 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

openstackclient/common/availability_zone.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def _xform_network_availability_zone(az):
8888

8989

9090
class ListAvailabilityZone(command.Lister):
91-
"""List availability zones and their status"""
91+
_description = _("List availability zones and their status")
9292

9393
def get_parser(self, prog_name):
9494
parser = super(ListAvailabilityZone, self).get_parser(prog_name)

openstackclient/common/configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424

2525
class ShowConfiguration(command.ShowOne):
26-
"""Display configuration details"""
26+
_description = _("Display configuration details")
2727

2828
def get_parser(self, prog_name):
2929
parser = super(ShowConfiguration, self).get_parser(prog_name)

openstackclient/common/extension.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929

3030
class ListExtension(command.Lister):
31-
"""List API extensions"""
31+
_description = _("List API extensions")
3232

3333
def get_parser(self, prog_name):
3434
parser = super(ListExtension, self).get_parser(prog_name)

openstackclient/common/limits.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626

2727
class ShowLimits(command.Lister):
28-
"""Show compute and block storage limits"""
28+
_description = _("Show compute and block storage limits")
2929

3030
def get_parser(self, prog_name):
3131
parser = super(ShowLimits, self).get_parser(prog_name)

openstackclient/common/module.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626

2727
class ListCommand(command.Lister):
28-
"""List recognized commands by group"""
28+
_description = _("List recognized commands by group")
2929

3030
auth_required = False
3131

@@ -53,7 +53,7 @@ def take_action(self, parsed_args):
5353

5454

5555
class ListModule(command.ShowOne):
56-
"""List module versions"""
56+
_description = _("List module versions")
5757

5858
auth_required = False
5959

openstackclient/common/quota.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080

8181

8282
class SetQuota(command.Command):
83-
"""Set quotas for project or class"""
83+
_description = _("Set quotas for project or class")
8484

8585
def _build_options_list(self):
8686
if self.app.client_manager.is_network_endpoint_enabled():
@@ -186,7 +186,7 @@ def take_action(self, parsed_args):
186186

187187

188188
class ShowQuota(command.ShowOne):
189-
"""Show quotas for project or class"""
189+
_description = _("Show quotas for project or class")
190190

191191
def get_parser(self, prog_name):
192192
parser = super(ShowQuota, self).get_parser(prog_name)

openstackclient/compute/v2/agent.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030

3131
class CreateAgent(command.ShowOne):
32-
"""Create compute agent"""
32+
_description = _("Create compute agent")
3333

3434
def get_parser(self, prog_name):
3535
parser = super(CreateAgent, self).get_parser(prog_name)
@@ -81,7 +81,7 @@ def take_action(self, parsed_args):
8181

8282

8383
class DeleteAgent(command.Command):
84-
"""Delete compute agent(s)"""
84+
_description = _("Delete compute agent(s)")
8585

8686
def get_parser(self, prog_name):
8787
parser = super(DeleteAgent, self).get_parser(prog_name)
@@ -112,7 +112,7 @@ def take_action(self, parsed_args):
112112

113113

114114
class ListAgent(command.Lister):
115-
"""List compute agents"""
115+
_description = _("List compute agents")
116116

117117
def get_parser(self, prog_name):
118118
parser = super(ListAgent, self).get_parser(prog_name)
@@ -142,7 +142,7 @@ def take_action(self, parsed_args):
142142

143143

144144
class SetAgent(command.Command):
145-
"""Set compute agent properties"""
145+
_description = _("Set compute agent properties")
146146

147147
def get_parser(self, prog_name):
148148
parser = super(SetAgent, self).get_parser(prog_name)

openstackclient/compute/v2/aggregate.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232

3333
class AddAggregateHost(command.ShowOne):
34-
"""Add host to aggregate"""
34+
_description = _("Add host to aggregate")
3535

3636
def get_parser(self, prog_name):
3737
parser = super(AddAggregateHost, self).get_parser(prog_name)
@@ -62,7 +62,7 @@ def take_action(self, parsed_args):
6262

6363

6464
class CreateAggregate(command.ShowOne):
65-
"""Create a new aggregate"""
65+
_description = _("Create a new aggregate")
6666

6767
def get_parser(self, prog_name):
6868
parser = super(CreateAggregate, self).get_parser(prog_name)
@@ -105,7 +105,7 @@ def take_action(self, parsed_args):
105105

106106

107107
class DeleteAggregate(command.Command):
108-
"""Delete existing aggregate(s)"""
108+
_description = _("Delete existing aggregate(s)")
109109

110110
def get_parser(self, prog_name):
111111
parser = super(DeleteAggregate, self).get_parser(prog_name)
@@ -139,7 +139,7 @@ def take_action(self, parsed_args):
139139

140140

141141
class ListAggregate(command.Lister):
142-
"""List all aggregates"""
142+
_description = _("List all aggregates")
143143

144144
def get_parser(self, prog_name):
145145
parser = super(ListAggregate, self).get_parser(prog_name)
@@ -188,7 +188,7 @@ def take_action(self, parsed_args):
188188

189189

190190
class RemoveAggregateHost(command.ShowOne):
191-
"""Remove host from aggregate"""
191+
_description = _("Remove host from aggregate")
192192

193193
def get_parser(self, prog_name):
194194
parser = super(RemoveAggregateHost, self).get_parser(prog_name)
@@ -222,7 +222,7 @@ def take_action(self, parsed_args):
222222

223223

224224
class SetAggregate(command.Command):
225-
"""Set aggregate properties"""
225+
_description = _("Set aggregate properties")
226226

227227
def get_parser(self, prog_name):
228228
parser = super(SetAggregate, self).get_parser(prog_name)
@@ -298,7 +298,7 @@ def take_action(self, parsed_args):
298298

299299

300300
class ShowAggregate(command.ShowOne):
301-
"""Display aggregate details"""
301+
_description = _("Display aggregate details")
302302

303303
def get_parser(self, prog_name):
304304
parser = super(ShowAggregate, self).get_parser(prog_name)
@@ -334,7 +334,7 @@ def take_action(self, parsed_args):
334334

335335

336336
class UnsetAggregate(command.Command):
337-
"""Unset aggregate properties"""
337+
_description = _("Unset aggregate properties")
338338

339339
def get_parser(self, prog_name):
340340
parser = super(UnsetAggregate, self).get_parser(prog_name)

openstackclient/compute/v2/console.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727

2828
class ShowConsoleLog(command.Command):
29-
"""Show server's console output"""
29+
_description = _("Show server's console output")
3030

3131
def get_parser(self, prog_name):
3232
parser = super(ShowConsoleLog, self).get_parser(prog_name)
@@ -64,7 +64,7 @@ def take_action(self, parsed_args):
6464

6565

6666
class ShowConsoleURL(command.ShowOne):
67-
"""Show server's remote console URL"""
67+
_description = _("Show server's remote console URL")
6868

6969
def get_parser(self, prog_name):
7070
parser = super(ShowConsoleURL, self).get_parser(prog_name)

openstackclient/compute/v2/fixedip.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525

2626
class AddFixedIP(command.Command):
27-
"""Add fixed IP address to server"""
27+
_description = _("Add fixed IP address to server")
2828

2929
# TODO(tangchen): Remove this class and ``ip fixed add`` command
3030
# two cycles after Mitaka.
@@ -64,7 +64,7 @@ def take_action(self, parsed_args):
6464

6565

6666
class RemoveFixedIP(command.Command):
67-
"""Remove fixed IP address from server"""
67+
_description = _("Remove fixed IP address from server")
6868

6969
# TODO(tangchen): Remove this class and ``ip fixed remove`` command
7070
# two cycles after Mitaka.

0 commit comments

Comments
 (0)