Skip to content

feat: add language switcher option - #41

Merged
antfu merged 2 commits into
nuxt:mainfrom
ali4zimi:main
Jul 5, 2023
Merged

antfu merged 2 commits into
nuxt:mainfrom
ali4zimi:main

Conversation

@ali4zimi

@ali4zimi ali4zimi commented Jul 2, 2023

Copy link
Copy Markdown
Contributor

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

ali4zimi commented Jul 3, 2023 •

Copy link
Copy Markdown
Contributor Author

@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

antfu commented Jul 4, 2023

Copy link
Copy Markdown
Member

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

@ali4zimi

ali4zimi commented Jul 4, 2023

Copy link
Copy Markdown
Contributor Author

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

@antfu antfu changed the title Added language switcher option feat: add language switcher option Jul 5, 2023
@antfu
antfu merged commit 74b24a4 into nuxt:main Jul 5, 2023
@antfu

antfu commented Jul 5, 2023

Copy link
Copy Markdown
Member

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

This branch was successfully deployed

1 active deployment
Preview – movies — bc17352a Deployed Jul 5, 2023 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants