jquery - i18next translator missingKey en translation -


i'am trying implement i18next translation on web-site , cannot success it.

i18next.init({     debug: true,     lng: 'en',     resources: {         en: {             translation: {                 opt: {                     page_title: 'orders'                 },             }         },         ru: {             translation: {                 opt: {                     page_title: 'Заказы'                 },             }         }     }, function(err, t) {         jqueryi18next.init(i18next, $);     }); 

i have vocabulary part of system need have set of named variables.

i18next.addresources('en', 'desktop', {     'Авиа'                          :   'avia',     'Ж/Д'                           :   'train',     'Произвольная услуга'           :   'custom service',      'Текущий баланс'                :   'current balance',     'Оборот за предыдущий месяц'    :   'turnover previous month',     'Оборот за текущий месяц'       :   'turnover current month',     'Общий оборот'                  :   'total turnover', });  i18next.loadnamespaces('desktop'); 

there no success next equation:

var fincancedict = {     company_balance                 :   $.t('Текущий баланс'),     company_turnover_prev_month     :   $.t('Оборот за предыдущий месяц'),     company_turnover_current_month  :   $.t('Оборот за текущий месяц'),     company_turnover_full           :   $.t('Общий оборот') } 

i'm getting errors each translation operation:

i18next.js?v=e988b1:142 i18next::translator: missingkey en translation Текущий баланс Текущий баланс i18next.js?v=e988b1:142 i18next::translator: missingkey en translation Оборот за предыдущий месяц Оборот за предыдущий месяц i18next.js?v=e988b1:142 i18next::translator: missingkey en translation Оборот за текущий месяц Оборот за текущий месяц i18next.js?v=e988b1:142 i18next::translator: missingkey en translation Общий оборот Общий оборот 

if check i18next.translator.resourcestore.data i'll initial vocabulary en & ru language object translation child own set of nested key/value pairs no extension did.

i fill missing something, have try change namespace default , desktop neither helped.

loadnamespace -> load namespace via backend (eg. xhr-backend): https://www.i18next.com/api.html#loadnamespaces

translation default namespace that's why can access translations in without prepending in t function. https://www.i18next.com/configuration-options.html#languages-namespaces-resources

you can create "fixedt" function

const desktopt = i18next.getfixedt(null, 'desktop'); desktopt('Текущий баланс'); 

Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -