开发者

Android Forced Localization and App Icon/Label?

开发者 https://www.devze.com 2023-02-26 18:43 出处:网络
I have an unusual problem. I need to force-localize an app -- i.e., force it to load in a specific language, regardless of the phone\'s language setting.

I have an unusual problem. I need to force-localize an app -- i.e., force it to load in a specific language, regardless of the phone's language setting.

What our client wants basically is to create language-specific builds of our app. We have all of the resources defined for different languages, and can therefore build an app that will automatically localize based on the phone's settings. But he also wants separate builds for specific languages. Before you say it: yes, I know that this is fighting against Android's Localization system. Yes, we did explain that and try to talk him out of it. But this is what he wants, so it's what we have to do.

I have found some good tutorials on doing this using Locale.setDefault() and the android:configChanges="locale" tag in the Manifest, and that seems to work just fine for setting the language inside Activities. But it has one shortcoming: it doesn't effect the app icon or the app label (i.e., what shows in the launcher), because those are retrieved from the Manifest at compile time.

So I'm trying to find the easiest way to handle this. I know if all else fails, I can write a Bash script that will just move the localized versions of those resources into the default directory before compiling. And if it comes to that, that's what I'll do. But I want to see first if the开发者_开发技巧re is a more elegant way that I'm overlooking.

Anyone have any suggestions?

0

精彩评论

暂无评论...
验证码 换一张
取 消