Closed Bug 402821 Opened 17 years ago Closed 16 years ago

Use apache rules instead of symlinks for language fallback

Categories

(www.mozilla.org :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: clouserw, Assigned: clouserw)

References

Details

Attachments

(1 file)

On mozilla.com, the following locales:

'en','es','no','pt','sv'

are using symlinks to fallback to other locales.  We should be using apache redirects so applications looking at the filesystem don't think those directories actually exist.  This should also fix problems like bug 399106 since we'll be redirecting instead of rewriting.
Sounds good to me.
I saw we were already doing a similar thing with ja-JP-mac -> ja, so instead of using apache I just tweaked the prefetch script.  The patch doesn't remove the symlinks, but after applying it you should be able to remove them with no problems.

Requesting review from anyone.

Also the stat-keepers will be happy with this since people will actually get redirected when going to the mapped languages instead of just being shown the content.
Assignee: nobody → clouserw
Status: NEW → ASSIGNED
Attachment #297254 - Flags: review?
Added some people who have asked me about en vs. en-US in the stats before to keep them in the loop.
It would be great to have this change in ... would make our stats more consistent. 
Attachment #297254 - Flags: review? → review?(reed)
Comment on attachment 297254 [details] [diff] [review]
Add logic for redirection of locales

...
>+/**
>+ * If we support a locale but want to redirect it to another, add it to this array.
>+ * Format:
>+ *      lower(requested_language) => mapped_language
>+ */
...
>+// If we're remapping the language to another
>+if (array_key_exists(strtolower($lang), $lang_remap)) {
>+    $lang = $lang_remap[strtolower($lang)];
> }

So, the patch as a whole is fine and will work, but I just find it somewhat odd how you're dealing with case in both the $lang_remap and in the above code. Could you give me an explanation as to why you're doing it this way? Just something seems off about it in how you have some stuff as lowercase while other stuff as the correct case. If there's a real need for all this case swapping, then that's fine, but it just seems fragile from a general overlook perspective. r=me with your reasoning. :)
Attachment #297254 - Flags: review?(reed) → review+
Everything is being lowercased while we're trying to detect what language to use, since there's no guarantee a browser won't send "en-uS".  At the end of the detection we make the format xx-YY (with correct case) and check if it's valid, if it is, we use it from there on.  Does that make sense?
This is live in r11627
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Component: www.mozilla.org/firefox → www.mozilla.org
Component: www.mozilla.org → General
Product: Websites → www.mozilla.org
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: