Enable languages in UI config
authorJulie Pichon <jpichon@redhat.com>
Fri, 10 Feb 2017 14:30:26 +0000 (14:30 +0000)
committerEmilien Macchi <emilien@redhat.com>
Sat, 18 Feb 2017 15:19:32 +0000 (15:19 +0000)
Which language options to offer to the UI users is determined in the
configuration file. Let's show all possible languages by default,
unless specified otherwise.

Change-Id: I513303bf82dca53e2291ab66f2385a2985a1846e
Related-Bug: #1663279
(cherry picked from commit 053ee06787539f6da07985968d6c3b0194e56008)

manifests/ui.pp
releasenotes/notes/enable-languages-in-ui-88a8caa6db9b4dd7.yaml [new file with mode: 0644]
templates/ui/tripleo_ui_config.js.erb

index 7b87397..d51ef2e 100644 (file)
 #  The port on which the UI is listening.
 #  Defaults to 3000
 #
+# [*enabled_languages*]
+#  Which languages to show in the UI.
+#  An array.
+#  Defaults to ['en-GB', 'en', 'de', 'ja', 'ko-KR', 'zh-CN', 'es']
+#
 # [*endpoint_proxy_keystone*]
 #  The keystone proxy endpoint url
 #  Defaults to undef
@@ -89,6 +94,7 @@ 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'],
   $endpoint_proxy_zaqar     = undef,
   $endpoint_proxy_keystone  = undef,
   $endpoint_proxy_heat      = undef,
diff --git a/releasenotes/notes/enable-languages-in-ui-88a8caa6db9b4dd7.yaml b/releasenotes/notes/enable-languages-in-ui-88a8caa6db9b4dd7.yaml
new file mode 100644 (file)
index 0000000..2f7939d
--- /dev/null
@@ -0,0 +1,5 @@
+---
+features:
+  - The undercloud UI is available in multiple languages, which can now
+    be configured via the manifest. All available languages are enabled
+    by default.
index d49fe8e..c984cc3 100644 (file)
@@ -12,13 +12,13 @@ window.tripleOUiConfig = {
   'zaqar-websocket': '<%= @endpoint_config_zaqar %>',
 
   // Default websocket queue name
-  'zaqar_default_queue': '<%= @zaqar_default_queue %>'
+  'zaqar_default_queue': '<%= @zaqar_default_queue %>',
 
   // Languages
   // If you choose more than one language, a language switcher will appear in
   // the navigation bar.
   // Only 'en' (English) is enabled by default.
-  // 'languages': ['en-GB', 'en', 'ja', 'ko-KR', 'zh-CN', 'es'],
+  'languages': ['<%= @enabled_languages.join("', '") %>'],
 
   // Logging
   // 'loggers': ['console']