RefugeRestrooms / refugerestrooms

REFUGE restrooms indexes and maps safe restroom locations for trans, intersex, and gender nonconforming individuals.
http://www.refugerestrooms.org
GNU Affero General Public License v3.0
888 stars 262 forks source link

Add a locale switcher, second try #656

Open DeeDeeG opened 3 years ago

DeeDeeG commented 3 years ago

Context

Summary of Changes

Checklist

Screenshots

Before

Refuge Restrooms website footer with GitHub, Twitter, Facebook and "Contact us" links, GitHub blurb with link, Patreon blurb with link, and copyleft notice

After

Refuge Restrooms footer, with all of the above, and now with links to all locales at the bottom (English, Español, Filipino/Tagalog, Français, हिन्दी, Italiano, polski, and Português do Brasil)

DeeDeeG commented 3 years ago

Hi @brunoocasali, I hope you are doing well.

I've been working on finishing the locale switcher feature for Refuge Restrooms. I think it's ready now!

If you are interested in helping with adding tests for locales other than English, I think this could be a reasonable place to do that. It would, of course, be much appreciated.

Best Regards,

- DeeDeeG

DeeDeeG commented 3 years ago

@brunoocasali I added the changes you suggested, matching the Rubocop-linted style.

During testing, I found out that there is a problem still. Might you be able to help troubleshoot this?

When starting a new search for restrooms using the search bar, the locale parameter is not preserved. It appears to me that the search results page is generated only with the following parameters (with the example search "San Francisco").

/restrooms?utf8=✓&lat=37.7749295&long=-122.4194155&search=san+francisco

But no locale parameter.

It's not immediately clear to me how these parameters are generated, as I'm not familiar with that part of the codebase. (I suspect it might be part of Refuge Restrooms' JavaScript code, but I'm not sure.) If I knew where these were generated, then perhaps it would be easier to ensure the locale parameter was preserved there, too, if set.

brunoocasali commented 3 years ago

@DeeDeeG I could help you with this tomorrow, okay? :)

DeeDeeG commented 3 years ago

That would be great!

I'm getting more confident that it's in app/javascript/packs/lib/ --> geocoder.js or maps.js.erb. Not totally sure, though.

brunoocasali commented 3 years ago

@DeeDeeG checkout the #657 ;)

DeeDeeG commented 3 years ago

Thanks for reviewing/merging #657, @tkwidmer.

I think the last thing for me to do on this is to check the "new restroom" submission process works properly with these locale switchers. I would like to do the dependency bumps first and get those out as a patch release.