Package ai.nexconn.chatui.utils.language
Class NCConfigurationManager
-
- All Implemented Interfaces:
public class NCConfigurationManagerConfiguration manager for locale and file size settings.
-
-
Method Summary
Modifier and Type Method Description static NCConfigurationManagergetInstance()static voidinit(Context context)voidsetFileMaxSize(Context context, int size)Sets the maximum file size for sending files. intgetFileMaxSize(Context context)Gets the maximum file size for sending files. voidswitchLocale(LangUtils.NCLocale locale, Context context)Switches the app language. ContextgetConfigurationContext(Context newBase)Creates a ConfigurationContext for use in attachBaseContext. LangUtils.NCLocalegetAppLocale(Context context)Gets the in-app locale setting. LocalegetSystemLocale()Gets the system locale. LangUtils.NCLocalegetLanguageLocal(Context context)Gets the current app language setting. -
-
Method Detail
-
getInstance
static NCConfigurationManager getInstance()
-
init
static void init(Context context)
-
setFileMaxSize
void setFileMaxSize(Context context, int size)
Sets the maximum file size for sending files.
- Parameters:
context- contextsize- maximum file size in MB
-
getFileMaxSize
int getFileMaxSize(Context context)
Gets the maximum file size for sending files.
- Parameters:
context- context- Returns:
maximum file size in MB
-
switchLocale
void switchLocale(LangUtils.NCLocale locale, Context context)
Switches the app language.
- Parameters:
locale- accepted values: NCLocale.LOCALE_CHINA, NCLocale.LOCALE_US, or NCLocale.
-
getConfigurationContext
Context getConfigurationContext(Context newBase)
Creates a ConfigurationContext for use in attachBaseContext.
- Parameters:
newBase- the base context- Returns:
the configuration-wrapped context
-
getAppLocale
LangUtils.NCLocale getAppLocale(Context context)
Gets the in-app locale setting.
- Returns:
the in-app locale
-
getSystemLocale
Locale getSystemLocale()
Gets the system locale.
- Returns:
the system locale
-
getLanguageLocal
LangUtils.NCLocale getLanguageLocal(Context context)
Gets the current app language setting.
- Returns:
the resolved locale
-
-
-
-