Package ai.nexconn.chatui.utils.language
Class LangUtils
-
- All Implemented Interfaces:
public class LangUtilsLanguage utility class for locale management.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classLangUtils.NCLocaleWrapper class for selectable locales.
-
Field Summary
Fields Modifier and Type Field Description public static LocalesystemLocale
-
Constructor Summary
Constructors Constructor Description LangUtils()
-
Method Summary
Modifier and Type Method Description static LocalegetSystemLocale()Gets the system locale. static voidsetSystemLocale(Locale locale)Sets the system locale. static ContextgetConfigurationContext(Context context)static LangUtils.NCLocalegetAppLocale(Context context)static voidsaveLocale(Context context, LangUtils.NCLocale locale)static LangUtils.NCLocalegetCurrentLanguage(Context context)Gets the current language regardless of whether it is explicitly set or following the system. static LangUtils.NCLocalegetAppLanguageLocal(Context context)Gets the current app language setting. -
-
Method Detail
-
getSystemLocale
static Locale getSystemLocale()
Gets the system locale.
- Returns:
the system locale
-
setSystemLocale
static void setSystemLocale(Locale locale)
Sets the system locale.
- Parameters:
locale- the locale to set
-
getConfigurationContext
static Context getConfigurationContext(Context context)
-
getAppLocale
static LangUtils.NCLocale getAppLocale(Context context)
-
saveLocale
static void saveLocale(Context context, LangUtils.NCLocale locale)
-
getCurrentLanguage
static LangUtils.NCLocale getCurrentLanguage(Context context)
Gets the current language regardless of whether it is explicitly set or following the system.
- Parameters:
context- context- Returns:
current language
-
getAppLanguageLocal
static LangUtils.NCLocale getAppLanguageLocal(Context context)
Gets the current app language setting.
- Returns:
the resolved locale
-
-
-
-