Reputation: 6635
I have an Android app which is only available in English. Accordingly, all of the UI that's under my control appears in English only, regardless of what language the user has set their device to. The issue is with SwitchPreference
s on my app's Settings screen; the "on"/"off" labels on the switches themselves are getting localized, presenting the user with a mixed-language UI.
See screenshot at https://drive.google.com/file/d/0B5ry4aCYVaqoUkFlZW9XT2VLVFE/view?usp=sharing
Is there any way to override the system localization of this element?
Notes:
I'm not that bothered about this myself, but the app is being rejected by Samsung's app store certification team on this basis. So I do need to fix it if possible.
Please don't respond by saying "localize your app so that there's not a mix". Apart from other localization issues (which are out of scope here), it just isn't possible for me to localize to all the langauges that the Android OS supports.
Upvotes: 1
Views: 117
Reputation: 6635
Thanks for the suggestions, Mark, but it turns out there's an easier way. I just added the following attributes to the SwitchPreference elements in the XML which defines my settings screen:
android:switchTextOff="OFF"
android:switchTextOn="ON"
Voila, the switch labels are un-localized. RTFM FTW! :^)
Upvotes: 2