nuxt / movies

🍿 A TMDB client built with Nuxt 3
https://movies.nuxt.space
MIT License
2k stars 284 forks source link

i18n interpolation doesn't work when there's no word in the current language #66

Closed alexchexes closed 3 months ago

alexchexes commented 4 months ago

Check out the screenshots:

2024-06-27--19-17-21--275 2024-06-27--19-17-11--905

How to reproduce:

  1. Navigate to the officially hosted site https://movies.nuxt.space/
  2. Change language to Español (for example) and try to search for TENET movie (or any other).

Looks like this happens for all words that use interpolation, that are not present in the selected language dictionary.

alexchexes commented 4 months ago

This is probably the expected behavior of @nuxtjs/i18n, but I guess Nuxt Movies needs a fallback in case an i18n dictionary lacks a word. Alternatively, we could update all dictionaries using generative AI, and then follow one (or both) of these options:

  1. Add an automated check to ensure that all dictionaries contain same keys.
  2. Add a noticeable reminder at the very beginning of each dictionary file stating that when you add a word to it, you must also add it to all other languages.
Archetipo95 commented 3 months ago

Am I wrong or now its working?

alexchexes commented 3 months ago

Am I wrong or now its working?

No, I just PR'd (https://github.com/nuxt/movies/pull/67) the missing translations, but it doesn't solve this very issue