We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Previously in version 8 I was able to overwrite the prototype function fetchChoice
VueI18n.prototype.fetchChoice = function fetchChoice(message, choice) { handle things }
message in my case is an object and not a string. That's why the current public function to change the choice making is not enough for me.
But with version 9 and createI18n function I do not know how to do it. I saw the referenced line (https://github.com/intlify/vue-i18n-next/blob/b5c73ef661e88719cb5d6c40a58e264923230077/packages/core-base/src/runtime.ts#L409C5-L409C36): [HelperNameMap.PLURAL]: plural in createMessageContext. And I wondered how I can overwrite the Helper plural.
[HelperNameMap.PLURAL]: plural
createMessageContext
As reference my fetchChoice looks like:
VueI18n.prototype.fetchChoice = function fetchChoice(message, choice) { /* istanbul ignore if */ if ( !message && (!isString(message) || (!message.zero && !message.one && !message.other)) ) { return null; } if (isString(message)) { var choices = message.split('|'); choice = this.getChoiceIndex(choice, choices.length); if (!choices[choice]) { return message; } return choices[choice].trim(); } if (message.one || message.other) { if (choice === -1 || choice === 1) return message.one || message.other; if (choice === 0) return message.zero || message.other; return message.other; } };
Originally posted by @valoricDe in #1657
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Previously in version 8 I was able to overwrite the prototype function fetchChoice
message in my case is an object and not a string. That's why the current public function to change the choice making is not enough for me.
But with version 9 and createI18n function I do not know how to do it.
I saw the referenced line (https://github.com/intlify/vue-i18n-next/blob/b5c73ef661e88719cb5d6c40a58e264923230077/packages/core-base/src/runtime.ts#L409C5-L409C36):
[HelperNameMap.PLURAL]: plural
increateMessageContext
.And I wondered how I can overwrite the Helper plural.
As reference my fetchChoice looks like:
Originally posted by @valoricDe in #1657
The text was updated successfully, but these errors were encountered: