Allow translation of URLS
Hi @wiziple, thanks for this nice plugin. I was wondering if you plan to add url slug's translations too, which is a feature I haven't seen yet in the various gatsby i18n plugins. So, to make it more clear, I mean if you plan to allow this: ``` en/about it/chi-siamo (instead of it/about) ``` same page with two different slugs. I guess is not easy to manage the link routing, but I think it's possible to build a sort of routes map during the `createPages` step and pass it to the pages inside the `intl` context. The link component can then use the `to` prop as a key that would match this routes map. Some super pseudo code: in `src/pages/about/index.en.md` ```yaml url: /about ``` in `src/pages/about/index.it.md` ```yaml url: /chi-siamo ``` Then we would have a routes map in page contexts like: ```js intl = { ..., routes: { 'about': { en: '/about', it: '/chi-siamo' } } } ``` And the Link component would do ```jsx intl => ( Link = ({ to, ... }) => { const toRoute = intl.routes[to][intl.language] } ``` I am curious to see what you think of this approach or if you have any other idea in this regard. Let me know if all this is a bit unclear!
Posted by kuus on Jun 22, 2019, 6:48 AM
Tags
Related issues
- struct's lifetime requirements can be bypassed via covariant field assignment
- Proposal to Reorganize the Moderation Team and Review Moderation Policies
- Progressive FPS degradation appears to be related to dota2.com — blocking the domain prevents the performance loss
- proposal: container/...: generic collection types
- Better Custom Endpoint BYOK
- A concrete policy for backward compatibility until Godot 5.0
Raise real-world problems, find people facing the same issue, and discuss solutions.3,500 issues0 comments
github (Other)
struct's lifetime requirements can be bypassed via covariant field assignment
Proposal to Reorganize the Moderation Team and Review Moderation Policies
Progressive FPS degradation appears to be related to dota2.com — blocking the domain prevents the performance loss
proposal: container/...: generic collection types
Better Custom Endpoint BYOK
A concrete policy for backward compatibility until Godot 5.0
New MTP models not supported
Tracking: 429 / Capacity Issues
Allow translation of URLS
Hi @wiziple, thanks for this nice plugin. I was wondering if you plan to add url slug's translations too, which is a feature I haven't seen yet in the various gatsby i18n plugins. So, to make it more clear, I mean if you plan to allow this: ``` en/about it/chi-siamo (instead of it/about) ``` same page with two different slugs. I guess is not easy to manage the link routing, but I think it's possible to build a sort of routes map during the `createPages` step and pass it to the pages inside the `intl` context. The link component can then use the `to` prop as a key that would match this routes map. Some super pseudo code: in `src/pages/about/index.en.md` ```yaml url: /about ``` in `src/pages/about/index.it.md` ```yaml url: /chi-siamo ``` Then we would have a routes map in page contexts like: ```js intl = { ..., routes: { 'about': { en: '/about', it: '/chi-siamo' } } } ``` And the Link component would do ```jsx intl => ( Link = ({ to, ... }) => { const toRoute = intl.routes[to][intl.language] } ``` I am curious to see what you think of this approach or if you have any other idea in this regard. Let me know if all this is a bit unclear!
Comments (0)
No comments yet. Start the discussion.