Showing flag instead of language name in navbar #3653
Replies: 2 comments 4 replies
-
I'd add |
Beta Was this translation helpful? Give feedback.
-
Doing it via JS is bad for the aesthetics, since the flags will flash when someone reloads the page or follows a link. If you want to avoid modifying templates (which is IMO the best way to achieve this), a good alternative might be CSS. Assuming your images are 20x20 PNGs:
For SVGs, this might just work, or you might need to do some adjustments to the background positioning/repeating/scaling CSS properties (those are best figured out interactively with the web inspector, since it depends on how your images are set up). Same goes for raster images larger than the size specified in your CSS. Alternatively, if you want to have both the flag and the language name, you can also figure out something with If you want only the flags, you’d need to add title text to the |
Beta Was this translation helpful? Give feedback.
-
I was able to show flags without modifying templates using the following one-liner in
BODY_END
. Perhaps someone has something shorter/nicer or more elegant? The images need to be placed infiles/img/lang/en.svg
for all languages used.Beta Was this translation helpful? Give feedback.
All reactions