You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by sc...@apache.org on 2019/08/19 16:27:39 UTC

[nifi-registry] 02/04: [NIFIREG-303] include locale in build, update path to locale files, request local files as strings, update missing locale

This is an automated email from the ASF dual-hosted git repository.

scottyaslan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nifi-registry.git

commit 1ba4af785aa69d9d2c1624ac4509a029c354f66d
Author: Scott Aslan <sc...@gmail.com>
AuthorDate: Fri Aug 16 12:50:51 2019 -0400

    [NIFIREG-303] include locale in build, update path to locale files, request local files as strings, update missing locale
---
 nifi-registry-core/nifi-registry-web-ui/pom.xml               |  1 +
 .../nifi-registry-web-ui/src/main/locale/messages.es.xlf      |  6 ++++++
 .../src/main/webapp/nf-registry-bootstrap.js                  | 11 +++++------
 3 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/nifi-registry-core/nifi-registry-web-ui/pom.xml b/nifi-registry-core/nifi-registry-web-ui/pom.xml
index 095867e..f5a8087 100644
--- a/nifi-registry-core/nifi-registry-web-ui/pom.xml
+++ b/nifi-registry-core/nifi-registry-web-ui/pom.xml
@@ -206,6 +206,7 @@
                                         <include>vendor.min*.css*</include>
                                         <include>index.html</include>
                                         <include>assets/**/*</include>
+                                        <include>locale/**/*</include>
                                         <include>registry-favicon.png</include>
                                         <include>LICENSE</include>
                                         <include>NOTICE</include>
diff --git a/nifi-registry-core/nifi-registry-web-ui/src/main/locale/messages.es.xlf b/nifi-registry-core/nifi-registry-web-ui/src/main/locale/messages.es.xlf
index 2bfe354..e9aa4a9 100644
--- a/nifi-registry-core/nifi-registry-web-ui/src/main/locale/messages.es.xlf
+++ b/nifi-registry-core/nifi-registry-web-ui/src/main/locale/messages.es.xlf
@@ -89,6 +89,12 @@
         <note priority="1" from="description">A button for attempting to authenticate with the registry.</note>
         <note priority="1" from="meaning">Log in form</note>
        </trans-unit>
+      <trans-unit id="nf-cancel-user-login-button" datatype="html">
+         <source>Cancel</source>
+         <target state="new">Cancelar</target>
+        <note priority="1" from="description">A button for cancelling authentication with the registry.</note>
+        <note priority="1" from="meaning">Cancel Log in form</note>
+       </trans-unit>
       <trans-unit id="nf-admin-workflow-create-new-group-button" datatype="html">
          <source>Create</source>
          <target state="new">Crear</target>
diff --git a/nifi-registry-core/nifi-registry-web-ui/src/main/webapp/nf-registry-bootstrap.js b/nifi-registry-core/nifi-registry-web-ui/src/main/webapp/nf-registry-bootstrap.js
index d72fb77..8bbc707 100644
--- a/nifi-registry-core/nifi-registry-web-ui/src/main/webapp/nf-registry-bootstrap.js
+++ b/nifi-registry-core/nifi-registry-web-ui/src/main/webapp/nf-registry-bootstrap.js
@@ -43,19 +43,18 @@ const locale = navigator.language.toLowerCase();
 const providers = [];
 
 // No locale or U.S. English: no translation providers so go ahead and bootstrap the app
-if (!locale || locale === 'en-us') {
+if (!locale || locale === 'en-US') {
     bootstrapModule();
 } else { //load the translation providers and bootstrap the module
-    var translationFile = 'assets/locale/messages.' + locale + '.xlf';
+    var translationFile = 'locale/messages.' + locale + '.xlf';
 
     $.ajax({
-        url: translationFile
+        url: translationFile,
+        dataType : "text"
     }).done(function (translations) {
         // add providers if translation file for locale is loaded
         if (translations) {
-            var parser = new DOMParser();
-            var translationsDom = parser.parseFromString(translations, 'text/xml');
-            providers.push({provide: TRANSLATIONS, useValue: translationsDom.documentElement.innerHTML});
+            providers.push({provide: TRANSLATIONS, useValue: translations});
             providers.push({provide: TRANSLATIONS_FORMAT, useValue: 'xlf'});
             providers.push({provide: LOCALE_ID, useValue: locale});
         }