Durandal (knockout) app with multilanguage support

后端 未结 4 1183
自闭症患者
自闭症患者 2021-02-01 08:18

I am building multilingual support for the app I\'m working on. After doing some research and reading SO (internationalization best practice) I am trying to integrate that in a

4条回答
  •  深忆病人
    2021-02-01 09:02

    You might consider having one i18n module that returns a singleton with all required observables. In addition a init function that takes an i18n object to initialize/update them.

    define(function (require) {
       var app = require('durandal/app'),
           i18n = require('i18n'),
           router = require('durandal/plugins/router')
       };
       return{
    
           canDeactivate: function () { 
          }
       }
    });
    
    On the view:
    
    
    

提交回复
热议问题