Skip to content

Commit 8944585

Browse files
author
Tang Chen
committed
State i18() changes and help messages improved
Add _() to wrap help message in network commands. And also some improvement for help message. Change-Id: Ib3e498f5976ba98c44fd4eec2d1623263b3db53e Partial-bug: 1570924
1 parent 8eade18 commit 8944585

13 files changed

Lines changed: 248 additions & 220 deletions

File tree

doc/source/command-objects/network.rst

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Create new network
5959
.. option:: --availability-zone-hint <availability-zone>
6060
6161
Availability Zone in which to create this network
62-
(requires the Network Availability Zone extension,
62+
(Network Availability Zone extension required,
6363
repeat option to set multiple availability zones)
6464
6565
*Network version 2 only*
@@ -72,8 +72,8 @@ Create new network
7272
7373
.. option:: --external
7474
75-
Set this network as an external network.
76-
Requires the "external-net" extension to be enabled.
75+
Set this network as an external network
76+
(external-net extension required)
7777
7878
*Network version 2 only*
7979
@@ -92,8 +92,8 @@ Create new network
9292
9393
.. option:: --no-default
9494
95-
Do not use the network as the default external network.
96-
By default, no network is set as an external network.
95+
Do not use the network as the default external network
96+
(default)
9797
9898
*Network version 2 only*
9999
@@ -197,16 +197,15 @@ Set network properties
197197
.. option:: --external
198198
199199
Set this network as an external network.
200-
Requires the "external-net" extension to be enabled.
200+
(external-net extension required)
201201
202202
.. option:: --internal
203203
204204
Set this network as an internal network
205205
206206
.. option:: --default
207207
208-
Specify if this network should be used as
209-
the default external network
208+
Set the network as the default external network
210209
211210
.. option:: --no-default
212211

doc/source/command-objects/port.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ Create new port
4545
4646
.. option:: --vnic-type <vnic-type>
4747
48-
VNIC type for this port (direct | direct-physical | macvtap | normal | baremetal).
49-
If unspecified during port creation, default value will be 'normal'.
48+
VNIC type for this port (direct | direct-physical | macvtap | normal | baremetal,
49+
default: normal)
5050
5151
.. option:: --binding-profile <binding-profile>
5252
@@ -141,7 +141,7 @@ Set port properties
141141
142142
.. option:: --no-fixed-ip
143143
144-
Clear existing information of fixed-ips
144+
Clear existing information of fixed IP addresses
145145
146146
.. option:: --device <device-id>
147147
@@ -153,8 +153,8 @@ Set port properties
153153
154154
.. option:: --vnic-type <vnic-type>
155155
156-
VNIC type for this port (direct | direct-physical | macvtap | normal | baremetal).
157-
If unspecified during port creation, default value will be 'normal'.
156+
VNIC type for this port (direct | direct-physical | macvtap | normal | baremetal,
157+
default: normal)
158158
159159
.. option:: --binding-profile <binding-profile>
160160

doc/source/command-objects/router.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Create new router
8787
.. option:: --availability-zone-hint <availability-zone>
8888
8989
Availability Zone in which to create this router
90-
(requires the Router Availability Zone extension,
90+
(Router Availability Zone extension required,
9191
repeat option to set multiple availability zones)
9292
9393
.. _router_create-name:

doc/source/command-objects/subnet-pool.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ Create subnet pool
4949
5050
.. option:: --address-scope <address-scope>
5151
52-
Set address scope associated with the subnet pool (name or ID).
53-
Prefixes must be unique across address scopes.
52+
Set address scope associated with the subnet pool (name or ID),
53+
prefixes must be unique across address scopes
5454
5555
.. _subnet_pool_create-name:
5656
.. describe:: <name>
@@ -128,8 +128,8 @@ Set subnet pool properties
128128
129129
.. option:: --address-scope <address-scope>
130130
131-
Set address scope associated with the subnet pool (name or ID).
132-
Prefixes must be unique across address scopes.
131+
Set address scope associated with the subnet pool (name or ID),
132+
prefixes must be unique across address scopes
133133
134134
.. option:: --no-address-scope
135135

doc/source/command-objects/subnet.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ Set subnet properties
206206
subnet show
207207
-----------
208208
209-
Show subnet details
209+
Display subnet details
210210
211211
.. program:: subnet show
212212
.. code:: bash
@@ -217,4 +217,4 @@ Show subnet details
217217
.. _subnet_show-subnet:
218218
.. describe:: <subnet>
219219
220-
Subnet to show (name or ID)
220+
Subnet to display (name or ID)

openstackclient/network/v2/floating_ip.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"""IP Floating action implementations"""
1515

1616
from openstackclient.common import utils
17+
from openstackclient.i18n import _
1718
from openstackclient.network import common
1819

1920

@@ -63,34 +64,34 @@ def update_parser_common(self, parser):
6364
parser.add_argument(
6465
'network',
6566
metavar='<network>',
66-
help='Network to allocate floating IP from (name or ID)',
67+
help=_("Network to allocate floating IP from (name or ID)")
6768
)
6869
return parser
6970

7071
def update_parser_network(self, parser):
7172
parser.add_argument(
7273
'--subnet',
7374
metavar='<subnet>',
74-
help="Subnet on which you want to create the floating IP "
75-
"(name or ID)"
75+
help=_("Subnet on which you want to create the floating IP "
76+
"(name or ID)")
7677
)
7778
parser.add_argument(
7879
'--port',
7980
metavar='<port>',
80-
help="Port to be associated with the floating IP "
81-
"(name or ID)"
81+
help=_("Port to be associated with the floating IP "
82+
"(name or ID)")
8283
)
8384
parser.add_argument(
8485
'--floating-ip-address',
8586
metavar='<floating-ip-address>',
8687
dest='floating_ip_address',
87-
help="Floating IP address"
88+
help=_("Floating IP address")
8889
)
8990
parser.add_argument(
9091
'--fixed-ip-address',
9192
metavar='<fixed-ip-address>',
9293
dest='fixed_ip_address',
93-
help="Fixed IP address mapped to the floating IP"
94+
help=_("Fixed IP address mapped to the floating IP")
9495
)
9596
return parser
9697

@@ -115,7 +116,7 @@ def update_parser_common(self, parser):
115116
parser.add_argument(
116117
'floating_ip',
117118
metavar="<floating-ip>",
118-
help=("Floating IP to delete (IP address or ID)")
119+
help=_("Floating IP to delete (IP address or ID)")
119120
)
120121
return parser
121122

@@ -189,7 +190,7 @@ def update_parser_common(self, parser):
189190
parser.add_argument(
190191
'floating_ip',
191192
metavar="<floating-ip>",
192-
help=("Floating IP to display (IP address or ID)")
193+
help=_("Floating IP to display (IP address or ID)")
193194
)
194195
return parser
195196

0 commit comments

Comments
 (0)