0

林創作angular2和IM使用IM國際化實施國際正是按照 https://angular.io/docs/ts/latest/cookbook/i18n.html國際化的角度2

命令

./node_modules/.bin/ng-xi18n 

不工作的步驟的基本的網頁,我也已經嘗試在package.json腳本中添加ng-x18n,但仍然無法正常工作,但得到如下錯誤:

Error: Error encountered resolving symbol values statically. Calling function 'NoOpAnimationDriver', function calls are not supported. Consider replacing the function or lambda with a reference to an expo 
rted function, resolving symbol AnimationDriver.NOOP in E:/angular/myproject/localetest/node_modules/@angular/platform-browser/src/dom/animation_driver.d.ts, resolving symbol BrowserTestingModule in E:/an 
gular/myproject/localetest/node_modules/@angular/platform-browser/testing/browser.d.ts, resolving symbol BrowserTestingModule in E:/angular/myproject/localetest/node_modules/@angular/platform-browser/test 
ing/browser.d.ts 
    at SyntaxError.BaseError [as constructor] (E:\angular\myproject\localetest\node_modules\@angular\compiler\bundles\compiler.umd.js:1597:31) 
    at new SyntaxError (E:\angular\myproject\localetest\node_modules\@angular\compiler\bundles\compiler.umd.js:1795:20) 
    at simplifyInContext (E:\angular\myproject\localetest\node_modules\@angular\compiler\bundles\compiler.umd.js:25774:27) 
    at StaticReflector.simplify (E:\angular\myproject\localetest\node_modules\@angular\compiler\bundles\compiler.umd.js:25786:17) 
    at StaticReflector.annotations (E:\angular\myproject\localetest\node_modules\@angular\compiler\bundles\compiler.umd.js:25282:64) 
    at NgModuleResolver.resolve (E:\angular\myproject\localetest\node_modules\@angular\compiler\bundles\compiler.umd.js:17762:86) 
    at CompileMetadataResolver.getNgModuleMetadata (E:\angular\myproject\localetest\node_modules\@angular\compiler\bundles\compiler.umd.js:18263:64) 
    at CompileMetadataResolver.getNgModuleSummary (E:\angular\myproject\localetest\node_modules\@angular\compiler\bundles\compiler.umd.js:18219:56) 
    at E:\angular\myproject\localetest\node_modules\@angular\compiler\bundles\compiler.umd.js:18309:72 
    at Array.forEach (native) 
Extraction failed 

the extract離子似乎沒有辦法做什麼..請幫助

+1

使用'NG2-translate'您的國際化。 –

+0

它實際上是'ngx-translate'現在 –

回答

0

它可能已經晚了,但是,但我也有這個問題的命令。

我使用:./node_modules/.bin/ng-xi18n -p src/tsconfig.json --i18nFormat=xlf或使其更短我將這一行"i18n": "ng-xi18n -p src/tsconfig.json --i18nFormat=xlf"添加到我的package.json「腳本」,然後我可以簡單地運行npm run i18n

而且命令ng xi18n --output-path=src/locale作品對我來說

請參閱這篇文章,因爲它有很好的答案,我得到它的工作如下它:Angular2 and webpack - i18n plugin vs ng2-translate

+0

thanx mate..will正在調查它。 – biff