question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

translatable paths

See original GitHub issue

Thank you for such an awesome routing library, I am going to switch from React Router 4 😃 All in all, I think I know how to cover all cases, except for one - having translatable routes in routesMap: so, instead of this:

const routesMap = { 
  HOME: '/home'
};

something like this:

const routesMap = { 
  HOME:  : {
    en: '/home', 
    de: '/haus'
  }
};

en or de could be part of redux state.language for example. Would it be possible to achieve something like that with this library?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:18 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
gouegdcommented, Sep 7, 2017

@klis87 you need to have a payload as well on your actions, such as:

{ type: 'HOME', payload: { lang: 'haus' } }

2reactions
faceyspaceycommented, Sep 7, 2017

Hey there, we just released optional params, regexes in paths, multi segment parameters and more. Essentially advanced path definitions:

https://github.com/faceyspacey/redux-first-router/issues/83#issuecomment-327703226

This may help your use case. For example, you can now do:

const routesMap = { 
  HOME: '/(home|haus)'
};

Or even better:

const routesMap = { 
  HOME: '/:lang(home|haus)'
};

Now that route will only be matched for home or haus and payload.lang will have the language for you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Translatable pathways classification (TransPath-C ... - PubMed
This method uses variation of pathway activation in the mouse model to predict both mouse and human disease phenotype. Analysis of shared ...
Read more >
Translating Example Paths and URLs — Localization Guide ...
In translatable messages you will find real paths and URLs but you will also find instances where the author is giving the user...
Read more >
next-translate-routes - npm
Flexible and translated routes for Next.js without custom server. Latest version: 1.9.1, last published: a month ago.
Read more >
Career Paths – Translation And Interpreting
Career Paths · Translators work with written or multimedia materials and translate only into their native language. · Interpreters · Language transcriptionist: ...
Read more >
aw-studio/laravel-translatable-routes - GitHub
A package for creating and managing translatable routes in laravel. Setup. Install the package via composer: composer require aw-studio/laravel-translatable- ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found