Closed Bug 634705 Opened 14 years ago Closed 1 year ago

Don't use default system accept-language list

Categories

(Camino Graveyard :: OS Integration, defect)

All
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: stuart.morgan+bugzilla, Assigned: stuart.morgan+bugzilla)

Details

Attachments

(1 file, 1 obsolete file)

A thought for making the stupid eBay bug go away in the common case: What if we checked the OS's list against a hard-coded copy of the default list (or at least some set of signals from that list) and if it's the default, only use the first entry (à la Safari). That would "fix" eBay for the common case of users who have never changed the list, without regressing the feature of using the list when a user has actually set it up. The only possible issues I see are: 1) If someone miraculously wanted the same list as the default, it wouldn't work. In the wildly unlikely event that ever happens though, they can just make some trivial order change near the end of the list 2) If Apple changes the default list, it will stop working (similarly if someone has an old list carried forward by migrations). That's no worse than the current situation though. Thoughts?
Given that we already munge the list to remove n>10, I think this seems reasonable—with the caveat that it's only going to help US users (unless someone is willing to init a Mac in all of the available languages and see what the default list looks like in all of those cases and we construct a more complex check). (In reply to comment #0) > 1) If someone miraculously wanted the same list as the default, it wouldn't > work. In the wildly unlikely event that ever happens though, they can just make > some trivial order change near the end of the list These users can also use the override pref. > 2) If Apple changes the default list, it will stop working (similarly if > someone has an old list carried forward by migrations). That's no worse than > the current situation though. We'd want to fix the code if the list changes in, say, 10.7, to also check that new default list, of course.
[4:44pm] ardissone: smorgan: did you want to take Bug 634705 - Don't use default system accept-language list for 2.1? [4:45pm] smorgan: Sure, I'll try to come up with a heuristic (or just hard-code the list) [4:45pm] ardissone: ok
Status: UNCONFIRMED → NEW
Ever confirmed: true
Target Milestone: --- → Camino2.1
Attached patch fix (obsolete) — Splinter Review
Hard-coding the list turned out to be easiest. This uses the 10.6 defaults list, and I'm not sure how often it's changed. If someone wants to get the 10.5 and/or 10.4 lists I can add those too, but this is better than nothing. I also did some refactoring, and per irc discussion changed the failure mode for an unrecognized language to take everything before it (as originally planned in the original bug; Smokey and I disagreed with the old conclusion of throwing away everything instead--although as we discussed, it's unlikely that more than a negligible number of users have a mix of new and old codes). I banged on this some, but another sanity check wouldn't hurt.
Assignee: nobody → stuart.morgan+bugzilla
Attachment #516184 - Flags: feedback?(alqahira)
Whoops, forget to cut out the changes I had in my tree from the source-limiting bug.
Attachment #516184 - Attachment is obsolete: true
Attachment #516186 - Flags: feedback?(alqahira)
Attachment #516184 - Flags: feedback?(alqahira)
Comment on attachment 516186 [details] [diff] [review] fix (without other changes) Some preliminary comments: > // These are the 10.6 defaults for a new user. Can you add "English" again here; you do mention English systems 600+ lines above, but it'd be good to make it clear again here. Also, those are the 10.5 defaults, too (and, probably, the new-Macs-late-10.4-with-Russian-etc default). Early-10.4 appears to be en, ja, fr, de, es, it, nl, sv, nb, da, fi, pt, "zh-Hans", "zh-Hant", ko (according to cb-xserve01), so we can probably handle that, too, but the current code should handle the majority of our default-list-English users. However, that said… Both philippe and I couldn't get this patch to work on a fresh user account (him 10.6, me 10.5). I eventually got it working by some combination of logging out/back in, adding an NSLog statement for the languages array, and the opening International prefPane; not sure what made it work. (By not work, we both got the current behavior of "en-us followed by the top 9 items in the default list".) Things I haven't tested but intend to test: * Throwing some garbage values into the AppleLanguages via the command-line, to exercise the changes to that code.
I'd like to get this working since it's so close, but it's not important for 2.1.
Target Milestone: Camino2.1 → ---
Flags: camino2.1.2?
Flags: camino2.1.1?
Flags: camino2.1.1-
Comment on attachment 516186 [details] [diff] [review] fix (without other changes) f- to get this out of my queue ;-) because of this part of comment 5: > Both philippe and I couldn't get this patch to work on a fresh user account > (him 10.6, me 10.5). I eventually got it working by some combination of > logging out/back in, adding an NSLog statement for the languages array, and the > opening International prefPane; not sure what made it work. (By not work, we > both got the current behavior of "en-us followed by the top 9 items in the > default list".)
Attachment #516186 - Flags: feedback?(alqahira) → feedback-
Also http://lists.apple.com/archives/Applescript-users/2004/Jul/msg00620.html seems to imply that, back in 2004, absent any change from the "shadow" global defaults, AppleLanguages and AppleLocale will not return anything. Other interesting tidbit from that sprawling thread: supposedly /var/log/CDIS.custom is the language that you pick in the initial setup of the new Mac. The file's creation date appears to correspond within minutes to the creation date of the user folder of the first account on my Dad's iMac (created on 10.5) and within a few days(!) to the creation dates of my user folders on my MBP (created on 10.4) and my PBG3 (created on 10.2). These are obviously all "English" (10.2, 10.5) or "en" (10.4) here, though, so I can't confirm beyond that.
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: