You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i18n.__({phrase: 'Have you ever met %s?',locale: 'zh_CN'},'Ted');
Error occurred
TypeError: Object #<Object> has no method 'substring'
at Function.str_format.parse (/opt/stub/node_modules/i18n/node_modules/sprintf/lib/sprintf.js:175:16)
at str_format (/opt/stub/node_modules/i18n/node_modules/sprintf/lib/sprintf.js:75:48)
at vsprintf (/opt/stub/node_modules/i18n/node_modules/sprintf/lib/sprintf.js:185:17)
at Object.i18nTranslate [as __] (/opt/stub/node_modules/i18n/i18n.js:88:11)
at repl:1:6
at REPLServer.self.eval (repl.js:111:21)
at rli.on.e (repl.js:260:20)
at REPLServer.self.eval (repl.js:118:5)
at Interface.<anonymous> (repl.js:250:12)
at Interface.EventEmitter.emit (events.js:93:17)
Am I misunderstanding the document? or, shall I use the latest version from github instead of a package from npm?
Edit
Found that code in package from npm for __(...)
i18n.__=functioni18nTranslate(phrase){// get translated message with locale from scope (deprecated) or objectvarmsg=translate(getLocaleFromObject(this),phrase);// if we have extra arguments with strings to get replaced,// an additional substition injects those strings afterwardsif(arguments.length>1){msg=vsprintf(msg,Array.prototype.slice.call(arguments,1));}returnmsg;};
npm version is quite outdated. Shame on me, I planed to release some more features to npm earlier. Time passed and I will publish current git version on friday after a a last review.
When I use
__(...)
with specified localeError occurred
Am I misunderstanding the document? or, shall I use the latest version from github instead of a package from npm?
Edit
Found that code in package from npm for
__(...)
and the package.json file
Maybe the package on NPM is broken?
The text was updated successfully, but these errors were encountered: