android - Wrong language fonts at multi language app -
i'm trying make multilanguage app, english , greek. want 2 buttons @ first screen u choose language , other app bve @ language. have make simple test project 2 buttons , paragraph, when u push english button text english, when u push greek button text greek. code
@override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_page2); button english = (button) findviewbyid(r.id.english); english.setonclicklistener(new onclicklistener() { public void onclick(view v) { locale locale = new locale("en_uk"); locale.setdefault(locale); configuration config = new configuration(); config.locale = locale; getapplicationcontext().getresources().updateconfiguration(config, null); intent intent = new intent(v.getcontext(), mainactivity.class); startactivityforresult(intent, 0); } }); button greek = (button) findviewbyid(r.id.greek); greek.setonclicklistener(new onclicklistener() { public void onclick(view v) { locale locale = new locale("el_gr"); locale.setdefault(locale); configuration config = new configuration(); config.locale = locale; getapplicationcontext().getresources().updateconfiguration(config, null); intent intent = new intent(v.getcontext(), mainactivity.class); startactivityforresult(intent, 0); } }); }
the strings.xml english paragraph @ original res/values folder , strings.xml greek language in res/values-el
here 3 screenshots test app here screenshots:
the 1 non letters things greek paragraph
the problem phone doesnot supports unicode characters greek, there 2 solutions,
1)it means fonts device uses not support greek characters (hence unknown unicode
). need find better font , use in application (see http://developer.android.com/reference/android/graphics/typeface.html docs)
2)get online unicode converter or google translator english greek , copy words strings.xml
Comments
Post a Comment