iamjazzar/rosetta

how to change language dialouge elements ?

shubhexioms opened this issue · 3 comments

how to change language dialouge elements ?

Can you explain more, @shubhexioms?

Check Identify your locales, or let the library do it for you! in the README.md file.

// This is the locale that you wanna your app to launch with.
Locale firstLaunchLocale = new Locale("ar");

// You can use a HashSet<String> instead and call 'setSupportedStringLocales()' :)
HashSet<Locale> supportedLocales = new HashSet<>();
supportedLocales.add(Locale.US);
supportedLocales.add(Locale.CHINA);
supportedLocales.add(firstLaunchLocale);

// You can make the following object static so you can use the same reference in all app's
// classes. static is much stable.
LanguageSwitcher ls = new LanguageSwitcher(this, firstLaunchLocale);
ls.setSupportedLocales(supportedLocales);