Comments (2)
There is no next-roots way how to handle initial redirect. I think it is out of scope of this lib.
This feature highly depends on app requirements about how initial locale should be detected (based on cookie, headers, browser language, ...).
Therefore I did not cover it by next-roots. I just provide an example how it can be done easil. You can see It in the example folder. There is IndexRoot which simply redirects to the default language set in schema. Using this simple approach you can be easily redirect to any other desired (detected) locale.
https://github.com/svobik7/next-roots/blob/master/example/roots/index.tsx#L15
from next-roots.
Thanks @svobik7 it's been extremely helpful.
from next-roots.
Related Issues (20)
- Question about language detection HOT 9
- Question about usage HOT 2
- question regarding a possible --watch option HOT 4
- Source folder wiped completely when roots script runs into error HOT 3
- How to Handle Dynamic Slugs with Translated Slugs? HOT 4
- Type error at build time HOT 5
- How to generate route with optional catch-all segments? HOT 6
- CSS/favicon issue when integrating with app created by `npx create-next-app` HOT 2
- No utility classes were detected in your source files. (tailwind.config.ts)
- getHref in route with multiple dynamic params HOT 3
- next-roots - Given rewrite is not a page route rewrite. HOT 2
- Is there a downside of using Inlang compared to next-roots? HOT 2
- Feature Request: skip page generation for specific languages HOT 6
- Add support for localising .js pages HOT 1
- Support for Es module? HOT 4
- Feature Request: Allowing "Generate params from the top down" for route with multiple dynamic segments HOT 6
- Feature Request: Include `generateStaticParams` Function in Generated `layout.tsx` Files HOT 1
- Issue: Incorrect route returned for dynamic segment when sibling catch-all segment exists HOT 4
- Running yarn next-roots: cannot find modules node-watch, parse-typed-args and path-to-regexp HOT 3
- Feature Request: Allow page and layout to export `viewport` and `generateViewport` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from next-roots.