I18N: de-GE isn't accepted as valide Language

Bug #769813 reported by Frank Warius
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
webtrees
Fix Released
Low
fisharebest

Bug Description

Hallo,
IE9 (and IE8?) anwsers 'de-GE' in 'HTTP_ACCEPT_LANGUAGE for Deutsch / Germany. This isn't found in $installed_languages.

There is also a minor bug in I18N, lines 67-71: the gedcom language isn't taken.

Result: en-US is the default language for users which are not logged in and using a IE9 / Germany

regards
Frank

Revision history for this message
fisharebest (fisharebest) wrote :

The correct code for "German, as spoken in Germany" is de-DE, not de-GE.

If it existed at all, de-GE would be the code for "German, as spoken in Georgia".

Revision history for this message
Frank Warius (frank-warius) wrote :

You are Right Greg,

the IE respons is de-DE (sorry for writing the description from teh memory), but the problem still remains.

regrads
Frank

Revision history for this message
fisharebest (fisharebest) wrote :

According to the HTTP specification (RFC2616):

A language range (e.g. "de-DE", specified by the browser) only matches an available language tag (e.g. "de") when the language range is a prefix of the language tag. "de-DE" is NOT a prefix of "de", so it is technically correct that we do not match it.

According the "Best Current Practice" for language tags (BCP47, RFC4646), a language tag should be specified as generally as possible. In other words, you should not specify "de-DE" when "de" would be sufficient.

So - according to the web standards, the browser is wrong to request just "de-DE", and the server is correct not to send a response in "de".

Is this the default setting - or did you manually select "de-DE"?

Revision history for this message
Frank Warius (frank-warius) wrote :

... it's not a bug it's Microsoft ...

it hapend both on a Win 7 x64 DE installation with a very old roming profile and a "clean" one year old Win 2k8 R2 DE server with a "clean" local profile.

I had a look on the IE options an found none. In windows under setup / region & language you find an option for format(Deutschland) and an Option for lokation (Deutschland) and some for keyboard layout (Deutschland / Deutschalnd)

I changed location (to Östereich) and keyboard (to Schweiz / Deutsch) an the repones was still de-DE.

After changing Windows \ Setup \ region and language \ format to "Schweiz / Deutsch" the reponse was "de-CH".

So I think this is a Windows (7?) feature. I had this problem since launching webtreees 1.0 on MS IEs.

Revision history for this message
fisharebest (fisharebest) wrote :

<<it's not a bug it's Microsoft>>

:-)

Changed in webtrees:
assignee: nobody → fisharebest (fisharebest)
status: New → Confirmed
Revision history for this message
ToyGuy (toyguy) wrote :

Needless to say, wherever the fault may lay, don't use IE ;-))
-Stephen

Revision history for this message
kiwi (kiwi3685-deactivatedaccount) wrote :

Greg - presumably this needs to be a "Won't fix" status bug? Shame there isn't a "Can't fix" though.

Revision history for this message
fisharebest (fisharebest) wrote :

I have some ideas for this.

I've been profiling the various initialisation processes, and generating the list of installed languages takes a significant time.

I'm thinking of creating a DB table containing a list of the languages, with their translated names and whether or not they are enabled.

This would:

1) speed up the initialisation, and save perhaps 50ms per page
2) remove the need to delete unwanted languages after every upgrade
3) allow us to remove languages from the menu list, but still allow them to be selected via browser negotiation

Each row in the table would link a language tag to:

1) a translation file (e.g. de.mo)
2) a locale file (e.g. de.xml)

By creating an extra row for "de-DE", with the data as "de", we could acheive this.

BUT, before I can deploy this, I need a reliable way of deploying/upgrading tables of lookup data. The current system works well for adding/changing/delete table *structure*, but not the contents.

Changed in webtrees:
importance: Undecided → Low
status: Confirmed → In Progress
Revision history for this message
fisharebest (fisharebest) wrote :

I have mostly coded a solution for this. It may not be ready for 1.2.5, as it affects a lot of the other language logic.

While researching the problem, I found this:

http://blogs.msdn.com/b/ie/archive/2006/10/17/accept-language-header-for-internet-explorer-7.aspx

It seems that MS was being criticised for ignoring standards and sending just "de-DE" instead of "de-DE,de" right from the start.

Revision history for this message
fisharebest (fisharebest) wrote :

Fix released in 1.3.2

Changed in webtrees:
status: In Progress → Fix Released
Revision history for this message
fisharebest (fisharebest) wrote :

Oops. No it isn't. Comment attached to wrong bug :-(

Changed in webtrees:
status: Fix Released → In Progress
Revision history for this message
Frank Warius (frank-warius) wrote :

I checked http://svn.webtrees.net/demo-svn/ today. It seems to be fixed with 1.4 SVN 14827 on IE 10 Win 8 x64 German.

Thanks
Frank

Revision history for this message
fisharebest (fisharebest) wrote :

Fix released in 1.4.0

Changed in webtrees:
status: In Progress → Fix Released
Revision history for this message
Frank Warius (frank-warius) wrote :

Hi,

i doesn't work in 1.4.0 (update from 1.32) on IE 10 Win 8 x64. If you are not logged in, the page is shown in English and not in German

After arsort You have (foreach (array_keys($prefs2) as $ak) {print "$ak $prefs2[$ak] > $installed_languages[$ak] | ";}

     de_DE 1 > !error! | en_US 0.5 > U.S. English | en 0.3 > !error! | de 0.2 > Deutsch |

so de_DE isn't installed but en_US and is taken.

regards
Frank

Changed in webtrees:
status: Fix Released → Triaged
Revision history for this message
Frank Warius (frank-warius) wrote :

Hi,

in 1.4.1 it's work's.

Thank You

regards
Frank

Revision history for this message
Thomas Weiland (thomas-weiland24) wrote :

Works for me in 1.5.1

Revision history for this message
fisharebest (fisharebest) wrote :

We have a new system for matching HTTP_ACCEPT_LANGUAGE headers, which will convert Microsft "de_DE" to standard "de"

Changed in webtrees:
status: Triaged → Fix Committed
Revision history for this message
fisharebest (fisharebest) wrote :

Fix released in 1.7.0

Changed in webtrees:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.