nuxt / movies

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

feat: add language switcher option #41

Closed ali4zimi closed 1 year ago

ali4zimi commented 1 year ago

Now it is possible to switch the language despite detecting the browser's default language. I tried not to use refresh the page but I couldn't since some data are fetched at the beginning. If there is a better way please guide me.

ali4zimi commented 1 year ago

@antfu What if we add Pinia to this project and move some of the composable to pinia so that we can trigger the API requests after translation?

antfu commented 1 year ago

I don't see Pinia is required in this case, can you elaborate more?

ali4zimi commented 1 year ago

When the language is switched, all the messages are translated, but those texts which are fetched from the server remain unchanged.

antfu commented 1 year ago

I think currently doing a full-page refresh is good enough. Thanks!