Skip to content

Commit 9cca711

Browse files
docs: upd readme (#47)
* docs: upd readme * docs: readme copy tweaks * docs: upd readme structure * docs: upd
1 parent d9432be commit 9cca711

File tree

4 files changed

+100
-235
lines changed

4 files changed

+100
-235
lines changed

content/banner.dark.png

-829 Bytes
Loading

content/banner.light.png

-420 Bytes
Loading

getting-started.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,26 @@ document.cookie = "REPLEXICA_LOCALE=en; path=/;";
194194
location.reload();
195195
```
196196

197+
## How to Switch Between Languages
198+
199+
Different apps use different strategies for switching between supported languages. Here are a few approaches we've seen:
200+
201+
* Cookie value (get/set cookie value)
202+
* Subdomain (`en.myapp.com` / `es.myapp.com`)
203+
* TLD domain (`myapp.com` / `myapp.es`)
204+
* Pathname segments (`myapp.com/en` / `myapp.com/es`)
205+
206+
... and so on.
207+
208+
To support every possible strategy, now and in the future, Replexica does the following:
209+
210+
*Replexica reads the value of the `REPLEXICA_LOCALE` cookie to determine the currently selected locale*
211+
212+
So, whatever approach you choose for switching between locales, just be sure to update the value of the `REPLEXICA_LOCALE` cookie, and Replexica will handle the rest.
213+
214+
> [!WARNING]
215+
> Be sure to drop by our Discord (link at the bottom) if you have an opinion on how Replexica should be handling the locale detection. Even if your idea is exotic or feels unfeasible, we'd love to hear it! 🙏 (feel free to send in private, if you want).
216+
197217
## Conclusion
198218

199219
That's it! You've successfully set up Replexica with Nextjs!

0 commit comments

Comments
 (0)