intlify / vue-i18n

Vue I18n for Vue 3
https://vue-i18n.intlify.dev/
MIT License
2.15k stars 327 forks source link

Do not fallback on empty string #1206

Closed 6543 closed 1 year ago

6543 commented 1 year ago

Reporting a bug?

We use weblate to translate WoodpeckerCI. This does produce locales that have keys with empty values if it did not got translated.

the fallback would work fine if the key does not exist but in our case it does but it's empty.

so we get an UI with no text at all in some cases ... :/

Expected behavior

handle empty string like missing key or add an option to enable this behavior e.g. 'fallbackOnEmptyString: true'

Reproduction

go to https://ci.woodpecker-ci.org/repos and set browser language to Spanish.

you can also checkout to https://github.com/woodpecker-ci/woodpecker/pull/1305 and explicit change the lang ...

System Info

System:
    OS: Linux 6.0 undefined
  Binaries:
    Node: 16.16.0 - /usr/bin/node
    Yarn: 1.22.19 - /usr/bin/yarn
    npm: 8.19.2 - /usr/bin/npm
  Browsers:
    Firefox: 106.0.1
  npmPackages:
    @intlify/vite-plugin-vue-i18n: ^6.0.3 => 6.0.3 
    @vitejs/plugin-vue: ^3.1.2 => 3.1.2 
    @vue/compiler-sfc: ^3.2.41 => 3.2.41 
    vite: ^3.1.8 => 3.1.8 
    vite-plugin-prismjs: ^0.0.8 => 0.0.8 
    vite-plugin-windicss: ^1.8.8 => 1.8.8 
    vite-svg-loader: ^3.6.0 => 3.6.0 
    vue: ^3.2.41 => 3.2.41 
    vue-eslint-parser: ^9.1.0 => 9.1.0 
    vue-i18n: ^9.2.2 => 9.2.2 
    vue-router: ^4.1.5 => 4.1.5 
    vue-tsc: ^0.40.13 => 0.40.13

Screenshot

No response

Additional context

if there is already an option I'm sorry I tried hard to find it!

upstream issue: https://github.com/woodpecker-ci/woodpecker/issues/1313

Validations

6543 commented 1 year ago

locales files: https://github.com/woodpecker-ci/woodpecker/tree/master/web/src/assets/locales

mentioned one that needs a fallback for sure: https://github.com/woodpecker-ci/woodpecker/blob/master/web/src/assets/locales/es.json

6543 commented 1 year ago

sorry for the inconvenience - we got it solved the other way around by adding an addon to weblate