上下文:使用JavaScript和AMD模块(如require.js)编写的单页web应用程序
用AMD模块实现i18n的更好的方法是什么?
让我们说:
translation.js返回一些i18n函数
require([..modules files., 'translation.js' ], function(.modules.. , t ){
here in the code/view templates I use t('give_me_text') function
})
这样的方法可以吗?