LocaleManager

@Singleton
class LocaleManager @Inject constructor(context: Context, sharedPreferences: SharedPreferences)

This class is used to change your application locale and persist this change for the next time that your app is going to be used.

Constructors

Link copied to clipboard
@Inject
fun LocaleManager(context: Context, sharedPreferences: SharedPreferences)

Functions

Link copied to clipboard
fun getLanguage(): String

Get the language of the app Locale (Selected in settings).

Link copied to clipboard
fun getLocale(): Locale
Link copied to clipboard
fun getLocaleFromContext(context: Context?): Locale
Link copied to clipboard
fun restoreLocalizedContext(context: Context): Context
Link copied to clipboard
fun saveLanguageToPrefs(context: Context, locale: Locale): Context