Impossible to add pluralizationRules via the vueI18n options #237
Closed
Description
Version
Reproduction link
Not really needed
Steps to reproduce
- In
nuxt.config.js
, within the options for thenuxt-i18n
module, add avuei18n
option - Add
pluralizationRules: {'en': function(choice, choicesLength) { return 0 }}
object - run
npm run dev
What is expected ?
The generated .nuxt/nuxt-i18n/plugin.main.js
file should initialize new VueI18n
with pluralizationRules: {'en': function(choice, choicesLength) { return 0 }}
parameter
What is actually happening?
pluralizationRules
is an empty object
Additional comments?
This happens because the vuei18n
options get stringified using JSON.stringify
here. The result of JSON.stringify({foo: function() {return 'bar'}})
is an empty object as the method serializes function as null
value as you can see here
The option to initialize VueI18n
with pluralization rules was added recently (see discussion)
Metadata
Assignees
Labels
No labels