mirror of
https://github.com/discourse/discourse.git
synced 2026-08-09 21:23:14 +08:00
When a translation resolves to an empty value `""`, this is valid and intentional... ...but `findTranslationWithFallback` uses a falsy check, `!translation`, to decide to fallback to the next locale. When this happens the key is shown instead of the empty value being handled. To reproduce this, you can set your site locale to something not english (French for example) and then change your user's locale to English (`/my/preferences/interface`). Then an empty translation will produce the key instead of remaining blank... like this example from the admin header component: <img width="800" alt="image" src="https://github.com/user-attachments/assets/e9b4b715-6752-419c-af9b-b99facfd24ff" /> This has cropped up in other places before, but never fixed at the root (https://meta.discourse.org/t/bug-with-search-banner-search-button-text-shown-in-search-banner-theme-component/273628/13?u=awesomerobot) Switching the check to null will fix it. |
||
|---|---|---|
| .. | ||
| src | ||
| addon-main.cjs | ||
| package.json | ||
| tsconfig.json | ||