summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-04-04 22:09:54 +0000
committerGerrit Code Review <review@openstack.org>2017-04-04 22:09:54 +0000
commit7c0fbef9165b8a2d15eafe41a83fb0ca516b9da2 (patch)
treea0ba27c39d2b302da8a77185dd4f551a209b3f63
parent4ce18281189d168053453ae946505a3623f0dfd6 (diff)
parent60db285fd59eb36bca9d3a209c945e4f23412b3b (diff)
Merge "Refactor enabled languages from an array to a hash"
-rw-r--r--manifests/ui.pp23
-rw-r--r--templates/ui/tripleo_ui_config.js.erb2
2 files changed, 21 insertions, 4 deletions
diff --git a/manifests/ui.pp b/manifests/ui.pp
index d51ef2e..d810b5d 100644
--- a/manifests/ui.pp
+++ b/manifests/ui.pp
@@ -33,8 +33,17 @@
#
# [*enabled_languages*]
# Which languages to show in the UI.
-# An array.
-# Defaults to ['en-GB', 'en', 'de', 'ja', 'ko-KR', 'zh-CN', 'es']
+# A hash.
+# Defaults to
+# {
+# 'de' => 'German',
+# 'en' => 'English',
+# 'en-GB' => 'British English',
+# 'es' => 'Spanish',
+# 'ja' => 'Japanese',
+# 'ko-KR' => 'Korean',
+# 'zh-CN' => 'Simplified Chinese'
+# }
#
# [*endpoint_proxy_keystone*]
# The keystone proxy endpoint url
@@ -94,7 +103,15 @@ class tripleo::ui (
$bind_host = hiera('controller_host'),
$ui_port = 3000,
$zaqar_default_queue = 'tripleo',
- $enabled_languages = ['en-GB', 'en', 'de', 'ja', 'ko-KR', 'zh-CN', 'es'],
+ $enabled_languages = {
+ 'de' => 'German',
+ 'en' => 'English',
+ 'en-GB' => 'British English',
+ 'es' => 'Spanish',
+ 'ja' => 'Japanese',
+ 'ko-KR' => 'Korean',
+ 'zh-CN' => 'Simplified Chinese'
+ },
$endpoint_proxy_zaqar = undef,
$endpoint_proxy_keystone = undef,
$endpoint_proxy_heat = undef,
diff --git a/templates/ui/tripleo_ui_config.js.erb b/templates/ui/tripleo_ui_config.js.erb
index c984cc3..f179637 100644
--- a/templates/ui/tripleo_ui_config.js.erb
+++ b/templates/ui/tripleo_ui_config.js.erb
@@ -18,7 +18,7 @@ window.tripleOUiConfig = {
// If you choose more than one language, a language switcher will appear in
// the navigation bar.
// Only 'en' (English) is enabled by default.
- 'languages': ['<%= @enabled_languages.join("', '") %>'],
+ 'languages': <%= @enabled_languages.to_json %>,
// Logging
// 'loggers': ['console']