iamjazzar/rosetta

Language doesn't change immediately

Opened this issue · 12 comments

After choosing language from ChangeLanguageDialog, language doesn't change immediately. But it changes in next app launch after killing the current app.

Hello @Arkar-Aung, I'm sorry but I could not reproduce the issue. Could you please give me more context of the problem, the logs for example?

@AhmedAljazzar It's okay if I use directly setLocale(locale, context). Restart activity with correct language. But when I use ChangeLanguageDialog, restart activity with current language. Nothing has changed. Still showing current language in language dialog in next time activity launch.

I'm sorry I tried the dialog, but it seems it's working fine. Could you give me the logging information?

I had the same problem on Android 4 @AhmedAljazzar It Saves correctly but when you relaunch the activity still has the same strings

D/com.ahmedjazzar.rosetta.LanguagesListDialogFragment: Displaying dialog main strings in the selected locale
D/com.ahmedjazzar.rosetta.LanguagesListDialogFragment: Displaying dialog main strings in the selected locale
I/com.ahmedjazzar.rosetta.LocalesDetector: Locale preferences updated to: es
I/com.ahmedjazzar.rosetta.LanguagesListDialogFragment: App locale changed successfully.
D/com.ahmedjazzar.rosetta.LocalesDetector: Refreshing the application: appli.example.com.dev
D/com.ahmedjazzar.rosetta.LocalesDetector: Finishing current activity.
D/com.ahmedjazzar.rosetta.LocalesDetector: Start the application
D/com.ahmedjazzar.rosetta.LocalesDetector: Application refreshed

It works fine on Android 5 and on

Thanks @leodeleon22, I'll start working on this issue soon.

@AhmedAljazzar I'm working on a language learning app, this feature is really important to me. If you want we can discuss and see how can I help to fix this issue. Thanks

@AhmedAljazzar Do you have any quick fix in mind that I can try on android 4?

Pull requests are always welcomed @leodeleon22, I still have nothing in mind, and I was planning to work on this in the next weekend. So yes please, if you could help, it'd be appreciated.

I've cloned the repo and updated some dependencies, I'm gonna work on it today. Thanks for the fast answer

Waiting for it, thanks @leodeleon22.

I had a similar problem, but when I manually set locales instead of automatically identifying the language, the issue was solved. Please check if that helps.