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:38 UTC

[nifi-registry] 01/04: NIFIREG-303 Fix translation config file parsing

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 25cc926002547a9a4fce77d769ca06624f902466
Author: Koji Kawamura <ij...@gmail.com>
AuthorDate: Tue Aug 13 11:51:18 2019 +0900

    NIFIREG-303 Fix translation config file parsing
---
 .../nifi-registry-web-ui/src/main/webapp/nf-registry-bootstrap.js     | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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 5f456d8..d72fb77 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
@@ -53,7 +53,9 @@ if (!locale || locale === 'en-us') {
     }).done(function (translations) {
         // add providers if translation file for locale is loaded
         if (translations) {
-            providers.push({provide: TRANSLATIONS, useValue: translations.documentElement.innerHTML});
+            var parser = new DOMParser();
+            var translationsDom = parser.parseFromString(translations, 'text/xml');
+            providers.push({provide: TRANSLATIONS, useValue: translationsDom.documentElement.innerHTML});
             providers.push({provide: TRANSLATIONS_FORMAT, useValue: 'xlf'});
             providers.push({provide: LOCALE_ID, useValue: locale});
         }