Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 93929200CFA for ; Tue, 5 Sep 2017 22:02:58 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 9217C1609E3; Tue, 5 Sep 2017 20:02:58 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D8CD91609E0 for ; Tue, 5 Sep 2017 22:02:57 +0200 (CEST) Received: (qmail 38122 invoked by uid 500); 5 Sep 2017 20:02:57 -0000 Mailing-List: contact issues-help@nifi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@nifi.apache.org Delivered-To: mailing list issues@nifi.apache.org Received: (qmail 38113 invoked by uid 99); 5 Sep 2017 20:02:57 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Sep 2017 20:02:57 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id D5E17F5563; Tue, 5 Sep 2017 20:02:56 +0000 (UTC) From: scottyaslan To: issues@nifi.apache.org Reply-To: issues@nifi.apache.org References: In-Reply-To: Subject: [GitHub] nifi-registry pull request #8: [NIFIREG-13] Initial implementation of the re... Content-Type: text/plain Message-Id: <20170905200256.D5E17F5563@git1-us-west.apache.org> Date: Tue, 5 Sep 2017 20:02:56 +0000 (UTC) archived-at: Tue, 05 Sep 2017 20:02:58 -0000 Github user scottyaslan commented on a diff in the pull request: https://github.com/apache/nifi-registry/pull/8#discussion_r137099164 --- Diff: nifi-registry-web-ui/src/main/webapp/nf-registry-bootstrap.js --- @@ -0,0 +1,57 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +require('core-js'); +require('zone.js'); +require('hammerjs'); +require('switchMap'); +var $ = require('jquery'); +var NfRegistryModule = require('nifi-registry/nf-registry.module.js'); +var ngPlatformBrowserDynamic = require('@angular/platform-browser-dynamic'); +var ngCore = require('@angular/core'); + +// Comment out this line when developing to assert for unidirectional data flow +ngCore.enableProdMode(); + +// Get the locale id from the global +var locale = navigator.language; + +var providers = []; + +// No locale or U.S. English: no translation providers so go ahead and bootstrap the app +if (!locale || locale === 'en-US') { + ngPlatformBrowserDynamic.platformBrowserDynamic().bootstrapModule(NfRegistryModule, {providers: providers}); +} else { //load the translation providers and bootstrap the module + var translationFile = './nifi-registry/messages.' + locale + '.xlf'; + + $.ajax({ + url: translationFile, + dataType: "text", + success: function (translations) { --- End diff -- ok ---