[openstreetmap/openstreetmap-website] Allow localized & country-specific banners (PR #6851)

Daniele Santini notifications at github.com
Sun Mar 15 17:04:21 UTC 2026


@Danysan1 commented on this pull request.



> @@ -15,7 +15,11 @@ def active_banners
         enddate = nil
       end
 
-      startdate&.future? || enddate&.past?
+      wrong_locale = v[:locales]&.exclude?(I18n.locale.to_s)
+      remote_country = params[:country] || OSM.ip_to_country(request.remote_ip) || Settings.default_legale

Done in b0cb7111ab98873fc2a363d5ba54bb4fb100fbaa ; since removing it introduces the case where the user country is unknown (if maxmind is not configured or it can't find a country for the IP), I added the tests for this case

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6851#discussion_r2937018896
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/6851/review/3950396857 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260315/9c234e6d/attachment.htm>


More information about the rails-dev mailing list