-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.0][RFC] svg icons instead of the ugly gif #21410
[4.0][RFC] svg icons instead of the ugly gif #21410
Conversation
As these are not languages flags but country flags (correctly) maybe the element should have a more appropriate name |
at Tester: this Pull Request need npm, it can't be tested by Patchtester. |
It seams that the images get loaded from a remote site on visit? If so can we plz ship it with joomla? |
Switcher: Content languages image select not taken into account any more. Try to use ta for example which is a custom gif made specially to not represent a specific country. Basically imho a wrong good idea. |
So lets ship those ugly gifs ? |
Makes sense |
That's the idea, if you see the code there is a todo for this: |
From an a11y perspective you now have an "image" as a link with no description of the link. Which means that a screen reader can only announce the link and not the meaning of the link |
👎 for CE. |
Can I ask why? |
why would a gif be crappy? Because they are 10 years (or more) old ? if anything that was 10 years old was crappy, we are all crappy here... 😸 serious. switching to that type of svg (depending on lang country code) just prevents to add custom images when we (or an admin) need it. The example above with tamil is clear enough. Esperanto would be another one I guess. And maybe others too as i did not test all situations (like swahili). Another interesting aspect to consider (and maybe unrelated to this) is the fact that media is now compiled by npm. How would someone add/change svg in one’s site only. |
I see two issue here, how it can be improved:
|
True, but then we miss the lazyloading feature that JS gives us :) This was done like this for performance (eg take all the images out of the critical path!!!)
Crappy because gifs are not vector images, eg you will never be able to scale up a gif (especially those Joomla provides for the languages) without bad results...
Wrong
The same way they do in J3, by creating a file in template/image (this is not implemented as this is an RFC but I don't mean to break the known patterns here) |
If we talk about Performance it would be better if the flag is embeded instead of lazy loaded. Most? flags only have 300bytes uncompressed. A tcp connection with a new request could be very expensive. |
Definitely need to see some stats to back up the performance gain |
I like the svg images but see no need for js here. |
You don't have to if you understand the basics of how browsers work:
So what is different here? |
That idea was turned down by the release leader: joomla/40-backend-template#441 but I guess someone else can pursue that path. After years of me trying to replace the gifs with svgs, I still see strong opposition therefore I'm gonna close this PR. Personally, I probably can do whatever I need in my websites, it's just that one more module out of the box is useless for anyone that wants to deliver a half-decent website... |
I'm not against svg I would really see it in joomla. I personally don't want that the cms requires JS in frontend for so basic things like showing an image. |
My problem with this solution is that it is not adapted to all the languages we have (in 3.x) as it does not take into account special cases. |
@infograf768 that is a problem that designers should take care. I tried to do the heavy lifting here
Right, so what happens if you zoom in... |
I don't have an issue with SVGs as well. This PR however is bad for various things. As a starter it doesn't solve a single thing but tries instead to do multiple stuff. As you see in the comments, the questions come from various points. One thing is changing a simple dropdown to a webcomponent, another thing is changing gifs to svgs. And last but not least it broke several other places where those gifs were also used. Using SVGs for those flags is a very old topic. You already suggested it in #12014. It doesn't seem to be such an important topic given said PR is still open (for almost two years now). |
First and foremost this will be changed to a web component one way or another because J4 will not ship with bbootstrap.js in the core. But I didn't touch the dropdown so this is false...
This is an RFC. It wasn't meant to be a complete solution... |
|
off topic: use flag of Earth https://en.wikipedia.org/wiki/File:Flag_of_Earth.svg 😃 |
The only sensible option from my perspective is to stop trying to use a country flag to represent language and drop the images all together |
you only changed the frontend and there is no bootstrap if I check this correctly don't we have flags in the backend too?
And the flags are ok because we have flags for each language flavor |
Actually, I think that should be left to the site integrator to decide. As long as it is optional, all is fine for me. |
As soon as it becomes anything more complex than a simple |
But it is still semantically incorrect to align a flag, which is generally a representation of a nation or state, to a language or locale code. That is the issue with the way the images are currently defined. |
Module "Language Switcher" should display language names as default. |
"generally" is the key word here. It is already possible, in the switcher as well as in back-end by defining no flag for the Content. Language. |
|
Either way, as soon as a native HTML element requires JavaScript enhancement (be it Bootstrap Dropdown, Semantic UI Dropdown, Chosen, or one of the other 42975 packages that do that), it should be made a custom element in the context of a CMS' environment (no, if I ever built a language switcher capability into my Symfony or Laravel apps would I make it a custom element because I probably wouldn't design something that calls for JavaScript enhancement in the first place and even if that were the case I'd simply be re-using assets that already exist, performance and critical rendering path be damned). Otherwise you are left with vendor lock-in in that particular layout with the tool forcibly loading the assets of whatever enhancer is in use, and whatever dependencies come with it. |
The main point is that languages do not officially have a flag associated with them. So no matter how you phrase it, semantically it is not 100% correct to associate any language with any flag. It works for the majority of cases because a vast majority of languages have origins that align with a particular country or region. And yes, we as a project can be opinionated as to whether out-of-the-box we will support display of flags as representations of languages. Nothing stops anyone who wants that type of display from creating it for their sites, but nothing says we have to support it ourselves either. Although once something has landed in Joomla it takes a miracle to remove it, so I guess we're stuck now, even if there were a majority consensus that this doesn't need to be a core feature. |
Some things can be changed and using a country symbol to indicate a language is not only incorrect semantically but creates all sorts of issues that we have to invent solutions for. If using text etc is good enough for the UN, BBC, Facebook, Twitter etc then it should be good enough for joomla core. |
@brianteeman Just wondering: If it's completely optional and disabled by default, do you still have an issue with it? Because I think that could be done easily. |
that is better than the current status quo but i still say it is wrong. As a swiss citizen you should understand |
As a Swiss, I know the Swiss flag can't be used as a language flag since there is no "Swiss" language. And the funny "flag" we created for de-CH is an even worse idea. |
It is easy to modify our sql to not set an image for en-GB. @dgrammatiko As I wrote above, we will need to make specific generic svg icons for Esperanto or Tamil for example. |
That was my intention, this was just an RFC, there is a comment in the code denoting exactly that, but I didn't want to spend much time here, just showcase the proof of concept.
Well, this can be done in such a way that we can retain B/C The point is what other mentioned above and I totally agree: don't use icons AT ALL for the languages! |
Is it really a good idea to force lazyloading without an option to disable it? Should be done through a plugin, IMO. |
@SharkyKZ lazyloading is the defacto best practice for anyone that builds modern websites. I see no reason why someone will not want to lazy load any asset... |
Gif in Language switch is an ugly thing from the past. For example we have in our site this override of mod_languages:
|
Pull Request for Issue # .
Summary of Changes
A dead simple custom element that converts a country code (eg gb) to a flag.
Accepts:
Testing Instructions
Enable multilingual, etc, check the flag...
Expected result
Actual result
Documentation Changes Required