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

[Bug Report][3.1.7] VueI18nAdapterParams not compatible with createI18n result #16848

Closed
6XGate opened this issue Mar 6, 2023 · 0 comments
Closed
Assignees
Labels
E: locale Locale composable T: bug Functionality that does not work as intended/expected typescript
Milestone

Comments

@6XGate
Copy link

6XGate commented Mar 6, 2023

Environment

Vuetify Version: 3.1.7
Vue Version: 3.2.47
Browsers: Firefox 110.0
OS: Linux x86_64

Steps to reproduce

Attempt to run npm run build on the respository.

Expected Behavior

The repository should build, uses similar code as outlined in the Docs for using vue-i18n with Vuetify 3

Actual Behavior

Produces the following error:

src/plugins/vuetify.ts:22:37 - error TS2322: Type 'I18n<{ en: { $vuetify: { badge: string; close: string; dataIterator: { noResultsText: string; loadingText: string; }; dataTable: { itemsPerPageText: string; ariaLabel: { sortDescending: string; sortAscending: string; sortNone: string; activateNone: string; activateDescending: string; activateAscending: string; }; so...' is not assignable to type 'I18n<{}, {}, {}, string, false>'.
  The types of 'global.t' are incompatible between these types.
    Type 'ComposerTranslation<{ en: { $vuetify: { badge: string; close: string; dataIterator: { noResultsText: string; loadingText: string; }; dataTable: { itemsPerPageText: string; ariaLabel: { sortDescending: string; sortAscending: string; sortNone: string; activateNone: string; activateDescending: string; activateAscending...' is not assignable to type 'ComposerTranslation<{}, string, RemoveIndexSignature<{ [x: string]: LocaleMessageValue<VueMessageType>; }>, never, never, never>'.
      Type 'string' is not assignable to type '"en"'.

22     adapter: createVueI18nAdapter({ i18n, useI18n })
                                       ~~~~

  node_modules/vuetify/lib/locale/adapters/vue-i18n.d.ts:24:5
    24     i18n: I18n<{}, {}, {}, string, false>;
           ~~~~
    The expected type comes from property 'i18n' which is declared here on type 'VueI18nAdapterParams'


Found 1 error in src/plugins/vuetify.ts:22

Reproduction Link

https://github.com/6XGate/vuetify-i18n-bug

@KaelWD KaelWD added T: bug Functionality that does not work as intended/expected typescript E: locale Locale composable labels Mar 13, 2023
@KaelWD KaelWD self-assigned this Mar 13, 2023
@KaelWD KaelWD added this to the v3.1.x milestone Mar 13, 2023
@KaelWD KaelWD closed this as completed in 34f13df Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E: locale Locale composable T: bug Functionality that does not work as intended/expected typescript
Projects
None yet
Development

No branches or pull requests

2 participants