meteor-useraccounts / flow-routing

Useraccounts packages add-on for integration with Flow Router and Blaze Layout.
https://atmospherejs.com/useraccounts/flow-routing
MIT License
72 stars 50 forks source link

Templates i18n using FlowRouter URL prefixes #34

Open imajus opened 8 years ago

imajus commented 8 years ago

I'm working on website's internalization using URL prefixes for language detection (eg., /en/page). All my FlowRouter routes belong to one router group which processes language prefix and set current language in the session.

I've tried to make useraccounts templates multilingual too but with no luck. The only solution which gives a result close to what I need is to comment out all AccountsTemplates.configureRoute('name') lines and replace them with manual routes creation using FlowRouter.route(). In that case my website internal links work and templates are displaying in correct language but when it comes to links generated by useraccounts itself it gives me an error.

So far I've come up with two different approaches how to achieve that:

  1. Allow passing FlowRouter group handle to AccountsTemplates.configureRoute options and use that for useraccounts routing.
  2. Allow passing triggers to AccountsTemplates.configureRoute options and append them to those used internally.

Both of that requires useraccounts:flow-routing source code alteration. Maybe there's another way?