-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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] Flags are country flags, not language flags #12014
Conversation
In some cases they are not even country flags - eg arabic |
That would mean that installing de-CH and fr-CH would also use ch.gif, etc. These images of type xx_xx.gif were created to cope with this issue. As for the flags of type xx.gif, they are here to play their legacy role as, in the past, we did not have so many variations of languages. Arabic indeed is common, as people may use the languagecode plugin to choose various country codes if they wish instead of AA which is not a country code. Then they can make their own flag/image. |
Exactly. Because if we threat them (rightfully) as country flags, it's the only thing that makes sense. And yes it means that you get 4 languages with the same flag. As said the alternative is to create funny flags so you can have unique flags for each language, which doesn't make sense at all.
Yep, understood that. But it fails the same way country flags do.
I would (and do!) use the flags of Germany, France and Italy for that. If I want to use flags. Because there is no Swiss-German or Swiss-French flag 😄
Yeah, and that fails as well because you use the flag of Quebec (afaik) for fr-CA and Canada for en-CA, which is inappropriate as well. The basic misconception here is to use country flags to represent languages to begin with. That doesn't work and shouldn't be done. |
For me this is a very bad idea. In Spain we have 4 different languages and believe me, seeing a common flag will get a lot of people angry. Don't try to apply universal rules based in what you consider better. I would directly remove the flags and show the language code. Isn't that always right? Another option is to create 2 selectors. Users pick country and then the language within that country in a differenr selector enabled after the country has been selected. |
@phproberto isn't that what we have right now?
|
Anyway, this proposal is not B/C at all. Such a huge change, if it is desired by some, would break a lot of stuff. Please do it after my death. Thanks for your attention. |
It seems that we nearly all agree that we should not use flags in a Language context then why trying to find solutions with them? Considering to use the flags, the question (with no truth as answer) will forever be, do we have to consider the location or the language name to determine the flag (considering first like @Bakual said, that we already use the correct flag what is not the case for example for fr-CA, and like @brianteeman said that the flag do exist (the one of the Arab League is the least worse solution)? Anyway, and following @phproberto, this is a real sensitive topic for some, as for example about Catalan or Canadian as even if in the "Province of Québec" they speak French, it is not the same one (Official codification is hardly different) as the Metropolitan one neither the same as in the "Province of Nouveau-Brunswick" where Joomla! requires them to use the flag of................... Québec. |
@MATsxm Joomla doesn't require anyone to use any flag that they don't want
to use.
|
If you wanna play this game you're right Brian, we don't even need Joomla! to build a website... but the thing is the flag for fr-CA that you will find in the Joomla! lib is the one of Québec, neither the French flag, nor the Canadian one and the French spoken is Québec is not the same as in Nouveau-Brunswick. |
What we could do to be perfectly B/C is that we first look if a file with the name xx-YY.gif is present, and if not we revert to the country code. Also keep in mind that this are just the default flags used during installation. Each image can be changed to whatever is preferred. Of course it makes sense to have sensible default values. But as we can see in this discussion for some countries it seems to work with "regional" flags (like Spain) and for others it just doesn't work at all (eg Switzerland). |
Better yet would be not to use any flags anywhere ever |
Not possible in J3, but maybe for J4 😄 |
It is possible. The only place we are forcing the use of flags right now is |
True, in the admin we could remove them easily. But we obviously can't remove them completely as they may be used in frontend by the language switcher (depending on the setting) |
Yes that is an OPTIONAL setting The only place they are forced is in the admin ui - fix that and 99% of |
Totally agree to vanish the icons from the language indication. There are a gazillion UX article that prove coupling a language to a flag is VERY WRONG! |
That should be an easy pr
|
My main concern is that we ship a lot of unneeded and duplicated files. |
We ship quite a few files indeed (some duplicated for legacy purposes) and their weight is ridiculous compared to Joomla as a whole: 64K when zipped; Yes, we are forced to use a new icon for each new language. Not a big deal imho. We do indeed have more than for tiny js lang files (179k when zipped) but equal to what we will need for the new bootstrap calendar as these are based on the language tag. |
It's not about size, it's about the amount. For the user it gives a huge dropdown list and for the maintainer (me in that case) it's also not optimal, especially if we could clean it up at least for new installs (no legacy purpose here).
The point is, nobody will like that. Because in Switzerland nobody uses a Swiss flag in any form to represent a language. What would be wrong with taking the ch.gif (and dropping the de-CH.gif file) for this case and similar ones? And just creating a language specific flag where it is appropriate? I don't see the issue with that approach and it would reduce the list of images and the maintainer job quite a bit. |
Just to provide context to the decision: What are other projects doing to solve this matter? I have done a quick check on known operating systems and they seem to avoid using flags, and using text instead describing language & country. In MacOS they don't even use the word "Country" but "Region" witch is more flexible. Still we can't disagree with @infograf768 that is an image is worth a thousands words, and they and are much more meaningful that language ISO codes. If at least we can provide flexibility, then we are good. Is common that users hack some icons and flags to adapt them to their feelings. Our goal should be to have a system flexible enough to cover all the cases that we can think on. I mean allowing to optionally use flags or no, allow to language packages to adapt the way icon are selected... |
So I've changed the logic now to first look if a language specific "flag" (or icon, if you want so) exists. If it does this will be used. If not, it will look for a country flag and use that one. I also removed all unneeded files and renamed some:
The deleted and renamed files were put into a README file so we don't add files with the same name in future (and thus overwrite existing ones on user sites). |
I totally agree with JM |
this should never be merged in the 3.x series, period. |
@Bakual Been interesting to follow this PR and discussion. Just tested the latest patch on latest staging, which seem to result in respecting b/c by using the images already available, and show those flags in the content language list. Your concept of relating flags to countries is valid and correct. As Mat suggest it is important to also use correct flag in core. Should users wish to use a flag not official for the country it has to be their own choice, and they can select/enter as they always could. Easier maintenance for you and team, better quality of core provided language defaults, and b/c, then it should be an easy call. |
I haven't touched anything related to the native title. You're sure that behaviour is new with this PR? That's strange.
@infograf768 With all respect, but why? It's completely B/C and respects the concerns you raised. |
Sorry, but I totally disagree on this urban legend of the past. And even if, this does not justify the use of wrong flags, nor to create hybrids that make no sense. https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=use%20flag%20language and so many others... |
@Bakual You´re right. Those native titles issues are not related to this PR, also happens without the patch. |
as long as we have images for languages then we cant move on |
@wilsonge Can you make a decision here if this should be continued or not? |
@marcodings @HLeithner can you give feedback here please as you build more multilang sites than i do |
That doesnt work as explained by several nationalities The easiest way to stop repeating the fake connection between an image and a language is to stop setting a flag at all. The field (and standard flags) can still be included in joomla so a user can chose one of those if they want but we simply stop using these incorrect and/or fake flags by default |
If you ship them, you need a way to assign them to a language. Otherwise it's useless to ship them as they can't be used without modification of the code. Anyway this PR doesn't try to solve this issue. All it does is that it reduces the amount of flags due to duplicates. And it names them correctly to the country code instead of a language code. |
I'm in favor for it, I normally create German language sites with an Austrian flag and have a English Version with the British flag. I would also like to see svg files instead of the gif files (even if they might be bigger the scale). But iirc it's not possible to select the Austrian "language" with the german language pack as fallback (but this was sometime ago don't know if this have changed). Also my last try to use /de-de/ and /de-at/ as urls didn't worked that was also a long time ago. So basically it's wrong to use country flags as language symbol but we don't have any other symbol so it's ok for me and many people on the web... |
You can. In the content language you can select whatever flag you want. |
Let me repeat here again:
In admin, user is now getting : Icon Selected No icon selected The possibility using or not icons is present in mod_languages and has been for ages... |
I agree with you. Let the user ADD an icon if they want to |
This PR goes the other way around and kills the fr-fr.gif and keeps the fr.gif. But it still allows to use eg a fr-ca.gif. The lookup order is first "xx-xx.gif" and second "xx.gif. Thus it's fully backward compatible and still reduce the amount of icons while naming them appropriately (as country flag).
As long as we have that parameter in the content language and we also ship the flag icons, it doesn't make sense to NOT populate the parameter and force the user to ADD it. |
It just perpetuates the bad practice of associating a language with a country |
Then do an own PR to remove the flags and the parameters in the language switcher and content language. As those are the real source of the bad practice. Honestly I'm surprised how much discussion and time (over 3 years now!) that requires to do such a simple change. |
@Bakual fix conflicts. Talked with @rdeutz and he also agrees with this PR (as well as @HLeithner ). So I'll get this merged. Having said that in a future PR (not this one) if we could find SVG icons instead of these GIFs that would also be excellent for looking forward |
If people want to change the default settings on whether to use flags or not I'd also be open to a Pull Request where that discussion can play out. |
I tried to do a a merge but it's to many conflicts since some icons got changed and the whole thing moved to a different place. So I will redo the PR in a new one and reference it. |
Thankyou! |
See #28575 |
During the Joomla installation, there is an option to automatically create a multilingual site with the content languages already created. That is awesome.
However the logic for the language flags applied there is no proper logic at all: The issue is that there exists no language flags, they are country (or district) flags.
When a new official language is created by our translation teams, we manually have to upload a new image matching the new language code. For the german dialects this was done recently in a PR (see #11868).
Summary of Changes
This PR suggest to change the logic and assign the flags based on the country code in our language codes. Eg for de-CH (Swiss German) it would take the image
ch.gif
instead ofde-ch.gif
.To be backward compatible it will first look for an existing file with the language code and fall back to the country code.
This PR also removes all unneeded files and renames some:
The deleted and renamed files are put into a README file so we don't add files with the same name in future (and thus overwrite existing ones on user sites).
Known issue
The limitation here is that the languages for multilingual countries like Switzerland (in theory de-CH, fr-CH, it-CH and rm-CH) would share the same flag. The alternative is to create ugly, arbitary flags like https://github.com/joomla/joomla-cms/blob/staging/media/mod_languages/images/de_ch.gif so you get different flags for each language.
We would also have to update the images we ship to make sure the folder contains all country flags. Currently, it is a mix between flags named after a language (egAlready done now.en-gif
for en-GB) and country (egus.gif
orch.gif
), plus a flag for each language code (en-GB.gif
anden-US.gif
). So we have a lot of duplicate and inconsistently named files here (see https://github.com/joomla/joomla-cms/tree/staging/media/mod_languages/images).Testing Instructions
Documentation Changes Required
None that I am aware of.