-
Notifications
You must be signed in to change notification settings - Fork 438
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
i18n hashes invalidation #2464
i18n hashes invalidation #2464
Conversation
ec48d37
to
b471265
Compare
b471265
to
07a2e33
Compare
a5e0bda
to
a9353e4
Compare
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.
Thanks @alexandrevryghem!
The hashing thing works great, however I'd leave out the syncing of the i18n files during production builds. I'd rather see #2340 fixed using a github workflow task for example, where every time a PR is merged that changes an i18n message, a new PR is generated that syncs all i18n files
I don't like the fact that with this PR, the i18n files used in production don't contain the exact same messages as the ones in the src folder.
We gave this a quick test, as we're interested in that and it works for us as suggested. We're still on DSpace 7.5 and were able to apply the changes as they are |
@alexandrevryghem : I wanted to briefly note that I agree with @artlowel 's feedback above. I'd recommend we remove any automatic syncing of i18n files from this PR and solve it later in a separate PR. This PR could then just concentrate on the new hashed files for i18n. |
a9353e4
to
07a2e33
Compare
@alexandrevryghem : I cannot seem to remove the link to the other ticket (#2340) either 😞 It appears to be a GitHub bug. We'll just need to reopen that ticket if it ends up closing automatically when this PR is merged. (Or maybe GitHub will eventually correct itself) |
Hej, |
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.
Thanks @alexandrevryghem!
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.
👍 Thanks @alexandrevryghem ! This looks great, and I've verified this also works well when running the UI in production mode on Windows.
Successfully created backport PR for |
References
Description
In this PR I added hashes to the translation files & ensured that the translation files are retrieved with those hashes in production mode.
Instructions for Reviewers
List of changes in this PR:
EnvironmentPlugin
to be able to retrieve them in the app usingprocess.env.languageHashes
CopyWebpackPlugin
to add the hash to the json file name (only in production mode)TranslateBrowserLoader
&TranslateServerLoader
to retrieve the language file with the hash saved inprocess.env.languageHashes
(only in production mode)build:prod
command where theNODE_ENV
was not being set. This made it impossible to know whether you were building webpack in prod mode or dev mode.Guidance for how to test & review this PR:
Test the following in both dev & prod mode:
en.json5
) & other random language (the reason you also need to test this in another random language is because in prod mode the default language is already included in theTransferState
so both mechanisms need to be tested)Checklist
yarn lint
yarn check-circ-deps
)package.json
), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.