Rails 4 i18n, how to translate routes where subdomain is used for the locale

后端 未结 3 1522
自闭症患者
自闭症患者 2021-02-09 16:27

I am using subdomains to determine the locale in a Rails 4 website. I have this working with a locale switcher exactly the way I want it but now I need to translate the routes a

3条回答
  •  鱼传尺愫
    2021-02-09 17:06

    To translate routes in a Rails 4+ app, take a look at the route_translator gem. It allows translating routes and comes with a number of configuration options, such as adding a locale section to the generated paths, or support for subdomain based app.

提交回复
热议问题