Language variation change in CVS by Vic D'Elefant

Discussion of general topics related to the new version and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Forum rules
Discussion of general topics related to the new release and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Post Reply
User avatar
GPHemsley
Registered User
Posts: 1617
Joined: Fri Apr 18, 2003 4:01 am
Location: Long Beach, NY
Contact:

Language variation change in CVS by Vic D'Elefant

Post by GPHemsley » Mon Jan 07, 2008 4:39 pm

Log Message wrote:Fixed a problem caused by "-x-" variations of a translation, such as fr-x-strict and de-x-sie. We're now sending the main language code to the output so it will at least be a valid language code
New Code, includes/functions.php wrote:

Code: Select all

       // Send a proper content-language to the output
       $user_lang = $user->lang['USER_LANG'];
       if (strpos($user_lang, '-x-') !== false)
       {
           $user_lang = substr($user_lang, 0, strpos($user_lang, '-x-'));
       }
I was just curious as to what the logic was behind this change (in both the 3.0.x branch and HEAD), given that x subtags (e.g. the aforementioned "fr-x-strict" and "de-x-sie"), while not registered, are, in fact, valid language codes as per RFC 3066 (the latest Best Common Practice). "x" subtags are for private use.

(Note: I did not [yet] research to see if registered alternatives are available for the aforementioned language codes.)

User avatar
Acyd Burn
Posts: 1838
Joined: Tue Oct 08, 2002 5:18 pm
Location: Behind You
Contact:

Re: Language variation change in CVS by Vic D'Elefant

Post by Acyd Burn » Tue Jan 08, 2008 9:25 am

x-variants are correct, indeed. But it is also used for the language meta tag - where it is not "correct", confusing bots, etc.

Image

Post Reply