android - Choose language for tts depending on translation state -


i'm building simple app can read string resources user. these resources translated (into more 2 languages, english (default resources) , german.

now problem choose correct language tts engine, when no translations user's system locale exist.

is there way determine whether string translated resp. not come default values/strings.xml file?

update: object e.g. no german strings synthesized english voice.

i don´t know if need , if understand right way. guess want determine first, locale users device uses, right? then, there method need:

string locale = context.getresources().getconfiguration().locale.getdisplayname(); 

with getresources().getconfiguration() "current configuration in effect resource object" , configuration locale "current user preference locale, corresponding locale resource qualifier" (api quotes). retrive used language getdisplayname():

returns locale's language name, country name, , variant, localized locale. exact output form depends on whether locale corresponds specific language, script, country , variant.

i guess, output "english" or "english (united states)" or similar. described here:

http://developer.android.com/reference/java/util/locale.html#getdisplayname%28%29

with information, can determine if translation devices country used.


Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -