Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Routing with no locale prefixes #4

Merged
merged 1 commit into from
Jan 19, 2012
Merged

Conversation

popdevelop
Copy link

I am facing the problem where I want to translate my routes but I do not want to have a prefix at the start of my urls, I want my locale to depend on different parameters. Since i18n_routes stopped working with 3.1 I think a cleaner approach would be using your fork.

Its a quite naive patch which do not take in consideration that locale is set random if you have the no_prefixes option set to true.

@francesc
Copy link
Owner

Hi Johan,

Looks good to use language by domain or subdomain. Thanks for the contribution I'll check it out and merge when have some time.

I would also appreciate if you can write down some notes on how you use it (url structure, lang detection ...) to add it to the current documentation, if you don't have time don't worry I'll write it myself.

@popdevelop
Copy link
Author

Hi Francesc,

Thanks for the fast answer. Let me know if there are any problems with the patch. Here are some text to the documentation.

No prefixes

Sometimes you want to keep your url clean and set your locale from an other source such as domain or subdomain. Using the option no_prefixes generates the following structure:

/
/products/
/productos/
/contact/
/contactos/

You can specify the following option:

ActionDispatch::Routing::Translator.translate_from_file('config/locales/routes.yml', { :no_prefixes => true })

Note that the no_prefixes option will override the prefix_on_default_locale option.

On torsdag 19 januari 2012 at 10:16, Francesc Pla wrote:

Hi Johan,

Looks good to use language by domain or subdomain. Thanks for the contribution I'll check it out and merge when have some time.

I would also appreciate if you can write down some notes on how you use it (url structure, lang detection ...) to add it to the current documentation, if you don't have time don't worry I'll write it myself.


Reply to this email directly or view it on GitHub:
#4 (comment)

@francesc francesc merged commit 15f32ba into francesc:master Jan 19, 2012
@francesc
Copy link
Owner

Already merged and released a new version. Doc is also updated and your're listed as contributor. Thanks!

@popdevelop
Copy link
Author

Thanks!

On torsdag 19 januari 2012 at 19:37, Francesc Pla wrote:

Already merged and released a new version. Doc is also updated and your're listed as contributor. Thanks!


Reply to this email directly or view it on GitHub:
#4 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants