i18n: Move translations to ui/public and enable dynamic loading to reduce bundle size#51735
Conversation
jscheffl
left a comment
There was a problem hiding this comment.
Looks good for me (except one sanity question)
(as wel as CI needs to turn green :-D) |
1105721 to
f82036d
Compare
ashb
left a comment
There was a problem hiding this comment.
You have a lot of unrelated changes which makes the diff hard to review
cf338f9 to
e09be62
Compare
f7e3bba to
6376d32
Compare
|
I don't understand why this Tests AMD / Airflow CTL tests / airflow-ctl:P3.9 tests (pull_request) CI suddenly started failing. |
|
|
@pierrejeambrun , Thank you for reviewing my PR ;) I’ve resolved all the conflicts, and as previously discussed, The CI checks for these changes have also just passed. |
|
Wooohooo ! |
|
Finally! |
…reduce bundle size (apache#51735) * Feat(i18n): Move translation files to public, use i18next-http-backend * Adopted i18next-http-backend * Fix(i18n): Update locales directory path to public for translation files * Fix(i18n): Update static file path for translation locales * Fix(i18n): Update translation config file path * Fix(i18n): Update ESLint configuration to include jsonc-parser * Fix(i18n): Update ESLint file patterns and add 'components' to namespaces * Fix(i18n): Initialize i18n(en) in DagCard tests * chore: enforce consistent array type syntax per @typescript-eslint rule * Revert "chore: enforce consistent array type syntax per @typescript-eslint rule" This reverts commit d218738. * Fix(i18n): Ignore i18n locale files in ESLint TypeScript rules * Fix(tests): Remove unused imports and clean up test setup * Apply pre-commit formatting to openapi-gen/ files as per apache#51755 * Fix(eslint): Update i18n and TypeScript rules configuration * Apply ESLint and i18nRule * Mov Arabic and French translations to public * Fix: Update translation file paths to public directory * Moved i18n doc and completeness checker script from public to dev/i18n * fix(i18n): i18n policy document translation completeness check command
Summary
ui/src/i18n/localestoui/public/i18n/locales.i18next-http-backendto load translation files via HTTP dynamically.loadPathto/static/i18n/locales/{{lng}}/{{ns}}.jsonfor both environments.Details
/static/i18n, ensuring translation files are served correctly during development.distdirectory.config.ts) was updated to use a unified HTTP path for translation files, simplifying the frontend logic.Before
After
Breaking Changes
src, please update them to use the new location inpublic/i18n/locales.closes: #51123
Opened a new PR to avoid potential issues with translation file conflicts in the previous one.
Sorry for the inconvenience.
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.