Skip to content
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

[5.2]Wrong locale on installation #44667

Open
dautrich opened this issue Dec 26, 2024 · 32 comments
Open

[5.2]Wrong locale on installation #44667

dautrich opened this issue Dec 26, 2024 · 32 comments

Comments

@dautrich
Copy link

dautrich commented Dec 26, 2024

Steps to reproduce the issue

  1. Make sure your Windows and your browser are set to locale “Deutschland” (or de-DE, where applicable).
  2. Try to install a J5 version, i. e. 5.2.2

Expected result

The installation language is displayed as “German (Germany) | Deutsch (Deutschland)”.

Actual result

The installation language is displayed as “German (Austria) | Deutsch (Österreich)”.

Image

System information (as much as possible)

Windows 11 (Home or Pro)
Firefox 133.0.3 (or earlier) or Microsoft Edge 131.0.2903.112 (or earlier)

Additional comments

No issue with Google Chrome (tested on 131.0.6778.205)

I have seen set since the first J5 releases and already had a discussion with @tecpromotion about that topic in February 2024.

@tecpromotion
Copy link
Contributor

Sorry but I can't reproduce this in my local test environment with 5.2.3 RC 1.
It works as expected here.

Tested with Chrome, Firefox and Safari.

@fgsw
Copy link

fgsw commented Dec 26, 2024

Can't confirm too (Mac, Firefox).

@brianteeman
Copy link
Contributor

@tecpromotion I assume as you tested with safari that you are like @fgsw testing on a Mac and not the reported issue on Windows

@tecpromotion
Copy link
Contributor

That's right. But I have already written to Rolf. We will try to reproduce this in the German-speaking community. Maybe we'll find out something.

@richard67
Copy link
Member

@dautrich @tecpromotion @fgsw Could you inspect the request header for the "GET" request in the network traffic analysis of your browser's developer tools?

There should be an Accept-Language header.

See e.g. screenshot from my browser (German Firefox latest version on Windows):

Image

In my case the value is de-DE,de;q=0.8,en-US;q=0.5,en;q=0.3, and I cannot reproduce the issue on a current 5.2-dev branch.

You can test that with any GET request to any (valid) URL.

Please check and report back your values for that Accept-Language header.

@richard67
Copy link
Member

Same result (issue not reproduced) with Chrome, however with a different value for the header, compared to Firefox:
Image

And same (issue not reproduced with different header compared to Firefox or Chrome) with Edge:
Image

@fgsw
Copy link

fgsw commented Dec 26, 2024

@richard67 Firefox is set to English, for this test preferred Language on "German [de]", give:

Image

@richard67
Copy link
Member

@fgsw Hmm, so in your case it finds the right language even if your header has no "de-DE", only "de". The ordering of the list field in the form is so that "de-AT" comes before "de-DE", so it seems in your case it does not just pick the first "de-something" which it can find. Strange. So we have to wait what @dautrich reports for the case in which he can reproduce the issue.

@dautrich
Copy link
Author

Accept-Language | de,en-US;q=0.7,en;q=0.3

Screenshot from my Firefox:
Image

@dautrich
Copy link
Author

Microsoft Edge: accept-language: de,de-DE;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6

Image

@richard67
Copy link
Member

@dautrich So in your case as well as in @fgsw 's you don't have a "de-DE", only "de", but in opposite to him you have "en-US".

What happens if you either modify the header in the developer tools or if you change the settings as shown in following screenshots?

Image

Image

I think in your case the one at the top is missing. But you can add it and move it to the top with that dialogue.

@dautrich
Copy link
Author

dautrich commented Dec 26, 2024

That does the trick: I get
Accept-Language | de-DE,de;q=0.8,en-US;q=0.5,en;q=0.3
resulting in that:

Image

@richard67
Copy link
Member

So that is at least a feasible workaround. If we have an issue or not I don’t really know. But it seems weird to me that in your case with the issue de-AT was used and in @fgsw ‘s case de-DE.

It would need to check the code to see how it works.

@richard67
Copy link
Member

P.S. I don’t really remember if the de-DE language was in my Firefox settings by default or if I once had added it myself.

@dautrich
Copy link
Author

dautrich commented Dec 26, 2024

The same mechanism works in Microsoft Edge.
When I move "Deutsch (Deutschland)" to the top of the list, I get my preferred language setting:

Image

@dautrich
Copy link
Author

@richard67 Would it be possible to default to "Deutsch (Deutschland)", if the first language in the Accept-Language list is "de"?

@richard67
Copy link
Member

richard67 commented Dec 26, 2024

The same mechanism works in Microsoft Edge. When I move "Deutsch (Deutschland)" to the top of the list, I get my preferred language setting:

That’s what I would expect.

But the question is what shall happen if only de is given and not de-DE:

Shall it take the first de-something which it can find in alphabetical order? Then it would be de-AT.

Or shall it take the primary country associated with a particular language? That would be de-DE in case of German, and for English orbother languages it would be debatable, and that would require a list of what is the primary country for each language.

@richard67
Copy link
Member

richard67 commented Dec 26, 2024

@richard67 Would it be possible to default to "Deutsch (Deutschland)", if the first language in the Accept-Language list is "de"?

That would require some kind of a hard-coded list to define the primary country (or language with country) for each language in the one or the other way (associated list or just list of preferred language-country code).

And e.g. in case of English, where in opposite to German the country with the most speakers is not the same as the country where the language comes from, it would be debatable if GB or US should be the country.

But I agree that it would be more understandable if it was either the country with the most speakers or the country where the language origins instead of just picking the first alphabetical match like de-AT in case if only de is given, or en-AU if only en is given in the header.

@dautrich
Copy link
Author

IMHO, there are two aspects:

  1. Is it technically possible (with not too much effort) to set a "default" language for those ambiguous cases (as far as I can see: Dutch, English, French, German, Portuguese)?
  2. If technically possible: Who is to decide for the default setting. The Languages Team?

@richard67
Copy link
Member

Sure it is technically possible. So 2. is the interesting question: Who decides?

@tecpromotion
Copy link
Contributor

Chrome on Mac
Image

Safari on Mac
Image

Firefox on Mac
Image

@richard67
Copy link
Member

In case of English, most software I know uses US as default because that has meanwhile become the new standard in English lessons in the world and has more speakers, as it seems. In my school days Oxford English was the standard.

But as we use en-GB as default CMS language, I would suggest to default to en-GB to be consistent with that and not to en-US, if we decide to implement a solution.

@richard67
Copy link
Member

richard67 commented Dec 26, 2024

as far as I can see: Dutch, English, French, German, Portuguese

No, that does not cover all cases. A solution should cover all possible codes available in standards, so I does not need to update it whenever a new language is added to the CMS.

For example Farsi is spoken in Iran and in Pakistan, Urdu is spoken in Pakistan and I think also in parts of Afghanistan, Hindi and Tamil are spoken not only in India, and so on.

@brianteeman
Copy link
Contributor

The same mechanism works in Microsoft Edge. When I move "Deutsch (Deutschland)" to the top of the list, I get my preferred language setting:

Image

So the joomla code is working exactly as intended

@fgsw
Copy link

fgsw commented Dec 27, 2024

So the joomla code is working exactly as intended

Also my opinion, so i would move this thread to "Discussions".

@richard67 If for Example "German [de]" is set as preferred Language, i suggest a "easy as possible" solution which seems the alphabetic ordering.

@chmst
Copy link
Contributor

chmst commented Dec 27, 2024

Other question: This affects only the installation process, nothing else.
I could not find any words in the de-AT version which I could not understand during the installation. This probably is also for other languanges (en-.. ).
So why should we make efforts here?

@richard67
Copy link
Member

Well, I'm ok with leaving it as it is. My above comments were just for the case that there is common sense to do something.

@dautrich Ok to close the issue as expected behaviour?

@dautrich
Copy link
Author

In principle, I agree to @chmst's post. However, it's a bit strange for a Joomla user to be offered a (for him) wrong locale at his very first contact with his new Joomla site.
Could we just add a note to the installation screen? Something like: “In case you're offered a wrong region setting for your language, that is caused by your browser's settings.”, together with a link to a page with some more explanations (i.e. using screenshots like above) on the Joomla site.

And @richard67: I'm okay with defining that as expected behavior. We now know the reason for this effect and how to cope with it.

@fgsw
Copy link

fgsw commented Dec 28, 2024

Could we just add a note to the installation screen?

Please don't clutter the installation pages.

If you wan't add a note on Docs: Installing Joomla in the second Paragraph:

Joomla will try to identify the Select Language field automatically from your browser's language. You can change this if needed.

@dautrich
Copy link
Author

Please don't clutter the installation pages.

That obviously is a good statement from the technical point of view. But my point is about psychology: Think about a newbie at his first Joomla installation. The very first thing he/she sees may be a "wrong" locale identification. This won't increase the user's confidence in the new software. That's why I would like to have a remark on the installation page. You and I will simply ignore the message.

@chmst
Copy link
Contributor

chmst commented Dec 28, 2024

Why not replace the de-AT by either simple "de" or even better "German"?

@fgsw
Copy link

fgsw commented Dec 28, 2024

Why not replace the de-AT by either simple "de" or even better "German"?

Good Solution cause it solves another issue too:
If a user wan't to have a site in "Portuguese" but not for a specific country he have to choose a country like "Portugal" or "Brazil" with a country flag (if he hide the country-flags Joomla shows in article "pt-PT" or "pt-BR").

@chmst chmst added the Feature label Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants