2017-12-19 1 views
0

i18next는 :: 번역기 : missingKey ES-AR 이 내가 두 가지 방법으로 번역하려고i18next는 항상 실종 반환 키 내가 번역하려고 할 때마다 내가 얻을

.headersGroup 
       h2(ng-i18next="{{$ctrl.getFilterTitle()}}") 
       h3(ng-i18next="landing.name") 

내 퍼그 component.pug입니다 . pug 파일과 컨트롤러에서.

getFilterTitle() { 
     return this.$i18next.t('landing.title') 
    } 
심지어 보간하지

또는 아무것도 component.js. 그냥 기본적인 번역.

ES-AR.json

{ 
    "landing": { 
    "title" : "Filtros", 
    "name" : "Principales" 
    } 
} 

이 내 초기화입니다

window.i18next 
       .use(window.i18nextXHRBackend); 
      window.i18next.use(window.i18nextLocalStorageCache); 

      window.i18next.init({ 
       debug: '!{env}' !== 'production', 
       lng: config.locale, // If not given, i18n will detect the browser language. 
       fallbackLng: false, 
       backend: { 
       loadPath: '/ 

myApp/build/i18n/{{lng}}/{{ns}}.json' 
      }, 
      cache: { 
      enabled: true, 
      prefix: 'i18next_experts_', 
      expirationTime: 7 * 24 * 60 * 60 * 1000, 
      versions: {} 
      }, 
      useCookie: false, 
      useLocalStorage: false 
     }, function (err, t) { 
      console.log(err, t); 
     }); 

답변

0

당신이 i18next이 번역을로드하기 전에 (t 함수를 호출) 렌더링 오히려 확인합니다.

콘솔 출력 확인 ... 백엔드로드 메시지가 있기 전에 누락 된 로그 항목을 가져 옵니까?

관련 문제