On Thu, Jul 3, 2014 at 4:39 PM, Brion Vibber <bvibber@wikimedia.org> wrote:
I don't see any special handling for variants in the old PhoneGap app... It's possible that the web browser engine's XMLHTTPRequest included an Accept-Language header by default and our native HTTP requests aren't, in which case the old app might have 'magically worked' because the server side would pick the right variant for output, *if* your phone was configured in one of the Chinese locales.

We might be able to do a quick-fix by manually passing the locale identifier in an Accept-Language header; I'll do a quick test and see if it affects the data we get back.

Yeah, looks like that's probably what was going on. If I hardcode a header 'Accept-Language: zh-hant;q=0.8' I see characters in Traditional Chinese on the zh main page whereas without it I saw simplified.

(I can't read either one except for a few characters, but I can tell which is which when they're side by side. :D)

Here's the quick test as a gerrit patch to the Android app: https://gerrit.wikimedia.org/r/#/c/144095/

Feel free to work from that or use it as a reference.


Proper fix would still need to be able to select a variant even if Chinese is not your phone's configured language; I tend to agree that adding multiple entries in the main language list would be the simplest thing.

-- brion