Skip to content
This repository was archived by the owner on Dec 31, 2024. It is now read-only.
This repository was archived by the owner on Dec 31, 2024. It is now read-only.

[Feature request] - Override of the getChoiceIndex function should be available via options object on initialization #464

Description

@AndrewBogdanovTSS

I use vue-i18n via another lib nuxt-i18n so I doesn't have direct access to the library to override getChoiceIndex method in a clean way as it described in the documentation and my personal opinion is that it looks dirty to to this at all. Instead, what I like is to be able to do override this method via default vue-i18n config object. The syntax is pretty simple:

new VueI18n({
  locale: 'pl', // set locale
  getChoiceIndex(choice, choicesLength) {
     // Custom pluralization code goes here
  }
})

so when using nuxt-i18n module I can simply do:

modules: [ ['nuxt-i18n', {
locales: [...], 
vueI18n: {
   getChoiceIndex(choice, choicesLength) {
     // Custom pluralization code goes here
  }
}
}]]

I think such approach is much more cleaner to use!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions