ngx-metaui / rules

One Framework to build a highly declarative and customizable UI without using templates.
Other
38 stars 8 forks source link

I18n Builder API support #56

Open fkolar opened 4 years ago

fkolar commented 4 years ago

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ x] Bug report  
[ ] Performance issue
[x ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:

Current behavior

Currently MetaUI relies on the Runtime i18n (something similar to ngx-translate used to work) and have specific syntax to mark strings inside OSS to be translatable.

Expected behavior

Extend Builder API to include also the also OSS files. This is for "extract strings to files" and "Compile" process

fkolar commented 4 years ago

There is no real builder support for i18n as it process during AOT compilation, but we will probbly have separate command that we will execute as part of the build chain. We can get some idea from here:

https://github.com/angular/angular/blob/master/packages/compiler-cli/src/transformers/program.ts

const bundle = this.compiler.emitMessageBundle(this.analyzedModules, locale);
      i18nExtract(format, file, this.host, this.options, bundle);
zackarychapple commented 4 years ago

Possibly we can leverage a pre AOT stage in the build pipeline?