openstreetmap-website icon indicating copy to clipboard operation
openstreetmap-website copied to clipboard

Banners in different languages

Open Robot8A opened this issue 2 months ago • 5 comments

Problem

Currently, banners are PNG images that are shown to every OpenStreetMap website user equally, and are usually in English. Should we add an option for banners in different languages be shown, depending on the user language on the website? With next year's SotM being held in two languages, or the possibility of running fundraising campaigns as a global project, I think that we have enough reasons to think that we should do more for non-English speakers. In case the maintainers think this is a good idea, should it be implemented with localized .PNGs, or should we go for .SVGs that can change the text depending on the language?

Description

No response

Screenshots

No response

Robot8A avatar Nov 03 '25 18:11 Robot8A

My gut feeling is that there isn't much benefit to using an SVG here. It would be cool to have the text adapt, but it may come with some downsides. For example the SVG would need to be stored as a template (as opposed to an asset) and processed by Rails adding a slight impact to response time (although this could be cached).

As for PNG, I'm not seeing support for alternative languages for banners, but it should be possible to add it. I say "should" because my knowledge of I18n is a bit lacking 😅 I want to think that if banners are declared for specific languages it'll be possible to select the right one given the user locale. Maintainers may be able to provide insight. I can play with it a bit if they think it's worth it.

pablobm avatar Nov 06 '25 11:11 pablobm

I think it would be good to hear from the people making banners. Would they submit multiple PNGs in different languages?

pnorman avatar Nov 06 '25 18:11 pnorman

For example the SVG would need to be stored as a template (as opposed to an asset) and processed by Rails adding a slight impact to response time (although this could be cached).

If we're happy with it working independently of the OSM user language settings, using an asset with <switch> elements could be a solution without overhead.

hlfan avatar Nov 07 '25 11:11 hlfan

using an asset with elements could be a solution without overhead.

TIL thanks for that.

The problem is that not many designers create svg files which are editable like that.

HolgerJeromin avatar Nov 07 '25 21:11 HolgerJeromin

SVGs can also have <image> elements to have the textless banner as a PNG behind localized text. The font might be a concern.

hlfan avatar Nov 07 '25 22:11 hlfan