2017-02-23 5 views
0

ich diese Warnung bin immer für Ember-i18n (glut-i18n: 5.0.0)ember-i18n hat kein Standardgebietsschema gefunden. fallen zurück zu "en"

Ich habe in Default gesetzt: 'de' (As dimensionierten in glut-i18n docs) in Umwelt .js aber immer noch seine Bevölkerung Warnung.

//environment.js

module.exports = function(environment) { 
    var ENV = { 
     modulePrefix: 'spotlight', 
     environment: environment, 
     baseURL: '/', 
     locationType: 'auto', 
     EmberENV: { 
      FEATURES: {} 
     }, 

     APP: { 
      defaultLocale:'en', 
     } 
    }; 
    if (environment === 'development') { 
     ENV.APP.RAISE_ON_DEPRECATION = true; 
    } 

    if (environment === 'test') { 
     ENV.baseURL = '/'; 
     ENV.locationType = 'auto'; 
     ENV.APP.LOG_ACTIVE_GENERATION = false; 
     ENV.APP.LOG_VIEW_LOOKUPS = false; 
     ENV.APP.rootElement = '#ember-testing'; 
    } 
    if (environment === 'production') {} 

    ENV.i18n = { defaultLocale: 'en' }; 
    return ENV; 
}; 

//package.json

{ 
    "devDependencies": { 
     "ember-i18n": "5.0.0" 
    } 
} 

//app/initializer/i18n.js

import Ember from 'ember'; 

export default { 
    name: 'i18n', 
    after: 'ember-i18n', 
    initialize: function() 
    { 
     var application = arguments[1] || arguments[0]; 
     application.inject('controller', 'i18n', 'service:i18n'); 
     application.inject('route', 'i18n', 'service:i18n'); 
    } 
} 

Vielen Dank im Voraus für die Hilfe.

+0

was Sie tun, ist richtig. kann stoppen und starten 'ember s'. Das ist nur eine Warnung und in Ihrem Fall versuchen Sie auch, locale 'en' – kumkanillam

+0

@kumkanillam Dank, nach der Installation von Ember-i18n, ich habe Build mehr als 1000 mal ausgeführt. –

+0

In i18n.js Initialisierungscode, 'Import-Konfiguration von 'app-name/app/config/environment';' und innerhalb der Initialisierungsmethode include 'console.log (" config locale ", config.i18n.defaultLocale);' und inform ich Konsolenausgabe. [this] (https://github.com/jamesarosen/ember-i18n/blob/dd5157db58fa230267bade5fc6543a3be0959037/addon/services/i18n.js#L77) ist wo Warnung – kumkanillam

Antwort

0

Ich habe es. Es war wegen home.jsp (meine Projekt-Init-Datei) statischen Meta-Inhalt.

Es wurde immer mit statischen Meta-Inhalt (Home.js Meta-Inhalt) statt der Datei environment.js eingestellt.

<meta name="spotlight/config/environment" content="%7B%22modulePrefix%22%3A%22spotlight%22%2C%22environment%22%3A%22development%22%2C%22baseURL%22%3A%22%2F%22%2C%22locationType%22%3A%22hash%22%2C%22EmberENV%22%3A%7B%22FEATURES%22%3A%7B%7D%7D%2C%22i18n%22%3A%7B%22defaultLocale%22%3A%22en%22%7D%2C%22APP%22%3A%7B%22LOG_RESOLVER%22%3Atrue%2C%22LOG_ACTIVE_GENERATION%22%3Atrue%2C%22LOG_TRANSITIONS%22%3Atrue%2C%22LOG_TRANSITIONS_INTERNAL%22%3Atrue%2C%22LOG_VIEW_LOOKUPS%22%3Atrue%2C%22LOG_BINDINGS%22%3Atrue%2C%22RAISE_ON_DEPRECATION%22%3Atrue%2C%22LOG_STACKTRACE_ON_DEPRECATION%22%3Atrue%7D%2C%22contentSecurityPolicyHeader%22%3A%22Content-Security-Policy-Report-Only%22%2C%22contentSecurityPolicy%22%3A%7B%22default-src%22%3A%22%27none%27%22%2C%22script-src%22%3A%22%27self%27%20%27unsafe-eval%27%22%2C%22font-src%22%3A%22%27self%27%22%2C%22connect-src%22%3A%22%27self%27%22%2C%22img-src%22%3A%22%27self%27%22%2C%22style-src%22%3A%22%27self%27%22%2C%22media-src%22%3A%22%27self%27%22%7D%2C%22exportApplicationGlobal%22%3Atrue%7D"> 
Verwandte Themen