Skip to content
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

Allow custom strings in i18n config (#4243) #4252

Merged
merged 1 commit into from
May 7, 2024

Conversation

Fsss126
Copy link
Contributor

@Fsss126 Fsss126 commented May 5, 2024

closes #4243

Description

Allowed custom strings and improved type checking and autocompletion in ide for keys

image

Also added ability to have autocompletion know about user-added keys through module augmentation

image image

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Improvement/refactoring (non-breaking change that doesn't add any feature but make things better)

@Fsss126 Fsss126 force-pushed the i18n-custom-keys branch from eec1f3e to b9c8278 Compare May 5, 2024 21:14
@Fsss126 Fsss126 changed the title Allow custom strings in i18n config #4243 Allow custom strings in i18n config (#4243) May 6, 2024
Copy link
Collaborator

@m0ksem m0ksem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good. Let's deeply integrate with intlify i18n module. Consider api changes and show warning if $t do not exists in i18n global property for example.

@@ -21,17 +35,17 @@ export const useTranslation = () => {

return {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add here getCurrentInstance, find $i18n and try to $t. User may have i18n module installed and we can find value from their config, instead of our. I'd say, i18n confirm have priority over our translations config. But, I think we also need require user to prefix translations for vuestic. So it is va:cancel, not just cancel. We don't react if user changed language with i18n config - that's the main problem.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@m0ksem m0ksem marked this pull request as draft May 7, 2024 03:59
@m0ksem m0ksem marked this pull request as ready for review May 7, 2024 04:04
@m0ksem m0ksem merged commit 031eeb0 into epicmaxco:develop May 7, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

types: allow custom strings in i18n config
2 participants