i18n icon indicating copy to clipboard operation
i18n copied to clipboard

Support typed routes inside localePath()

Open AndreyYolkin opened this issue 1 year ago • 1 comments

Describe the feature

According to the code here, nuxt i18n imports types from vue-router package: https://github.com/nuxt-modules/i18n/blob/c43842f11027253c07c45b7a9e8e6ab81bae7d54/src/runtime/composables/index.ts#L24

However, nuxt itself registers #vue-router alias to handle both situations with enabled/disabled typed routes. Example of usage: https://github.com/nuxt/nuxt/blob/d326e054d372bd2eb5bf75f3feca6a291169ff76/packages/nuxt/src/pages/runtime/utils.ts#L2

Since nuxt/i18n is a nuxt module, I suppose we can rely on this alias too and enable type imports by replacing vue-router with #vue-router for types imports

Additional information

  • [X] Would you be willing to help implement this feature?
  • [ ] Could this feature be implemented as a module?

Final checks

AndreyYolkin avatar Feb 20 '24 11:02 AndreyYolkin