primefaces / primeng

The Most Complete Angular UI Component Library
https://primeng.org
Other
10.45k stars 4.6k forks source link

Angular i18n translation generation fails #3109

Closed dcesiel closed 7 years ago

dcesiel commented 7 years ago

Currently we cannot generate an i18n translation file for the project because of template parsing error created by fileuploaddemo.html. I came across this error while testing i18n translation generation for #3037.

The Error:

Error: Template parse errors:
Unexpected character "EOF" (Do you have an unescaped "{" in your template? Use "{{ '{' }}") to escape it.) ("
        </p-tabPanel>
    </p-tabView>
</div>
[ERROR ->]"): ng:///home/dcesiel/Code/angular/forks/primeng/src/app/showcase/components/fileupload/fileuploaddemo.html@460:0
Invalid ICU message. Missing '}'. ("                 <td>string</td>
                            <td>"&#123;0&#125;: Invalid file size, [ERROR ->]"</td>
                            <td>Summary message of the invalid fize size.</td>
               "): ng:///home/dcesiel/Code/angular/forks/primeng/src/app/showcase/components/fileupload/fileuploaddemo.html@216:67
Unexpected closing tag "td". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags ("                <td>string</td>
                            <td>"&#123;0&#125;: Invalid file size, "[ERROR ->]</td>
                            <td>Summary message of the invalid fize size.</td>
                "): ng:///home/dcesiel/Code/angular/forks/primeng/src/app/showcase/components/fileupload/fileuploaddemo.html@216:68
    at Error (native)
    at syntaxError (/home/dcesiel/Code/angular/forks/primeng/node_modules/@angular/compiler/bundles/compiler.umd.js:1550:34)
    at DirectiveNormalizer.normalizeLoadedTemplate (/home/dcesiel/Code/angular/forks/primeng/node_modules/@angular/compiler/bundles/compiler.umd.js:13367:19)
    at /home/dcesiel/Code/angular/forks/primeng/node_modules/@angular/compiler/bundles/compiler.umd.js:13353:51
    at process._tickCallback (internal/process/next_tick.js:109:7)
    at Module.runMain (module.js:606:11)
    at run (bootstrap_node.js:390:7)
    at startup (bootstrap_node.js:150:9)
    at bootstrap_node.js:505:3
Extraction failed
[x ] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Plunkr Case (Bug Reports) This cannot be demoed in Plunkr because it's an issue that springs up when attempting to use the Angular i18n translation generation command line utility ng-xi18n. It can only be demoed via command line. See reproduction steps below.

Current behavior Fails to generate a translation file unless fileuploaddemo.html is removed from the project.

Expected behavior Should generate a translation file without errors.

Minimal reproduction of the problem with instructions You can reproduce the issue in a clean project using the following steps in the CLI:

Install necessary libararies to create a translation file: npm install @angular/compiler-cli @angular/platform-server

Generate translation file: ./node_modules/.bin/ng-xi18n --i18nFormat=xmb -p tsconfig.json

Please tell us about your environment: Ubuntu 16.04

cagataycivici commented 7 years ago

This should be fixed in recent PrimeNG release, please try with it and if the issue persists drop a comment with along with a test case based on plunkr below and we'll review again.

http://plnkr.co/edit/Wj39h1?p=preview

dcesiel commented 7 years ago

@cagataycivici in which pull request was this fixed? Seems to be failing now for another reason.

Error: Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:1:15: Cannot find module './components/common/api'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:2:15: Cannot find module './components/common/shared'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:3:15: Cannot find module './components/accordion/accordion'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:4:15: Cannot find module './components/autocomplete/autocomplete'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:5:15: Cannot find module './components/blockui/blockui'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:6:15: Cannot find module './components/breadcrumb/breadcrumb'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:7:15: Cannot find module './components/button/button'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:8:15: Cannot find module './components/captcha/captcha'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:9:15: Cannot find module './components/calendar/calendar'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:10:15: Cannot find module './components/carousel/carousel'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:11:15: Cannot find module './components/chart/chart'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:12:15: Cannot find module './components/checkbox/checkbox'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:13:15: Cannot find module './components/chips/chips'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:14:15: Cannot find module './components/codehighlighter/codehighlighter'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:15:15: Cannot find module './components/contextmenu/contextmenu'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:16:15: Cannot find module './components/datagrid/datagrid'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:17:15: Cannot find module './components/datalist/datalist'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:18:15: Cannot find module './components/datascroller/datascroller'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:19:15: Cannot find module './components/datatable/datatable'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:20:15: Cannot find module './components/defer/defer'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:21:15: Cannot find module './components/colorpicker/colorpicker'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:22:15: Cannot find module './components/confirmdialog/confirmdialog'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:23:15: Cannot find module './components/dialog/dialog'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:24:15: Cannot find module './components/dragdrop/dragdrop'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:25:15: Cannot find module './components/dropdown/dropdown'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:26:15: Cannot find module './components/editor/editor'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:27:15: Cannot find module './components/fieldset/fieldset'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:28:15: Cannot find module './components/fileupload/fileupload'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:29:15: Cannot find module './components/galleria/galleria'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:30:15: Cannot find module './components/gmap/gmap'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:31:15: Cannot find module './components/growl/growl'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:32:15: Cannot find module './components/inplace/inplace'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:33:15: Cannot find module './components/inputmask/inputmask'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:34:15: Cannot find module './components/inputswitch/inputswitch'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:35:15: Cannot find module './components/inputtext/inputtext'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:36:15: Cannot find module './components/inputtextarea/inputtextarea'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:37:15: Cannot find module './components/lightbox/lightbox'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:38:15: Cannot find module './components/listbox/listbox'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:39:15: Cannot find module './components/megamenu/megamenu'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:40:15: Cannot find module './components/menu/menu'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:41:15: Cannot find module './components/menubar/menubar'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:42:15: Cannot find module './components/messages/messages'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:43:15: Cannot find module './components/multiselect/multiselect'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:44:15: Cannot find module './components/orderlist/orderlist'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:45:15: Cannot find module './components/organizationchart/organizationchart'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:46:15: Cannot find module './components/overlaypanel/overlaypanel'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:47:15: Cannot find module './components/paginator/paginator'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:48:15: Cannot find module './components/panel/panel'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:49:15: Cannot find module './components/panelmenu/panelmenu'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:50:15: Cannot find module './components/password/password'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:51:15: Cannot find module './components/picklist/picklist'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:52:15: Cannot find module './components/progressbar/progressbar'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:53:15: Cannot find module './components/radiobutton/radiobutton'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:54:15: Cannot find module './components/rating/rating'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:55:15: Cannot find module './components/schedule/schedule'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:56:15: Cannot find module './components/selectbutton/selectbutton'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:57:15: Cannot find module './components/slidemenu/slidemenu'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:58:15: Cannot find module './components/slider/slider'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:59:15: Cannot find module './components/spinner/spinner'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:60:15: Cannot find module './components/splitbutton/splitbutton'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:61:15: Cannot find module './components/steps/steps'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:62:15: Cannot find module './components/tabview/tabview'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:63:15: Cannot find module './components/tabmenu/tabmenu'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:64:15: Cannot find module './components/terminal/terminal'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:65:15: Cannot find module './components/tieredmenu/tieredmenu'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:66:15: Cannot find module './components/togglebutton/togglebutton'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:67:15: Cannot find module './components/toolbar/toolbar'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:68:15: Cannot find module './components/tooltip/tooltip'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:69:15: Cannot find module './components/tree/tree'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:70:15: Cannot find module './components/treetable/treetable'.
Error at /home/dcesiel/Code/angular/primeng/primeng.d.ts:71:15: Cannot find module './components/tristatecheckbox/tristatecheckbox'.
    at UserError.Error (native)
    at new UserError (/home/dcesiel/Code/angular/primeng/node_modules/@angular/tsc-wrapped/src/tsc.js:27:28)
    at check (/home/dcesiel/Code/angular/primeng/node_modules/@angular/tsc-wrapped/src/tsc.js:93:15)
    at Tsc.typeCheck (/home/dcesiel/Code/angular/primeng/node_modules/@angular/tsc-wrapped/src/tsc.js:173:9)
    at /home/dcesiel/Code/angular/primeng/node_modules/@angular/tsc-wrapped/src/main.js:114:23
    at process._tickCallback (internal/process/next_tick.js:109:7)
    at Module.runMain (module.js:606:11)
    at run (bootstrap_node.js:390:7)
    at startup (bootstrap_node.js:150:9)
    at bootstrap_node.js:505:3
Extraction failed

How would you propose I give an example of a command line utility error in plnkr?