CDRH / orchid

Rails Engine for site integration with CDRH API
MIT License
3 stars 0 forks source link

I18n Links #153

Closed techgique closed 4 years ago

jduss4 commented 4 years ago

In some cases on our site, the param "locale" gets caught up in with other stuff, like in search results. In that case, I am having trouble switching between them...

Example URL from localhost: http://localhost:3000/search?commit=Search+and+Refine&f%5B%5D=language%7Cen&f%5B%5D=creator.name%7CAutobus%2C+Tammy&locale=en&q=hello&sort%5B%5D=relevancy%7Cdesc&utf8=%E2%9C%93

jduss4 commented 4 years ago

Okay, I figured out how this happened. If you go to a search page, make the language non-default (en in this case), then select a filter. Now try to switch back to the default language (es) and you'll notice that things get kinda wonky. I believe it's because the filters themselves are setting the locale incoming, and perhaps that needs to be removed by default when it's like, copying the params or something the way that it probably ditches the action and controller, but I'm not sure. I'd like to find a more permanent solution with the routes so that something like link_to {} on the /search will always go to /search like it used to, rather than possibly going to documents/search like it will currently.