1

I'm trying to use the ember addon ember-i18n, i already read all the documentation, but i just can't figure out why is not working.

I have already installed the addon and generated three locations: en-us, pt-BR and es and configure following the instructions in github, but don't seems to work. What could be the problem??

All code:

routes/applications.js:

'use strict';
import Ember from 'ember';

export default Ember.Route.extend({
    i18n: Ember.inject.service(),
});

locales/pt-BR/translations.js:

export default {
 'testing' :'testing i18n'
};

config/environment.js:

  var ENV = {
    modulePrefix: 'site',
    environment: environment,
    baseURL: '/',
    locationType: 'auto',
    EmberENV: {
      FEATURES: {}
    },

    APP: {},

    contentSecurityPolicyHeader: 'Content-Security-Policy',
    contentSecurityPolicy: {
      'default-src': "'none'",
      'script-src': "'self' 'unsafe-inline' 'unsafe-eval'",
      'font-src': "'self' http://fonts.gstatic.com",
      'connect-src': "'self' http://localhost:3000",
      'img-src': "'self'",
      'report-uri':"'localhost'",
      'style-src': "'self' 'unsafe-inline' http://fonts.googleapis.com",
      'frame-src': "'none'"
    },

    moment: {
      outputFormat: 'DD/MM/YYYY'
    },

    i18n: {
      defaultLocale: 'pt-BR',
    }
  };

templates/index.js:

<h2>{{t 'testing'}}</h2>

output:

Missing translation: 'testing'
4

0 回答 0