-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat: [KHCP_6176] Expose i18n Translation component for import without Vue plugin #150
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
42ba90b
feat: [KHCP_6176] Expose i18n Translation component for import withou…
ValeryG 1377068
Merge branch 'main' into feat/KHCP-6176-i118n-component
ValeryG d91a0fb
Update packages/core/i18n/README.md
ValeryG 4b31da5
fix: pr suggestions
ValeryG f69171d
docs: i18n
adamdehaven c9bc8d4
fix: remove unneeded import in the example
ValeryG 8ee1b0d
Update packages/core/i18n/sandbox/App.vue
ValeryG 06758e7
fix: documenting defineComponent way of consuming i18nT
ValeryG File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"global": { | ||
"ok": "O-k-key", | ||
"named": "{greeting}, my name is {name}. And I am {occupation}. I want {amount}" | ||
"named": "{greeting}, my name is {name}. And I am {occupation}. I want {amount}", | ||
"default": "See the news at {0}. There is a lot there." | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export { default as useI18n, createI18n } from './i18n' | ||
export { default as Translation } from './Translation' | ||
export { default as Translation, i18nTComponent } from './Translation' |
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.
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.
question: now that I'm looking at this logic, we always pass in the
i18n
object as a parameter as shown here:So it looks like we never actually pass in the
i18n
prop in any of our documented use-cases because it has to be passed into the function when registered in the component.I think this makes sense, because if you used the prop, you would have to pass in the
i18n
object in your<template>
usage every single time, which would not be ideal.So I think we can actually remove the
prop
, and then in the function call above, expect thei18n: IntlShapeEx
to be a required parameter, meaning we also don't need to fallback to the prop below.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.
in case of you do old
defaultComponent
way you might need to use i18n as propThere 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.
So then should we document this usage example as well?
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.
sure. documented...