Not found 'some.key' key in locale messages, when it's a message function
OJFord opened this issue · comments
Oliver Ford commented
Reporting a bug?
With a message function, even just a trivial one like:
'someKey': () => 'foo',
intlify errors that the key could not be found; if it is converted to a plain string 'someKey': 'foo'
it works fine.
Expected behavior
Key should be found and translated to its value function's return value.
Reproduction
<p>{{ $t('someKey') }}</p>
{
someKey: () => 'someVal',
}
System Info
System:
OS: Linux 5.16 Arch Linux
CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
Memory: 4.03 GB / 31.08 GB
Container: Yes
Shell: 5.1.16 - /bin/bash
Binaries:
Node: 17.6.0 - /usr/bin/node
Yarn: 1.22.17 - /usr/bin/yarn
npm: 8.5.2 - /usr/bin/npm
Browsers:
Firefox: 97.0.1
npmPackages:
@intlify/nuxt3: ^0.1.10 => 0.1.10
@vue/test-utils: ^2.0.0-rc.18 => 2.0.0-rc.18
@vue/vue3-jest: ^27.0.0-alpha.4 => 27.0.0-alpha.4
vue-chart-3: ^3.1.0 => 3.1.2
vue-i18n: 9 => 9.1.9
Screenshot
No response
Additional context
No response
Validations
- Read the Contributing Guidelines
- Read the Documentation
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion
- The provided reproduction is a minimal reproducible example of the bug.
kazuya kawaguchi commented
Thank you for your reporting!
This issue is not vue-i18n, but @intlify/nuxt3
I'll transfer to there.
By the way, I'm currently working with the nuxt/i18n maintainer to develop nuxt 3 / nuxt bridge support for nuxt/i18n. I recommend you to use that from now on.