vue-i18n icon indicating copy to clipboard operation
vue-i18n copied to clipboard

te function returns false although fallback exists

Open valoricDe opened this issue 1 year ago • 5 comments
trafficstars

Reporting a bug?

te function returns false for de-AT locale although t function is able to fallback to language de.

Expected behavior

I think it is problematic that the behaviour of t and te is different. I propose: if you provide no locale to te function it should be true if t function resolves to a fallback (eg. de-AT -> de) if you provide a locale it should only return true if the message exists in the given locale ignoring fallbacks

Reproduction

https://stackblitz.com/edit/vitejs-vite-tr2dcd?file=src%2FApp.vue

System Info

System:
    OS: macOS 14.2
    CPU: (8) arm64 Apple M1 Pro
    Memory: 95.63 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.9.0 - ~/.nvm/versions/node/v20.9.0/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v20.9.0/bin/yarn
    npm: 10.1.0 - ~/.nvm/versions/node/v20.9.0/bin/npm
  Browsers:
    Chrome: 122.0.6261.112
    Edge: 113.0.1774.35
    Safari: 17.2

Screenshot

Bildschirmfoto 2024-03-13 um 12 09 34

Additional context

No response

Validations

valoricDe avatar Mar 13 '24 11:03 valoricDe