feat: merging of locale files with the same name for @intlify/unplugin-vue-i18n/messages#274
Merged
kazupon merged 3 commits intointlify:mainfrom Nov 2, 2023
DanielleHuisman:fix/merge-locale-files
Merged
feat: merging of locale files with the same name for @intlify/unplugin-vue-i18n/messages#274kazupon merged 3 commits intointlify:mainfrom DanielleHuisman:fix/merge-locale-files
@intlify/unplugin-vue-i18n/messages#274kazupon merged 3 commits intointlify:mainfrom
DanielleHuisman:fix/merge-locale-files
Conversation
Contributor
Author
|
@kazupon any chance this can get merged soon? |
kazupon
reviewed
Oct 26, 2023
kazupon
requested changes
Oct 26, 2023
Member
kazupon
left a comment
There was a problem hiding this comment.
sorry for my late reply.
I've just reviewed!
please check it!
Member
|
@DanielleHuisman One more request, this feature is for |
Contributor
Author
I updated |
kazupon
approved these changes
Nov 2, 2023
Member
kazupon
left a comment
There was a problem hiding this comment.
well done!
Thank you so much!
@intlify/unplugin-vue-i18n/messages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently,
unplugin-vue-i18ndoesn't merge keys for locale files with the same name. However, this would be a useful feature to allow splitting up locales over multiple files. For example:This issue was also brought up for the deprecated
vite-plugin-vue-i18nin #3.This PR implements the merging behaviour. I chose to use
lodash.mergeto ensure the deep merging is production-ready code.To test the new behaviour, the Vite locales were split up into two files. Without the changes to
unplugin-vue-i18n/src/index.ts, the tests fail, but with the changes they pass again.