Last modified: 2012-02-24 02:52:46 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T34897, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 32897 - Android app doesn't update locale when system locale changes
Android app doesn't update locale when system locale changes
Status: RESOLVED FIXED
Product: Wikipedia App
Classification: Unclassified
Generic (Other open bugs)
1.0.0 (Android)
All All
: Normal normal
: ---
Assigned To: Brion Vibber
:
Depends on:
Blocks: 31447
  Show dependency treegraph
 
Reported: 2011-12-09 14:30 UTC by Brion Vibber
Modified: 2012-02-24 02:52 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: Android
Assignee Huggle Beta Tester: ---


Attachments

Description Brion Vibber 2011-12-09 14:30:12 UTC
If the user changes the system locale while the app is running, the app stays on whatever language it was on previously.

We should instead switch locales and eg start drawing the menus in the new language. May need to check with PhoneGap if we get an event when this happens.
Comment 1 Brion Vibber 2011-12-09 14:58:46 UTC
I don't see a specific 'settings changed' sort of event in PhoneGap docs, but 'resume' should do the job:

http://docs.phonegap.com/en/1.0.0/phonegap_events_events.md.html#resume

we should check a few things including whether the locale changed, and if so then reinitialize and, if necessary, reapply the current page's localized text replacements.
Comment 2 Brion Vibber 2011-12-13 13:29:28 UTC
In some initial testing, I'm not actually getting the 'pause' or 'resume' events fired... :(  I'm not sure whether they're not working, or if they actually only fire when the app gets more solidly shut down than is happening during regular app switching...
Comment 3 Brion Vibber 2011-12-21 22:39:31 UTC
pause/resume events work currently (since the PhoneGap 1.3.0 update, may or may not be related) however the user-agent string doesn't update, so i'll have to get the locale by other means.
Comment 4 Brion Vibber 2011-12-21 23:13:18 UTC
Having trouble with the Globalization plugin to get locale info: PhoneGap.exec returns a 'class not found' error.

Work in progress: https://github.com/brion/Wikipedia/tree/locale
Comment 5 Phil Chang 2012-01-04 00:07:10 UTC
Still seeing language in menu change partially after changing phone language. Usually the More button is in the new language, while the rest of the menu is in the old language. Then closing the app and opening it again shows all the menu items in the new language.
Comment 6 Brion Vibber 2012-01-04 01:15:41 UTC
Fixed in commit f53b6ba239b48e0aedd769ba82feb3daf59d6d98.

Using Globalization plugin we can get the locale correctly, and this seems to update properly unlike the prior tricks. No need to check the 'resume' event here, since the activity appears to be getting restarted entirely after a locale change -- just have to get it right the first time.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links