-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix i18n extract #233
Fix i18n extract #233
Conversation
… to solve angular 13 compatibility `npm uninstall @biesbjerg/ngx-translate-extract` `npm i @bartholomej/ngx-translate-extract` see: biesbjerg/ngx-translate-extract#246 biesbjerg/ngx-translate-extract#247 angular/angular#43833 (comment)
GitHub Pages links:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good enough, hopefully we can go back to the original package soon
opacity-25 | ||
capitalize | ||
" | ||
class="items-center justify-center px-2 py-1 bg-primary text-white rounded opacity-25 capitalize" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why we have such changes...
Prettier or npm run format
should guarantee to always have the correct indentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prettier has changed its strategy for html formatting with version 2.5 (https://prettier.io/blog/2021/11/25/2.5.0.html#collapse-html-class-attributes-onto-one-line-11827httpsgithubcomprettierprettierpull11827-by-jlongsterhttpsgithubcomjlongster), and does not wrap lines > printWidth
anymore. I didn't see another param to conserve the old behavior, which might not make sense anyway, since this evolution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes but i wonder why all those changes were not automatic and mandatory for the CI when angular and prettier were updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's because prettier is only run on affected
libraries and apps, so the new formatting strategy has not been applied everywhere but will be gradually. I guess it would be preferable to have all HTML reformatted correctly to avoid confusing diffs in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, at some point we should run test, lint and format on all sources to avoid having broken stuff while didn't change anything about them.
We should add npm scripts for that IMO.
PR temporarily installs another fork of
ngx-translate-export
to solve Angular 13 compatibility.Tested running
npm run i18n:extract
with translations in HTML templates and marker translations.see issue/PR:
Note that prettier HTML formatting has changed with version 2.5.0, which explains the HTML modifications in this PR.