summaryrefslogtreecommitdiff
path: root/openstack_dashboard/static
diff options
context:
space:
mode:
authorRadomir Dopieralski <openstack@sheep.art.pl>2019-11-27 15:07:41 +0100
committerRadomir Dopieralski <openstack@sheep.art.pl>2019-12-20 09:44:48 +0000
commitef4055e2888bb0fe67d64e9c422a31f925469200 (patch)
treec86d046832738d4a5d780db7481d2c279d2f843d /openstack_dashboard/static
parent3a829be260a6c1ee8c8a73a0ff59cc68bb8d245a (diff)
downloadhorizon-ef4055e2888bb0fe67d64e9c422a31f925469200.tar.gz
Fix use of ngettext in registry getName
The setNames and getNames functions in the resource registry were calling ngettext() on already translated strings that were marked for translation with gettext() and not ngetttext(). That lead to some page titles in some locales being displayed as single characters. Closes-Bug: #1762089 Change-Id: I0ef365e0c0de6ae27a2e80bcb5257132f8c6ba29
Diffstat (limited to 'openstack_dashboard/static')
-rw-r--r--openstack_dashboard/static/app/core/flavors/flavors.module.js2
-rw-r--r--openstack_dashboard/static/app/core/images/images.module.js2
-rw-r--r--openstack_dashboard/static/app/core/keypairs/keypairs.module.js2
-rw-r--r--openstack_dashboard/static/app/core/network_qos/qos.module.js3
-rw-r--r--openstack_dashboard/static/app/core/server_groups/server-groups.module.js3
-rw-r--r--openstack_dashboard/static/app/core/trunks/trunks.module.js2
-rw-r--r--openstack_dashboard/static/app/resources/resources.module.js62
7 files changed, 46 insertions, 30 deletions
diff --git a/openstack_dashboard/static/app/core/flavors/flavors.module.js b/openstack_dashboard/static/app/core/flavors/flavors.module.js
index d89ead72d..2866b736c 100644
--- a/openstack_dashboard/static/app/core/flavors/flavors.module.js
+++ b/openstack_dashboard/static/app/core/flavors/flavors.module.js
@@ -46,7 +46,7 @@
function run(registry, gettext, basePath, flavorsService, flavorResourceType) {
registry.getResourceType(flavorResourceType)
- .setNames(gettext('Flavor'), gettext('Flavors'))
+ .setNames('Flavor', 'Flavors', ngettext('Flavor', 'Flavors', 1))
.setSummaryTemplateUrl(basePath + 'summary.html')
.setProperties(flavorProperties())
.setListFunction(flavorsService.getFlavorsPromise)
diff --git a/openstack_dashboard/static/app/core/images/images.module.js b/openstack_dashboard/static/app/core/images/images.module.js
index 50d5e8911..34330f5c8 100644
--- a/openstack_dashboard/static/app/core/images/images.module.js
+++ b/openstack_dashboard/static/app/core/images/images.module.js
@@ -71,7 +71,7 @@
$memoize,
keystone) {
registry.getResourceType(imageResourceType)
- .setNames(gettext('Image'), gettext('Images'))
+ .setNames('Image', 'Images', ngettext('Image', 'Images', 1))
.setSummaryTemplateUrl(basePath + 'details/drawer.html')
.setDefaultIndexUrl('/project/images/')
.setItemInTransitionFunction(imagesService.isInTransition)
diff --git a/openstack_dashboard/static/app/core/keypairs/keypairs.module.js b/openstack_dashboard/static/app/core/keypairs/keypairs.module.js
index 1f9abd08d..f0782b230 100644
--- a/openstack_dashboard/static/app/core/keypairs/keypairs.module.js
+++ b/openstack_dashboard/static/app/core/keypairs/keypairs.module.js
@@ -45,7 +45,7 @@
function run(registry, nova, basePath, resourceType, keypairsService) {
registry.getResourceType(resourceType)
- .setNames(gettext('Key Pair'), gettext('Key Pairs'))
+ .setNames('Key Pair', 'Key Pairs', ngettext('Key Pair', 'Key Pairs', 1))
// for detail summary view on table row.
.setSummaryTemplateUrl(basePath + 'details/drawer.html')
.setDefaultIndexUrl('/project/key_pairs/')
diff --git a/openstack_dashboard/static/app/core/network_qos/qos.module.js b/openstack_dashboard/static/app/core/network_qos/qos.module.js
index a66699f0f..c5e0157fe 100644
--- a/openstack_dashboard/static/app/core/network_qos/qos.module.js
+++ b/openstack_dashboard/static/app/core/network_qos/qos.module.js
@@ -49,7 +49,8 @@
qosService,
qosResourceType) {
registry.getResourceType(qosResourceType)
- .setNames(gettext('QoS Policy'), gettext('QoS Policies'))
+ .setNames('QoS Policy', 'QoS Policies',
+ ngettext('QoS Policy', 'QoS Policies', 1))
.setSummaryTemplateUrl(basePath + 'details/drawer.html')
.setDefaultIndexUrl('/project/network_qos/')
.setProperties(qosProperties(qosService))
diff --git a/openstack_dashboard/static/app/core/server_groups/server-groups.module.js b/openstack_dashboard/static/app/core/server_groups/server-groups.module.js
index 6499056f6..ebd72381a 100644
--- a/openstack_dashboard/static/app/core/server_groups/server-groups.module.js
+++ b/openstack_dashboard/static/app/core/server_groups/server-groups.module.js
@@ -44,7 +44,8 @@
serverGroupsService,
registry) {
registry.getResourceType(serverGroupResourceType)
- .setNames(gettext('Server Group'), gettext('Server Groups'))
+ .setNames('Server Group', 'Server Groups',
+ ngettext('Server Group', 'Server Groups', 1))
.setProperties(serverGroupProperties())
.setListFunction(serverGroupsService.getServerGroupsPromise)
.tableColumns
diff --git a/openstack_dashboard/static/app/core/trunks/trunks.module.js b/openstack_dashboard/static/app/core/trunks/trunks.module.js
index 770ad42af..0f2993019 100644
--- a/openstack_dashboard/static/app/core/trunks/trunks.module.js
+++ b/openstack_dashboard/static/app/core/trunks/trunks.module.js
@@ -52,7 +52,7 @@
trunksService,
trunkResourceType) {
registry.getResourceType(trunkResourceType)
- .setNames(gettext('Trunk'), gettext('Trunks'))
+ .setNames('Trunk', 'Trunks', ngettext('Trunk', 'Trunks', 1))
.setSummaryTemplateUrl(basePath + 'summary.html')
.setDefaultIndexUrl('/project/trunks/')
.setProperties(trunkProperties())
diff --git a/openstack_dashboard/static/app/resources/resources.module.js b/openstack_dashboard/static/app/resources/resources.module.js
index 4ab8d583c..195500ae6 100644
--- a/openstack_dashboard/static/app/resources/resources.module.js
+++ b/openstack_dashboard/static/app/resources/resources.module.js
@@ -41,52 +41,66 @@
// fleshed out there's no reason to pollute the directory/file structure.
// As a model, the Images registration happens in the images module.
registry.getResourceType('OS::Glance::Metadef')
- .setNames(gettext('Metadata Definition'), gettext('Metadata Definitions'));
+ .setNames('Metadata Definition', 'Metadata Definitions',
+ ngettext('Metadata Definition', 'Metadata Definitions', 1));
registry.getResourceType('OS::Nova::Server')
- .setNames(gettext('Instance'), gettext('Instances'));
+ .setNames('Instance', 'Instances', ngettext('Instance', 'Instances', 1));
registry.getResourceType('OS::Nova::Flavor')
- .setNames(gettext('Flavor'), gettext('Flavors'));
+ .setNames('Flavor', 'Flavors', ngettext('Flavor', 'Flavors', 1));
registry.getResourceType('OS::Nova::Hypervisor')
- .setNames(gettext('Hypervisor'), gettext('Hypervisors'));
+ .setNames('Hypervisor', 'Hypervisors',
+ ngettext('Hypervisor', 'Hypervisors', 1));
registry.getResourceType('OS::Nova::Keypair')
- .setNames(gettext('Key Pair'), gettext('Key Pairs'));
+ .setNames('Key Pair', 'Key Pairs', ngettext('Key Pair', 'Key Pairs', 1));
registry.getResourceType('OS::Designate::Zone')
- .setNames(gettext('DNS Domain'), gettext('DNS Domains'));
+ .setNames('DNS Domain', 'DNS Domains',
+ ngettext('DNS Domain', 'DNS Domains', 1));
registry.getResourceType('OS::Designate::RecordSet')
- .setNames(gettext('DNS Record'), gettext('DNS Records'));
+ .setNames('DNS Record', 'DNS Records',
+ ngettext('DNS Record', 'DNS Records', 1));
registry.getResourceType('OS::Cinder::Backup')
- .setNames(gettext('Volume Backup'), gettext('Volume Backups'));
+ .setNames('Volume Backup', 'Volume Backups',
+ ngettext('Volume Backup', 'Volume Backups', 1));
registry.getResourceType('OS::Cinder::Snapshot')
- .setNames(gettext('Volume Snapshot'), gettext('Volume Snapshots'));
+ .setNames('Volume Snapshot', 'Volume Snapshots',
+ ngettext('Volume Snapshot', 'Volume Snapshots', 1));
registry.getResourceType('OS::Cinder::Volume')
- .setNames(gettext('Volume'), gettext('Volumes'));
+ .setNames('Volume', 'Volumes', ngettext('Volume', 'Volumes', 1));
registry.getResourceType('OS::Neutron::HealthMonitor')
- .setNames(gettext('Network Health Monitor'), gettext('Network Health Monitors'));
+ .setNames('Network Health Monitor', 'Network Health Monitors',
+ ngettext('Network Health Monitor', 'Network Health Monitors', 1));
registry.getResourceType('OS::Neutron::Net')
- .setNames(gettext('Network'), gettext('Networks'));
+ .setNames('Network', 'Networks', ngettext('Network', 'Networks', 1));
registry.getResourceType('OS::Neutron::Pool')
- .setNames(gettext('Load Balancer Pool'), gettext('Load Balancer Pools'));
+ .setNames('Load Balancer Pool', 'Load Balancer Pools',
+ ngettext('Load Balancer Pool', 'Load Balancer Pools', 1));
registry.getResourceType('OS::Neutron::PoolMember')
- .setNames(gettext('Load Balancer Pool Member'), gettext('Load Balancer Pool Members'));
+ .setNames('Load Balancer Pool Member', 'Load Balancer Pool Members',
+ ngettext('Load Balancer Pool Member', 'Load Balancer Pool Members', 1));
registry.getResourceType('OS::Neutron::Port')
- .setNames(gettext('Network Port'), gettext('Network Ports'));
+ .setNames('Network Port', 'Network Ports',
+ ngettext('Network Port', 'Network Ports', 1));
registry.getResourceType('OS::Neutron::Router')
- .setNames(gettext('Network Router'), gettext('Network Routers'));
+ .setNames('Network Router', 'Network Routers',
+ ngettext('Network Router', 'Network Routers', 1));
registry.getResourceType('OS::Neutron::Subnet')
- .setNames(gettext('Network Subnet'), gettext('Network Subnets'));
+ .setNames('Network Subnet', 'Network Subnets',
+ ngettext('Network Subnet', 'Network Subnets', 1));
registry.getResourceType('OS::Neutron::FloatingIP')
- .setNames(gettext('Floating IP'), gettext('Floating IPs'));
+ .setNames('Floating IP', 'Floating IPs',
+ ngettext('Floating IP', 'Floating IPs', 1));
registry.getResourceType('OS::Neutron::SecurityGroup')
- .setNames(gettext('Security Group'), gettext('Security Groups'));
+ .setNames('Security Group', 'Security Groups',
+ ngettext('Security Group', 'Security Groups', 1));
registry.getResourceType('OS::Neutron::Trunk')
- .setNames(gettext('Trunk'), gettext('Trunks'));
+ .setNames('Trunk', 'Trunks', ngettext('Trunk', 'Trunks', 1));
registry.getResourceType('OS::Keystone::User')
- .setNames(gettext('User'), gettext('Users'));
+ .setNames('User', 'Users', ngettext('User', 'Users', 1));
registry.getResourceType('OS::Keystone::Group')
- .setNames(gettext('Group'), gettext('Groups'));
+ .setNames('Group', 'Groups', ngettext('Group', 'Groups', 1));
registry.getResourceType('OS::Keystone::Project')
- .setNames(gettext('Project'), gettext('Projects'));
+ .setNames('Project', 'Projects', ngettext('Project', 'Projects', 1));
registry.getResourceType('OS::Keystone::Role')
- .setNames(gettext('Role'), gettext('Roles'));
+ .setNames('Role', 'Roles', ngettext('Role', 'Roles', 1));
}
})();