From af25f8d49e80d41ca220030e16ae1ab2aac1b654 Mon Sep 17 00:00:00 2001 From: ShirkNeko <109797057+ShirkNeko@users.noreply.github.com> Date: Thu, 16 Oct 2025 22:37:52 +0800 Subject: [PATCH] manager: Optimize Language Settings - Do not update language configurations by refreshing activities; instead, introduce consistent language configurations from kernelsu-next. Co-authored-by: rifsxd --- .../com/sukisu/ultra/KernelSUApplication.kt | 133 ++----------- .../java/com/sukisu/ultra/ui/MainActivity.kt | 21 +-- .../ui/activity/util/UltraActivityUtils.kt | 43 ----- .../screen/moreSettings/MoreSettings.kt | 46 ++++- .../moreSettings/MoreSettingsHandlers.kt | 38 ---- .../component/MoreSettingsDialogs.kt | 174 +++++++++++++----- .../moreSettings/state/MoreSettingsState.kt | 55 +----- .../screen/moreSettings/util/LocaleHelper.kt | 154 ++++++++++++++++ .../app/src/main/res/values-ar/strings.xml | 5 +- .../app/src/main/res/values-az/strings.xml | 5 +- .../app/src/main/res/values-bs/strings.xml | 5 +- .../app/src/main/res/values-da/strings.xml | 5 +- .../app/src/main/res/values-de/strings.xml | 5 +- .../app/src/main/res/values-es/strings.xml | 5 +- .../app/src/main/res/values-et/strings.xml | 5 +- .../app/src/main/res/values-fa/strings.xml | 5 +- .../app/src/main/res/values-fil/strings.xml | 5 +- .../app/src/main/res/values-fr/strings.xml | 5 +- .../app/src/main/res/values-hi/strings.xml | 5 +- .../app/src/main/res/values-hr/strings.xml | 5 +- .../app/src/main/res/values-hu/strings.xml | 5 +- .../app/src/main/res/values-idn/strings.xml | 5 +- .../app/src/main/res/values-in/strings.xml | 5 +- .../app/src/main/res/values-it/strings.xml | 5 +- .../app/src/main/res/values-ja/strings.xml | 5 +- .../app/src/main/res/values-kn/strings.xml | 5 +- .../app/src/main/res/values-ko/strings.xml | 5 +- .../app/src/main/res/values-lt/strings.xml | 5 +- .../app/src/main/res/values-lv/strings.xml | 5 +- .../app/src/main/res/values-mr/strings.xml | 5 +- .../app/src/main/res/values-ms/strings.xml | 5 +- .../app/src/main/res/values-nl/strings.xml | 5 +- .../app/src/main/res/values-pl/strings.xml | 5 +- .../app/src/main/res/values-pt/strings.xml | 5 +- .../app/src/main/res/values-ro/strings.xml | 5 +- .../app/src/main/res/values-ru/strings.xml | 5 +- .../app/src/main/res/values-sl/strings.xml | 5 +- .../app/src/main/res/values-th/strings.xml | 5 +- .../app/src/main/res/values-tr/strings.xml | 5 +- .../app/src/main/res/values-uk/strings.xml | 5 +- .../app/src/main/res/values-vi/strings.xml | 5 +- .../src/main/res/values-zh-rCN/strings.xml | 5 +- .../src/main/res/values-zh-rHK/strings.xml | 5 +- .../src/main/res/values-zh-rTW/strings.xml | 5 +- manager/app/src/main/res/values/strings.xml | 5 +- 45 files changed, 422 insertions(+), 427 deletions(-) create mode 100644 manager/app/src/main/java/zako/zako/zako/zakoui/screen/moreSettings/util/LocaleHelper.kt diff --git a/manager/app/src/main/java/com/sukisu/ultra/KernelSUApplication.kt b/manager/app/src/main/java/com/sukisu/ultra/KernelSUApplication.kt index 73de13de..007c5b00 100644 --- a/manager/app/src/main/java/com/sukisu/ultra/KernelSUApplication.kt +++ b/manager/app/src/main/java/com/sukisu/ultra/KernelSUApplication.kt @@ -1,95 +1,27 @@ package com.sukisu.ultra -import android.annotation.SuppressLint -import android.app.Activity -import android.app.ActivityOptions import android.app.Application -import android.content.Context -import android.content.res.Configuration -import android.content.res.Resources -import android.os.Build -import android.os.Bundle +import android.system.Os import coil.Coil import coil.ImageLoader import com.dergoogler.mmrl.platform.Platform import me.zhanghai.android.appiconloader.coil.AppIconFetcher import me.zhanghai.android.appiconloader.coil.AppIconKeyer +import okhttp3.Cache +import okhttp3.OkHttpClient import java.io.File -import java.util.* +import java.util.Locale -@SuppressLint("StaticFieldLeak") lateinit var ksuApp: KernelSUApplication class KernelSUApplication : Application() { - private var currentActivity: Activity? = null - private val activityLifecycleCallbacks = object : ActivityLifecycleCallbacks { - override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) { - currentActivity = activity - } - override fun onActivityStarted(activity: Activity) { - currentActivity = activity - } - override fun onActivityResumed(activity: Activity) { - currentActivity = activity - } - override fun onActivityPaused(activity: Activity) {} - override fun onActivityStopped(activity: Activity) {} - override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle) {} - override fun onActivityDestroyed(activity: Activity) { - if (currentActivity == activity) { - currentActivity = null - } - } - } - - override fun attachBaseContext(base: Context) { - val prefs = base.getSharedPreferences("settings", MODE_PRIVATE) - val languageCode = prefs.getString("app_language", "") ?: "" - - var context = base - if (languageCode.isNotEmpty()) { - val locale = Locale.forLanguageTag(languageCode) - Locale.setDefault(locale) - - val config = Configuration(base.resources.configuration) - config.setLocale(locale) - - context = base.createConfigurationContext(config) - } - - super.attachBaseContext(context) - } - - @SuppressLint("ObsoleteSdkInt") - override fun getResources(): Resources { - val resources = super.getResources() - val prefs = getSharedPreferences("settings", MODE_PRIVATE) - val languageCode = prefs.getString("app_language", "") ?: "" - - if (languageCode.isNotEmpty()) { - val locale = Locale.forLanguageTag(languageCode) - val config = Configuration(resources.configuration) - config.setLocale(locale) - - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { - return createConfigurationContext(config).resources - } else { - @Suppress("DEPRECATION") - resources.updateConfiguration(config, resources.displayMetrics) - } - } - - return resources - } + lateinit var okhttpClient: OkHttpClient override fun onCreate() { super.onCreate() ksuApp = this - // 注册Activity生命周期回调 - registerActivityLifecycleCallbacks(activityLifecycleCallbacks) - Platform.setHiddenApiExemptions() val context = this @@ -107,45 +39,18 @@ class KernelSUApplication : Application() { if (!webroot.exists()) { webroot.mkdir() } + + // Provide working env for rust's temp_dir() + Os.setenv("TMPDIR", cacheDir.absolutePath, true) + + okhttpClient = + OkHttpClient.Builder().cache(Cache(File(cacheDir, "okhttp"), 10 * 1024 * 1024)) + .addInterceptor { block -> + block.proceed( + block.request().newBuilder() + .header("User-Agent", "SukiSU/${BuildConfig.VERSION_CODE}") + .header("Accept-Language", Locale.getDefault().toLanguageTag()).build() + ) + }.build() } - - override fun onConfigurationChanged(newConfig: Configuration) { - super.onConfigurationChanged(newConfig) - applyLanguageSetting() - } - - @SuppressLint("ObsoleteSdkInt") - private fun applyLanguageSetting() { - val prefs = getSharedPreferences("settings", MODE_PRIVATE) - val languageCode = prefs.getString("app_language", "") ?: "" - - if (languageCode.isNotEmpty()) { - val locale = Locale.forLanguageTag(languageCode) - Locale.setDefault(locale) - - val resources = resources - val config = Configuration(resources.configuration) - config.setLocale(locale) - - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { - createConfigurationContext(config) - } else { - @Suppress("DEPRECATION") - resources.updateConfiguration(config, resources.displayMetrics) - } - } - } - - // 添加刷新当前Activity的方法 - fun refreshCurrentActivity() { - currentActivity?.let { activity -> - val intent = activity.intent - activity.finish() - - val options = ActivityOptions.makeCustomAnimation( - activity, android.R.anim.fade_in, android.R.anim.fade_out - ) - activity.startActivity(intent, options.toBundle()) - } - } -} +} \ No newline at end of file diff --git a/manager/app/src/main/java/com/sukisu/ultra/ui/MainActivity.kt b/manager/app/src/main/java/com/sukisu/ultra/ui/MainActivity.kt index 646ab110..1f6c77a2 100644 --- a/manager/app/src/main/java/com/sukisu/ultra/ui/MainActivity.kt +++ b/manager/app/src/main/java/com/sukisu/ultra/ui/MainActivity.kt @@ -2,7 +2,6 @@ package com.sukisu.ultra.ui import android.content.Context import android.content.Intent -import android.content.res.Configuration import android.net.Uri import android.os.Build import android.os.Bundle @@ -26,6 +25,7 @@ import com.ramcosta.composedestinations.generated.NavGraphs import com.ramcosta.composedestinations.generated.destinations.ExecuteModuleActionScreenDestination import com.ramcosta.composedestinations.spec.NavHostGraphSpec import com.ramcosta.composedestinations.utils.rememberDestinationsNavigator +import zako.zako.zako.zakoui.screen.moreSettings.util.LocaleHelper import com.sukisu.ultra.Natives import com.sukisu.ultra.ui.screen.BottomBarDestination import com.sukisu.ultra.ui.theme.KernelSUTheme @@ -54,19 +54,14 @@ class MainActivity : ComponentActivity() { private var pendingZipFiles = mutableStateOf>(emptyList()) private lateinit var themeChangeObserver: ThemeChangeContentObserver - - // 标记避免重复初始化 private var isInitialized = false - override fun attachBaseContext(newBase: Context) { - val context = LocaleUtils.applyLocale(newBase) - super.attachBaseContext(context) + override fun attachBaseContext(newBase: Context?) { + super.attachBaseContext(newBase?.let { LocaleHelper.applyLanguage(it) }) } override fun onCreate(savedInstanceState: Bundle?) { try { - // 确保应用正确的语言设置 - LocaleUtils.applyLanguageSetting(this) // 应用自定义 DPI DisplayUtils.applyCustomDpi(this) @@ -271,7 +266,6 @@ class MainActivity : ComponentActivity() { override fun onResume() { try { super.onResume() - LocaleUtils.applyLanguageSetting(this) ThemeUtils.onActivityResume() // 仅在需要时刷新数据 @@ -311,13 +305,4 @@ class MainActivity : ComponentActivity() { e.printStackTrace() } } - - override fun onConfigurationChanged(newConfig: Configuration) { - try { - super.onConfigurationChanged(newConfig) - LocaleUtils.applyLanguageSetting(this) - } catch (e: Exception) { - e.printStackTrace() - } - } } \ No newline at end of file diff --git a/manager/app/src/main/java/com/sukisu/ultra/ui/activity/util/UltraActivityUtils.kt b/manager/app/src/main/java/com/sukisu/ultra/ui/activity/util/UltraActivityUtils.kt index 69b4b0d1..aec39f15 100644 --- a/manager/app/src/main/java/com/sukisu/ultra/ui/activity/util/UltraActivityUtils.kt +++ b/manager/app/src/main/java/com/sukisu/ultra/ui/activity/util/UltraActivityUtils.kt @@ -1,9 +1,6 @@ package com.sukisu.ultra.ui.activity.util -import android.annotation.SuppressLint import android.content.Context -import android.content.res.Configuration -import android.os.Build import androidx.compose.animation.AnimatedVisibility import androidx.compose.animation.fadeIn import androidx.compose.animation.fadeOut @@ -236,44 +233,4 @@ object DisplayUtils { } } } -} - -object LocaleUtils { - @SuppressLint("ObsoleteSdkInt") - fun applyLanguageSetting(context: Context) { - val prefs = context.getSharedPreferences("settings", Context.MODE_PRIVATE) - val languageCode = prefs.getString("app_language", "") ?: "" - - if (languageCode.isNotEmpty()) { - val locale = Locale.forLanguageTag(languageCode) - Locale.setDefault(locale) - - val resources = context.resources - val config = Configuration(resources.configuration) - config.setLocale(locale) - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { - context.createConfigurationContext(config) - } else { - @Suppress("DEPRECATION") - resources.updateConfiguration(config, resources.displayMetrics) - } - } - } - - fun applyLocale(context: Context): Context { - val prefs = context.getSharedPreferences("settings", Context.MODE_PRIVATE) - val languageCode = prefs.getString("app_language", "") ?: "" - - var newContext = context - if (languageCode.isNotEmpty()) { - val locale = Locale.forLanguageTag(languageCode) - Locale.setDefault(locale) - - val config = Configuration(context.resources.configuration) - config.setLocale(locale) - newContext = context.createConfigurationContext(config) - } - - return newContext - } } \ No newline at end of file diff --git a/manager/app/src/main/java/zako/zako/zako/zakoui/screen/moreSettings/MoreSettings.kt b/manager/app/src/main/java/zako/zako/zako/zakoui/screen/moreSettings/MoreSettings.kt index 8c9e1185..ebd6434f 100644 --- a/manager/app/src/main/java/zako/zako/zako/zakoui/screen/moreSettings/MoreSettings.kt +++ b/manager/app/src/main/java/zako/zako/zako/zakoui/screen/moreSettings/MoreSettings.kt @@ -28,6 +28,7 @@ import androidx.compose.ui.unit.dp import com.ramcosta.composedestinations.annotation.Destination import com.ramcosta.composedestinations.annotation.RootGraph import com.ramcosta.composedestinations.navigation.DestinationsNavigator +import zako.zako.zako.zakoui.screen.moreSettings.util.LocaleHelper import com.sukisu.ultra.Natives import com.sukisu.ultra.R import com.sukisu.ultra.ui.theme.component.ImageEditorDialog @@ -38,6 +39,7 @@ import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import zako.zako.zako.zakoui.screen.moreSettings.component.ColorCircle +import zako.zako.zako.zakoui.screen.moreSettings.component.LanguageSelectionDialog import zako.zako.zako.zakoui.screen.moreSettings.component.MoreSettingsDialogs import zako.zako.zako.zakoui.screen.moreSettings.component.SettingItem import zako.zako.zako.zakoui.screen.moreSettings.component.SettingsCard @@ -171,13 +173,7 @@ private fun AppearanceSettings( ) { SettingsCard(title = stringResource(R.string.appearance_settings)) { // 语言设置 - SettingItem( - icon = Icons.Default.Language, - title = stringResource(R.string.language_setting), - subtitle = state.supportedLanguages.find { it.first == state.currentLanguage }?.second - ?: stringResource(R.string.language_follow_system), - onClick = { state.showLanguageDialog = true } - ) + LanguageSetting(state = state) // 主题模式 SettingItem( @@ -713,4 +709,40 @@ private fun DimSlider( fun saveCardConfig(context: Context) { CardConfig.save(context) +} + +@Composable +private fun LanguageSetting(state: MoreSettingsState) { + val context = LocalContext.current + val language = stringResource(id = R.string.settings_language) + + // Compute display name based on current app locale + val currentLanguageDisplay = remember(state.currentAppLocale) { + val locale = state.currentAppLocale + if (locale != null) { + locale.getDisplayName(locale) + } else { + context.getString(R.string.language_system_default) + } + } + + SettingItem( + icon = Icons.Filled.Translate, + title = language, + subtitle = currentLanguageDisplay, + onClick = { state.showLanguageDialog = true } + ) + + // Language Selection Dialog + if (state.showLanguageDialog) { + LanguageSelectionDialog( + onLanguageSelected = { newLocale -> + // Update local state immediately + state.currentAppLocale = LocaleHelper.getCurrentAppLocale(context) + // Apply locale change immediately for Android < 13 + LocaleHelper.restartActivity(context) + }, + onDismiss = { state.showLanguageDialog = false } + ) + } } \ No newline at end of file diff --git a/manager/app/src/main/java/zako/zako/zako/zakoui/screen/moreSettings/MoreSettingsHandlers.kt b/manager/app/src/main/java/zako/zako/zako/zakoui/screen/moreSettings/MoreSettingsHandlers.kt index c0bf446e..3ca2fda9 100644 --- a/manager/app/src/main/java/zako/zako/zako/zakoui/screen/moreSettings/MoreSettingsHandlers.kt +++ b/manager/app/src/main/java/zako/zako/zako/zakoui/screen/moreSettings/MoreSettingsHandlers.kt @@ -1,12 +1,10 @@ package zako.zako.zako.zakoui.screen.moreSettings -import android.annotation.SuppressLint import android.content.Context import android.content.Intent import android.content.SharedPreferences import android.content.res.Configuration import android.net.Uri -import android.os.Build import android.widget.Toast import androidx.compose.runtime.Composable import androidx.compose.ui.res.stringResource @@ -14,13 +12,11 @@ import androidx.compose.ui.unit.dp import androidx.core.content.edit import com.sukisu.ultra.Natives import com.sukisu.ultra.R -import com.sukisu.ultra.ksuApp import com.sukisu.ultra.ui.theme.* import com.sukisu.ultra.ui.util.* import com.topjohnwu.superuser.Shell import zako.zako.zako.zakoui.screen.moreSettings.state.MoreSettingsState import zako.zako.zako.zakoui.screen.moreSettings.util.toggleLauncherIcon -import java.util.* /** * 更多设置处理器 @@ -136,40 +132,6 @@ class MoreSettingsHandlers( } } - /** - * 处理语言设置变更 - */ - @SuppressLint("ObsoleteSdkInt") - fun handleLanguageChange(code: String) { - if (state.currentLanguage != code) { - prefs.edit { - putString("app_language", code) - commit() - } - - state.currentLanguage = code - - Toast.makeText( - context, - context.getString(R.string.language_changed), - Toast.LENGTH_SHORT - ).show() - - val locale = if (code.isEmpty()) Locale.getDefault() else Locale.forLanguageTag(code) - Locale.setDefault(locale) - val config = Configuration(context.resources.configuration) - config.setLocale(locale) - - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { - context.createConfigurationContext(config) - } else { - @Suppress("DEPRECATION") - context.resources.updateConfiguration(config, context.resources.displayMetrics) - } - ksuApp.refreshCurrentActivity() - } - } - /** * 处理主题色变更 */ diff --git a/manager/app/src/main/java/zako/zako/zako/zakoui/screen/moreSettings/component/MoreSettingsDialogs.kt b/manager/app/src/main/java/zako/zako/zako/zakoui/screen/moreSettings/component/MoreSettingsDialogs.kt index a3596940..c321c93e 100644 --- a/manager/app/src/main/java/zako/zako/zako/zakoui/screen/moreSettings/component/MoreSettingsDialogs.kt +++ b/manager/app/src/main/java/zako/zako/zako/zakoui/screen/moreSettings/component/MoreSettingsDialogs.kt @@ -1,5 +1,6 @@ package zako.zako.zako.zakoui.screen.moreSettings.component +import android.content.Context import androidx.compose.foundation.* import androidx.compose.foundation.layout.* import androidx.compose.foundation.text.KeyboardOptions @@ -9,9 +10,17 @@ import androidx.compose.material3.* import androidx.compose.runtime.* import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.input.KeyboardType import androidx.compose.ui.unit.dp +import androidx.core.content.edit +import com.maxkeppeker.sheets.core.models.base.Header +import com.maxkeppeker.sheets.core.models.base.rememberUseCaseState +import com.maxkeppeler.sheets.list.ListDialog +import com.maxkeppeler.sheets.list.models.ListOption +import com.maxkeppeler.sheets.list.models.ListSelection +import zako.zako.zako.zakoui.screen.moreSettings.util.LocaleHelper import com.sukisu.ultra.R import com.sukisu.ultra.ui.theme.* import zako.zako.zako.zakoui.screen.moreSettings.MoreSettingsHandlers @@ -35,19 +44,6 @@ fun MoreSettingsDialogs( ) } - // 语言切换对话框 - if (state.showLanguageDialog) { - KeyValueChoiceDialog( - title = stringResource(R.string.language_setting), - options = state.supportedLanguages, - selectedCode = state.currentLanguage, - onOptionSelected = { code -> - handlers.handleLanguageChange(code) - }, - onDismiss = { state.showLanguageDialog = false } - ) - } - // DPI 设置确认对话框 if (state.showDpiConfirmDialog) { ConfirmDialog( @@ -168,48 +164,134 @@ fun ConfirmDialog( ) } +@OptIn(ExperimentalMaterial3Api::class) @Composable -fun KeyValueChoiceDialog( - title: String, - options: List>, - selectedCode: String, - onOptionSelected: (String) -> Unit, +fun LanguageSelectionDialog( + onLanguageSelected: (String) -> Unit, onDismiss: () -> Unit ) { - AlertDialog( - onDismissRequest = onDismiss, - title = { Text(title) }, - text = { - Column(modifier = Modifier.verticalScroll(rememberScrollState())) { - options.forEach { (code, name) -> - Row( - modifier = Modifier - .fillMaxWidth() - .clickable { - onOptionSelected(code) - onDismiss() - } - .padding(vertical = 12.dp), - verticalAlignment = Alignment.CenterVertically - ) { - RadioButton( - selected = selectedCode == code, - onClick = null - ) - Spacer(modifier = Modifier.width(8.dp)) - Text(name) + val context = LocalContext.current + val prefs = context.getSharedPreferences("settings", Context.MODE_PRIVATE) + + // Check if should use system language settings + if (LocaleHelper.useSystemLanguageSettings) { + // Android 13+ - Jump to system settings + LocaleHelper.launchSystemLanguageSettings(context) + onDismiss() + } else { + // Android < 13 - Show app language selector + // Dynamically detect supported locales from resources + val supportedLocales = remember { + val locales = mutableListOf() + + // Add system default first + locales.add(java.util.Locale.ROOT) // This will represent "System Default" + + // Dynamically detect available locales by checking resource directories + val resourceDirs = listOf( + "ar", "bg", "de", "fa", "fr", "hu", "in", "it", + "ja", "ko", "pl", "pt-rBR", "ru", "th", "tr", + "uk", "vi", "zh-rCN", "zh-rTW" + ) + + resourceDirs.forEach { dir -> + try { + val locale = when { + dir.contains("-r") -> { + val parts = dir.split("-r") + java.util.Locale.Builder() + .setLanguage(parts[0]) + .setRegion(parts[1]) + .build() + } + else -> java.util.Locale.Builder() + .setLanguage(dir) + .build() } + + // Test if this locale has translated resources + val config = android.content.res.Configuration() + config.setLocale(locale) + val localizedContext = context.createConfigurationContext(config) + + // Try to get a translated string to verify the locale is supported + val testString = localizedContext.getString(R.string.settings_language) + val defaultString = context.getString(R.string.settings_language) + + // If the string is different or it's English, it's supported + if (testString != defaultString || locale.language == "en") { + locales.add(locale) + } + } catch (_: Exception) { + // Skip unsupported locales } } - }, - confirmButton = { - TextButton(onClick = onDismiss) { - Text(stringResource(R.string.cancel)) + + // Sort by display name + val sortedLocales = locales.drop(1).sortedBy { it.getDisplayName(it) } + mutableListOf().apply { + add(locales.first()) // System default first + addAll(sortedLocales) } } - ) -} + val allOptions = supportedLocales.map { locale -> + val tag = if (locale == java.util.Locale.ROOT) { + "system" + } else if (locale.country.isEmpty()) { + locale.language + } else { + "${locale.language}_${locale.country}" + } + + val displayName = if (locale == java.util.Locale.ROOT) { + context.getString(R.string.language_system_default) + } else { + locale.getDisplayName(locale) + } + + tag to displayName + } + + val currentLocale = prefs.getString("app_locale", "system") ?: "system" + val options = allOptions.map { (tag, displayName) -> + ListOption( + titleText = displayName, + selected = currentLocale == tag + ) + } + + var selectedIndex by remember { + mutableIntStateOf(allOptions.indexOfFirst { (tag, _) -> currentLocale == tag }) + } + + ListDialog( + state = rememberUseCaseState( + visible = true, + onFinishedRequest = { + if (selectedIndex >= 0 && selectedIndex < allOptions.size) { + val newLocale = allOptions[selectedIndex].first + prefs.edit { putString("app_locale", newLocale) } + onLanguageSelected(newLocale) + } + onDismiss() + }, + onCloseRequest = { + onDismiss() + } + ), + header = Header.Default( + title = stringResource(R.string.settings_language), + ), + selection = ListSelection.Single( + showRadioButtons = true, + options = options + ) { index, _ -> + selectedIndex = index + } + ) + } +} @Composable fun ThemeColorDialog( onColorSelected: (ThemeColors) -> Unit, diff --git a/manager/app/src/main/java/zako/zako/zako/zakoui/screen/moreSettings/state/MoreSettingsState.kt b/manager/app/src/main/java/zako/zako/zako/zakoui/screen/moreSettings/state/MoreSettingsState.kt index 9f987f19..ec1abf87 100644 --- a/manager/app/src/main/java/zako/zako/zako/zakoui/screen/moreSettings/state/MoreSettingsState.kt +++ b/manager/app/src/main/java/zako/zako/zako/zakoui/screen/moreSettings/state/MoreSettingsState.kt @@ -2,7 +2,6 @@ package zako.zako.zako.zakoui.screen.moreSettings.state import android.content.Context import android.content.SharedPreferences -import android.content.res.Configuration import android.net.Uri import androidx.compose.runtime.Stable import androidx.compose.runtime.getValue @@ -10,11 +9,11 @@ import androidx.compose.runtime.mutableFloatStateOf import androidx.compose.runtime.mutableIntStateOf import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.setValue +import zako.zako.zako.zakoui.screen.moreSettings.util.LocaleHelper import com.sukisu.ultra.Natives import com.sukisu.ultra.R import com.sukisu.ultra.ui.theme.CardConfig import com.sukisu.ultra.ui.theme.ThemeConfig -import java.util.Locale /** * 更多设置状态管理 @@ -37,9 +36,12 @@ class MoreSettingsState( // 动态颜色开关状态 var useDynamicColor by mutableStateOf(ThemeConfig.useDynamicColor) + // 语言设置 + var showLanguageDialog by mutableStateOf(false) + var currentAppLocale by mutableStateOf(LocaleHelper.getCurrentAppLocale(context)) + // 对话框显示状态 var showThemeModeDialog by mutableStateOf(false) - var showLanguageDialog by mutableStateOf(false) var showThemeColorDialog by mutableStateOf(false) var showDpiConfirmDialog by mutableStateOf(false) var showImageEditor by mutableStateOf(false) @@ -51,8 +53,6 @@ class MoreSettingsState( var dynamicSignHash by mutableStateOf("") var showDynamicSignDialog by mutableStateOf(false) - // 获取当前语言设置 - var currentLanguage by mutableStateOf(prefs.getString("app_language", "") ?: "") // 各种设置开关状态 var isSimpleMode by mutableStateOf(prefs.getBoolean("is_simple_mode", false)) @@ -101,49 +101,4 @@ class MoreSettingsState( context.getString(R.string.dpi_size_large) to 420, context.getString(R.string.dpi_size_extra_large) to 560 ) - - // 获取支持的语言列表 - val supportedLanguages by lazy { - val languages = mutableListOf>() - languages.add("" to context.getString(R.string.language_follow_system)) - val locales = context.resources.configuration.locales - for (i in 0 until locales.size()) { - val locale = locales.get(i) - val code = locale.toLanguageTag() - if (!languages.any { it.first == code }) { - languages.add(code to locale.getDisplayName(locale)) - } - } - - val commonLocales = listOf( - Locale.forLanguageTag("en"), // 英语 - Locale.forLanguageTag("zh-CN"), // 简体中文 - Locale.forLanguageTag("zh-HK"), // 繁体中文(香港) - Locale.forLanguageTag("zh-TW"), // 繁体中文(台湾) - Locale.forLanguageTag("ja"), // 日语 - Locale.forLanguageTag("fr"), // 法语 - Locale.forLanguageTag("de"), // 德语 - Locale.forLanguageTag("es"), // 西班牙语 - Locale.forLanguageTag("it"), // 意大利语 - Locale.forLanguageTag("ru"), // 俄语 - Locale.forLanguageTag("pt"), // 葡萄牙语 - Locale.forLanguageTag("ko"), // 韩语 - Locale.forLanguageTag("vi") // 越南语 - ) - - for (locale in commonLocales) { - val code = locale.toLanguageTag() - if (!languages.any { it.first == code }) { - val config = Configuration(context.resources.configuration) - config.setLocale(locale) - try { - val testContext = context.createConfigurationContext(config) - testContext.getString(R.string.language_follow_system) - languages.add(code to locale.getDisplayName(locale)) - } catch (_: Exception) { - } - } - } - languages - } } \ No newline at end of file diff --git a/manager/app/src/main/java/zako/zako/zako/zakoui/screen/moreSettings/util/LocaleHelper.kt b/manager/app/src/main/java/zako/zako/zako/zakoui/screen/moreSettings/util/LocaleHelper.kt new file mode 100644 index 00000000..f383ec99 --- /dev/null +++ b/manager/app/src/main/java/zako/zako/zako/zakoui/screen/moreSettings/util/LocaleHelper.kt @@ -0,0 +1,154 @@ +package zako.zako.zako.zakoui.screen.moreSettings.util + +import android.annotation.SuppressLint +import android.annotation.TargetApi +import android.app.Activity +import android.content.Context +import android.content.Intent +import android.content.res.Configuration +import android.net.Uri +import android.os.Build +import android.provider.Settings +import java.util.* + +object LocaleHelper { + + /** + * Check if should use system language settings (Android 13+) + */ + val useSystemLanguageSettings: Boolean + get() = Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU + + /** + * Launch system app locale settings (Android 13+) + */ + fun launchSystemLanguageSettings(context: Context) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { + try { + val intent = Intent(Settings.ACTION_APP_LOCALE_SETTINGS).apply { + data = Uri.fromParts("package", context.packageName, null) + } + context.startActivity(intent) + } catch (_: Exception) { + // Fallback to app language settings if system settings not available + } + } + } + + /** + * Apply saved language setting to context (for Android < 13) + */ + fun applyLanguage(context: Context): Context { + // On Android 13+, language is handled by system + if (useSystemLanguageSettings) { + return context + } + + val prefs = context.getSharedPreferences("settings", Context.MODE_PRIVATE) + val localeTag = prefs.getString("app_locale", "system") ?: "system" + + return if (localeTag == "system") { + context + } else { + val locale = parseLocaleTag(localeTag) + setLocale(context, locale) + } + } + + /** + * Set locale for context (Android < 13) + */ + @SuppressLint("ObsoleteSdkInt") + private fun setLocale(context: Context, locale: Locale): Context { + return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + updateResources(context, locale) + } else { + updateResourcesLegacy(context, locale) + } + } + + @SuppressLint("UseRequiresApi", "ObsoleteSdkInt") + @TargetApi(Build.VERSION_CODES.N) + private fun updateResources(context: Context, locale: Locale): Context { + val configuration = Configuration() + configuration.setLocale(locale) + configuration.setLayoutDirection(locale) + return context.createConfigurationContext(configuration) + } + + @Suppress("DEPRECATION") + @SuppressWarnings("deprecation") + private fun updateResourcesLegacy(context: Context, locale: Locale): Context { + Locale.setDefault(locale) + val resources = context.resources + val configuration = resources.configuration + configuration.locale = locale + configuration.setLayoutDirection(locale) + resources.updateConfiguration(configuration, resources.displayMetrics) + return context + } + + /** + * Parse locale tag to Locale object + */ + private fun parseLocaleTag(tag: String): Locale { + return try { + if (tag.contains("_")) { + val parts = tag.split("_") + Locale.Builder() + .setLanguage(parts[0]) + .setRegion(parts.getOrNull(1) ?: "") + .build() + } else { + Locale.Builder() + .setLanguage(tag) + .build() + } + } catch (_: Exception) { + Locale.getDefault() + } + } + + /** + * Restart activity to apply language change (Android < 13) + */ + fun restartActivity(context: Context) { + if (context is Activity && !useSystemLanguageSettings) { + context.recreate() + } + } + + /** + * Get current app locale + */ + @SuppressLint("ObsoleteSdkInt") + fun getCurrentAppLocale(context: Context): Locale? { + return if (useSystemLanguageSettings) { + // Android 13+ - get from system app locale settings + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { + try { + val localeManager = context.getSystemService(Context.LOCALE_SERVICE) as? android.app.LocaleManager + val locales = localeManager?.applicationLocales + if (locales != null && !locales.isEmpty) { + locales.get(0) + } else { + null // System default + } + } catch (_: Exception) { + null // System default + } + } else { + null // System default + } + } else { + // Android < 13 - get from SharedPreferences + val prefs = context.getSharedPreferences("settings", Context.MODE_PRIVATE) + val localeTag = prefs.getString("app_locale", "system") ?: "system" + if (localeTag == "system") { + null // System default + } else { + parseLocaleTag(localeTag) + } + } + } +} \ No newline at end of file diff --git a/manager/app/src/main/res/values-ar/strings.xml b/manager/app/src/main/res/values-ar/strings.xml index 9f3ce806..f534ebcc 100644 --- a/manager/app/src/main/res/values-ar/strings.xml +++ b/manager/app/src/main/res/values-ar/strings.xml @@ -309,9 +309,8 @@ يحتاج التطبيق إلى إعادة تشغيل لتطبيق الإعدادات الجديدة لإدارة شؤون الإعلام، ولا يؤثر على شريط حالة النظام أو التطبيقات الأخرى تم تعيين DPI إلى %1$d، فعلي بعد إعادة تشغيل التطبيق - لغة التطبيق - اتبع النظام - تم تغيير اللغة، إعادة التشغيل لتطبيق التغييرات + لغة التطبيق + اتبع النظام تعديل ظلام البطاقة رمز الخطأ diff --git a/manager/app/src/main/res/values-az/strings.xml b/manager/app/src/main/res/values-az/strings.xml index 66a45483..f1465e56 100644 --- a/manager/app/src/main/res/values-az/strings.xml +++ b/manager/app/src/main/res/values-az/strings.xml @@ -307,9 +307,8 @@ Application needs to be restarted to apply the new DPI settings, does not affect the system status bar or other applications DPI has been set to %1$d, effective after restarting the application - App Language - Follow System - Language changed, restarting to apply changes + App Language + Follow System Card Darkness Adjustment error code diff --git a/manager/app/src/main/res/values-bs/strings.xml b/manager/app/src/main/res/values-bs/strings.xml index 18808f7f..8c398b58 100644 --- a/manager/app/src/main/res/values-bs/strings.xml +++ b/manager/app/src/main/res/values-bs/strings.xml @@ -307,9 +307,8 @@ Application needs to be restarted to apply the new DPI settings, does not affect the system status bar or other applications DPI has been set to %1$d, effective after restarting the application - App Language - Follow System - Language changed, restarting to apply changes + App Language + Follow System Card Darkness Adjustment error code diff --git a/manager/app/src/main/res/values-da/strings.xml b/manager/app/src/main/res/values-da/strings.xml index 2c2d8b0a..b2e34d5e 100644 --- a/manager/app/src/main/res/values-da/strings.xml +++ b/manager/app/src/main/res/values-da/strings.xml @@ -307,9 +307,8 @@ Application needs to be restarted to apply the new DPI settings, does not affect the system status bar or other applications DPI has been set to %1$d, effective after restarting the application - App Language - Follow System - Language changed, restarting to apply changes + App Language + Follow System Card Darkness Adjustment error code diff --git a/manager/app/src/main/res/values-de/strings.xml b/manager/app/src/main/res/values-de/strings.xml index b27aea4c..d48e392b 100644 --- a/manager/app/src/main/res/values-de/strings.xml +++ b/manager/app/src/main/res/values-de/strings.xml @@ -309,9 +309,8 @@ Die Anwendung muss neu gestartet werden, um die neuen DPI-Einstellungen zu übernehmen, hat keine Auswirkungen auf die System-Statusleiste oder andere Anwendungen DPI wurde auf %1$dgesetzt, wirksam nach dem Neustart der Anwendung - App Sprache - Folge Systemeinstellung - Sprache geändert, Neustart um Änderungen zu übernehmen + App Sprache + Folge Systemeinstellung Kartenfinsternis Anpassung fehlercode diff --git a/manager/app/src/main/res/values-es/strings.xml b/manager/app/src/main/res/values-es/strings.xml index 967e6fcf..8d2b942b 100644 --- a/manager/app/src/main/res/values-es/strings.xml +++ b/manager/app/src/main/res/values-es/strings.xml @@ -307,9 +307,8 @@ La aplicación necesita reiniciarse para aplicar la nueva configuración DPI, no afecta a la barra de estado del sistema u otras aplicaciones DPI ha sido establecido a %1$d, efectivo después de reiniciar la aplicación - Idioma de la aplicación - Seguir sistema - Idioma cambiado, reiniciando para aplicar cambios + Idioma de la aplicación + Seguir sistema Ajuste de oscuridad de tarjeta código de error diff --git a/manager/app/src/main/res/values-et/strings.xml b/manager/app/src/main/res/values-et/strings.xml index f3bc289a..55fa5eac 100644 --- a/manager/app/src/main/res/values-et/strings.xml +++ b/manager/app/src/main/res/values-et/strings.xml @@ -307,9 +307,8 @@ Application needs to be restarted to apply the new DPI settings, does not affect the system status bar or other applications DPI has been set to %1$d, effective after restarting the application - App Language - Follow System - Language changed, restarting to apply changes + App Language + Follow System Card Darkness Adjustment error code diff --git a/manager/app/src/main/res/values-fa/strings.xml b/manager/app/src/main/res/values-fa/strings.xml index 760f4b95..6161867e 100644 --- a/manager/app/src/main/res/values-fa/strings.xml +++ b/manager/app/src/main/res/values-fa/strings.xml @@ -307,9 +307,8 @@ Application needs to be restarted to apply the new DPI settings, does not affect the system status bar or other applications DPI has been set to %1$d, effective after restarting the application - App Language - Follow System - Language changed, restarting to apply changes + App Language + Follow System Card Darkness Adjustment error code diff --git a/manager/app/src/main/res/values-fil/strings.xml b/manager/app/src/main/res/values-fil/strings.xml index a762616f..86b3ccbe 100644 --- a/manager/app/src/main/res/values-fil/strings.xml +++ b/manager/app/src/main/res/values-fil/strings.xml @@ -307,9 +307,8 @@ Application needs to be restarted to apply the new DPI settings, does not affect the system status bar or other applications DPI has been set to %1$d, effective after restarting the application - App Language - Follow System - Language changed, restarting to apply changes + App Language + Follow System Card Darkness Adjustment error code diff --git a/manager/app/src/main/res/values-fr/strings.xml b/manager/app/src/main/res/values-fr/strings.xml index fb87a32f..76833059 100644 --- a/manager/app/src/main/res/values-fr/strings.xml +++ b/manager/app/src/main/res/values-fr/strings.xml @@ -309,9 +309,8 @@ L\'application doit être redémarrée pour appliquer les nouveaux paramètres de DPI, n\'affecte pas la barre d\'état du système ou d\'autres applications Le DPI a été réglé sur %1$d, effectif après le redémarrage de l\'application - Langue de l\'application - Suivre le paramètre système - Langue modifiée, redémarrage pour appliquer les modifications + Langue de l\'application + Suivre le paramètre système Ajustement de l\'obscurité de la carte code d\'erreur diff --git a/manager/app/src/main/res/values-hi/strings.xml b/manager/app/src/main/res/values-hi/strings.xml index 8803d039..f30b051b 100644 --- a/manager/app/src/main/res/values-hi/strings.xml +++ b/manager/app/src/main/res/values-hi/strings.xml @@ -307,9 +307,8 @@ Application needs to be restarted to apply the new DPI settings, does not affect the system status bar or other applications DPI has been set to %1$d, effective after restarting the application - App Language - Follow System - Language changed, restarting to apply changes + App Language + Follow System Card Darkness Adjustment error code diff --git a/manager/app/src/main/res/values-hr/strings.xml b/manager/app/src/main/res/values-hr/strings.xml index 779dda8d..17c16c63 100644 --- a/manager/app/src/main/res/values-hr/strings.xml +++ b/manager/app/src/main/res/values-hr/strings.xml @@ -307,9 +307,8 @@ Application needs to be restarted to apply the new DPI settings, does not affect the system status bar or other applications DPI has been set to %1$d, effective after restarting the application - App Language - Follow System - Language changed, restarting to apply changes + App Language + Follow System Card Darkness Adjustment error code diff --git a/manager/app/src/main/res/values-hu/strings.xml b/manager/app/src/main/res/values-hu/strings.xml index ba073b04..02ccadbd 100644 --- a/manager/app/src/main/res/values-hu/strings.xml +++ b/manager/app/src/main/res/values-hu/strings.xml @@ -307,9 +307,8 @@ Application needs to be restarted to apply the new DPI settings, does not affect the system status bar or other applications DPI has been set to %1$d, effective after restarting the application - App Language - Follow System - Language changed, restarting to apply changes + App Language + Follow System Card Darkness Adjustment error code diff --git a/manager/app/src/main/res/values-idn/strings.xml b/manager/app/src/main/res/values-idn/strings.xml index 9a883b2d..9a922e99 100644 --- a/manager/app/src/main/res/values-idn/strings.xml +++ b/manager/app/src/main/res/values-idn/strings.xml @@ -317,9 +317,8 @@ Tanamkan: Secara permanen memasang ke sistem Aplikasi perlu dijalankan ulang agar pengaturan DPI baru diterapkan; ini tidak akan mempengaruhi bilah status sistem atau aplikasi lainnya DPI diatur ke %1$d, akan diterapkan setelah aplikasi dijalankan ulang - Bahasa Aplikasi - Ikuti Sistem - Bahasa diubah, mulai ulang untuk menerapkan perubahan + Bahasa Aplikasi + Ikuti Sistem Pengaturan Pencahayaan Kartu kode kesalahan diff --git a/manager/app/src/main/res/values-in/strings.xml b/manager/app/src/main/res/values-in/strings.xml index 3baf148a..9f2b1cd8 100644 --- a/manager/app/src/main/res/values-in/strings.xml +++ b/manager/app/src/main/res/values-in/strings.xml @@ -314,9 +314,8 @@ Aplikasi membutuhkan restar untuk menerapkan opsi DPI ini, perubahan ini tidak mengganggu DPI sistem DPI telah di rubah ke %1$d, efektif setelah aplikasi di restar - Bahasa Aplikasi - Mengikuti sistem - Bahasa dirubah, mulai ulang aplikasi untuk menerapkan + Bahasa Aplikasi + Mengikuti sistem Penyesuaian Kegelapan Kartu Kode error diff --git a/manager/app/src/main/res/values-it/strings.xml b/manager/app/src/main/res/values-it/strings.xml index d9a9d6f7..b884b415 100644 --- a/manager/app/src/main/res/values-it/strings.xml +++ b/manager/app/src/main/res/values-it/strings.xml @@ -309,9 +309,8 @@ Application needs to be restarted to apply the new DPI settings, does not affect the system status bar or other applications DPI has been set to %1$d, effective after restarting the application - App Language - Follow System - Language changed, restarting to apply changes + App Language + Follow System Card Darkness Adjustment error code diff --git a/manager/app/src/main/res/values-ja/strings.xml b/manager/app/src/main/res/values-ja/strings.xml index b4e674a9..ec925379 100644 --- a/manager/app/src/main/res/values-ja/strings.xml +++ b/manager/app/src/main/res/values-ja/strings.xml @@ -314,9 +314,8 @@ 変更した DPI 設定を適用するにはアプリを再起動する必要がありますが、システムステータスバーや他のアプリには影響しません DPI は %1$d に変更されました。アプリの再起動後に適用されます。 - アプリの言語 - システムに従う - 言語の変更を適用するために再起動しています + アプリの言語 + システムに従う カードの暗さを調整 エラーコード diff --git a/manager/app/src/main/res/values-kn/strings.xml b/manager/app/src/main/res/values-kn/strings.xml index 6bbee86a..9c25a442 100644 --- a/manager/app/src/main/res/values-kn/strings.xml +++ b/manager/app/src/main/res/values-kn/strings.xml @@ -307,9 +307,8 @@ Application needs to be restarted to apply the new DPI settings, does not affect the system status bar or other applications DPI has been set to %1$d, effective after restarting the application - App Language - Follow System - Language changed, restarting to apply changes + App Language + Follow System Card Darkness Adjustment error code diff --git a/manager/app/src/main/res/values-ko/strings.xml b/manager/app/src/main/res/values-ko/strings.xml index 38e0ee15..787f8525 100644 --- a/manager/app/src/main/res/values-ko/strings.xml +++ b/manager/app/src/main/res/values-ko/strings.xml @@ -307,9 +307,8 @@ Application needs to be restarted to apply the new DPI settings, does not affect the system status bar or other applications DPI has been set to %1$d, effective after restarting the application - App Language - Follow System - Language changed, restarting to apply changes + App Language + Follow System Card Darkness Adjustment error code diff --git a/manager/app/src/main/res/values-lt/strings.xml b/manager/app/src/main/res/values-lt/strings.xml index 6987bed2..0ae9d188 100644 --- a/manager/app/src/main/res/values-lt/strings.xml +++ b/manager/app/src/main/res/values-lt/strings.xml @@ -307,9 +307,8 @@ Application needs to be restarted to apply the new DPI settings, does not affect the system status bar or other applications DPI has been set to %1$d, effective after restarting the application - App Language - Follow System - Language changed, restarting to apply changes + App Language + Follow System Card Darkness Adjustment error code diff --git a/manager/app/src/main/res/values-lv/strings.xml b/manager/app/src/main/res/values-lv/strings.xml index 3e70c165..e099adf0 100644 --- a/manager/app/src/main/res/values-lv/strings.xml +++ b/manager/app/src/main/res/values-lv/strings.xml @@ -309,9 +309,8 @@ Application needs to be restarted to apply the new DPI settings, does not affect the system status bar or other applications DPI has been set to %1$d, effective after restarting the application - App Language - Follow System - Language changed, restarting to apply changes + App Language + Follow System Card Darkness Adjustment error code diff --git a/manager/app/src/main/res/values-mr/strings.xml b/manager/app/src/main/res/values-mr/strings.xml index 97473dce..d9e1b18e 100644 --- a/manager/app/src/main/res/values-mr/strings.xml +++ b/manager/app/src/main/res/values-mr/strings.xml @@ -307,9 +307,8 @@ Application needs to be restarted to apply the new DPI settings, does not affect the system status bar or other applications DPI has been set to %1$d, effective after restarting the application - App Language - Follow System - Language changed, restarting to apply changes + App Language + Follow System Card Darkness Adjustment error code diff --git a/manager/app/src/main/res/values-ms/strings.xml b/manager/app/src/main/res/values-ms/strings.xml index 314575c0..e8d18054 100644 --- a/manager/app/src/main/res/values-ms/strings.xml +++ b/manager/app/src/main/res/values-ms/strings.xml @@ -307,9 +307,8 @@ Application needs to be restarted to apply the new DPI settings, does not affect the system status bar or other applications DPI has been set to %1$d, effective after restarting the application - App Language - Follow System - Language changed, restarting to apply changes + App Language + Follow System Card Darkness Adjustment error code diff --git a/manager/app/src/main/res/values-nl/strings.xml b/manager/app/src/main/res/values-nl/strings.xml index 14dd8957..0f8ab30d 100644 --- a/manager/app/src/main/res/values-nl/strings.xml +++ b/manager/app/src/main/res/values-nl/strings.xml @@ -309,9 +309,8 @@ Application needs to be restarted to apply the new DPI settings, does not affect the system status bar or other applications DPI has been set to %1$d, effective after restarting the application - App Language - Follow System - Language changed, restarting to apply changes + App Language + Follow System Card Darkness Adjustment error code diff --git a/manager/app/src/main/res/values-pl/strings.xml b/manager/app/src/main/res/values-pl/strings.xml index 9346f91e..0a960c10 100644 --- a/manager/app/src/main/res/values-pl/strings.xml +++ b/manager/app/src/main/res/values-pl/strings.xml @@ -309,9 +309,8 @@ Application needs to be restarted to apply the new DPI settings, does not affect the system status bar or other applications DPI has been set to %1$d, effective after restarting the application - App Language - Follow System - Language changed, restarting to apply changes + App Language + Follow System Card Darkness Adjustment error code diff --git a/manager/app/src/main/res/values-pt/strings.xml b/manager/app/src/main/res/values-pt/strings.xml index 9a8406d2..9d556a25 100644 --- a/manager/app/src/main/res/values-pt/strings.xml +++ b/manager/app/src/main/res/values-pt/strings.xml @@ -307,9 +307,8 @@ O aplicativo precisa ser reiniciado para aplicar as novas configurações DPI, não afeta a barra de status do sistema ou outras aplicações DPI foi definido para %1$d, efetivo após reiniciar o aplicativo - Língua do aplicativo - Padrão do sistema - Idioma alterado, reiniciando para aplicar as alterações + Língua do aplicativo + Padrão do sistema Ajuste da escuridão do cartão Código de erro diff --git a/manager/app/src/main/res/values-ro/strings.xml b/manager/app/src/main/res/values-ro/strings.xml index 8e6affd2..92394bc4 100644 --- a/manager/app/src/main/res/values-ro/strings.xml +++ b/manager/app/src/main/res/values-ro/strings.xml @@ -309,9 +309,8 @@ Application needs to be restarted to apply the new DPI settings, does not affect the system status bar or other applications DPI has been set to %1$d, effective after restarting the application - App Language - Follow System - Language changed, restarting to apply changes + App Language + Follow System Card Darkness Adjustment error code diff --git a/manager/app/src/main/res/values-ru/strings.xml b/manager/app/src/main/res/values-ru/strings.xml index 85f644b8..db05b548 100644 --- a/manager/app/src/main/res/values-ru/strings.xml +++ b/manager/app/src/main/res/values-ru/strings.xml @@ -314,9 +314,8 @@ Приложение нужно перезапустить, чтобы применить новые настройки DPI. Это не влияет на системную строку состояния или другие приложения DPI был установлен в %1$d, действующий после перезапуска приложения - Язык приложения - Как в системе - Язык изменён, перезапуск для применения изменений + Язык приложения + Как в системе Затемнение карточек код ошибки diff --git a/manager/app/src/main/res/values-sl/strings.xml b/manager/app/src/main/res/values-sl/strings.xml index 85d14e86..e6cf3790 100644 --- a/manager/app/src/main/res/values-sl/strings.xml +++ b/manager/app/src/main/res/values-sl/strings.xml @@ -307,9 +307,8 @@ Application needs to be restarted to apply the new DPI settings, does not affect the system status bar or other applications DPI has been set to %1$d, effective after restarting the application - App Language - Follow System - Language changed, restarting to apply changes + App Language + Follow System Card Darkness Adjustment error code diff --git a/manager/app/src/main/res/values-th/strings.xml b/manager/app/src/main/res/values-th/strings.xml index dafa5827..e7fa4328 100644 --- a/manager/app/src/main/res/values-th/strings.xml +++ b/manager/app/src/main/res/values-th/strings.xml @@ -309,9 +309,8 @@ Application needs to be restarted to apply the new DPI settings, does not affect the system status bar or other applications DPI has been set to %1$d, effective after restarting the application - App Language - Follow System - Language changed, restarting to apply changes + App Language + Follow System Card Darkness Adjustment error code diff --git a/manager/app/src/main/res/values-tr/strings.xml b/manager/app/src/main/res/values-tr/strings.xml index 3b9780a8..e256246b 100644 --- a/manager/app/src/main/res/values-tr/strings.xml +++ b/manager/app/src/main/res/values-tr/strings.xml @@ -312,9 +312,8 @@ Yeni DPI ayarlarını uygulamak için uygulamanın yeniden başlatılması gerekir, sistem durum çubuğunu veya diğer uygulamaları etkilemez DPI %1$d olarak ayarlandı, uygulama yeniden başlatıldıktan sonra geçerli olur - Uygulama Dili - Sistemi takip et - Dil değiştirildi, değişiklikleri uygulamak için yeniden başlatılıyor + Uygulama Dili + Sistemi takip et Kart Karanlığını Ayarlama hata kodu diff --git a/manager/app/src/main/res/values-uk/strings.xml b/manager/app/src/main/res/values-uk/strings.xml index 27593eaa..e84a8f1f 100644 --- a/manager/app/src/main/res/values-uk/strings.xml +++ b/manager/app/src/main/res/values-uk/strings.xml @@ -312,9 +312,8 @@ Додаток потрібно перезапустити, щоб застосувати нові налаштування DPI; це не вплине на системний рядок стану або інші додатки DPI встановлено на %1$d, набуде чинності після перезапуску додатку - Мова додатку - Як у системі - Мову змінено, перезапуск для застосування змін + Мова додатку + Як у системі Налаштування затемнення карток код помилки diff --git a/manager/app/src/main/res/values-vi/strings.xml b/manager/app/src/main/res/values-vi/strings.xml index a6586dcf..0b5e6f14 100644 --- a/manager/app/src/main/res/values-vi/strings.xml +++ b/manager/app/src/main/res/values-vi/strings.xml @@ -312,9 +312,8 @@ Ứng dụng cần được khởi động lại để áp dụng cài đặt DPI mới, không ảnh hưởng đến thanh trạng thái hệ thống hoặc các ứng dụng khác DPI đã được đặt thành %1$d, có hiệu lực sau khi khởi động lại ứng dụng - Ngôn ngữ ứng dụng - Mặc định theo hệ thống - Ngôn ngữ đã thay đổi, khởi động lại để áp dụng thay đổi + Ngôn ngữ ứng dụng + Mặc định theo hệ thống Độ trong suốt của thẻ Error code diff --git a/manager/app/src/main/res/values-zh-rCN/strings.xml b/manager/app/src/main/res/values-zh-rCN/strings.xml index 844200d1..6a2235c1 100644 --- a/manager/app/src/main/res/values-zh-rCN/strings.xml +++ b/manager/app/src/main/res/values-zh-rCN/strings.xml @@ -312,9 +312,8 @@ 应用需要重启以应用新的 DPI 设置,不会影响系统状态栏或其他应用 DPI 已设置为 %1$d,重启应用后生效 - 应用语言 - 跟随系统 - 语言已更改,重启应用以应用更改 + 应用语言 + 跟随系统 卡片暗度调节 错误代码 diff --git a/manager/app/src/main/res/values-zh-rHK/strings.xml b/manager/app/src/main/res/values-zh-rHK/strings.xml index 8a15131e..395ce501 100644 --- a/manager/app/src/main/res/values-zh-rHK/strings.xml +++ b/manager/app/src/main/res/values-zh-rHK/strings.xml @@ -309,9 +309,8 @@ 應用需要重新啟動以應用新嘅 DPI 配置,唔會影響系統狀態欄或其他應用 DPI 已設定為 %1$d,重新啟動應用後生效 - 應用語言 - 跟隨系統 - 語言已更改,重新啟動應用以應用更改 + 應用語言 + 跟隨系統 卡片暗度調節 錯誤代碼 diff --git a/manager/app/src/main/res/values-zh-rTW/strings.xml b/manager/app/src/main/res/values-zh-rTW/strings.xml index 62edc9ae..db9f0479 100644 --- a/manager/app/src/main/res/values-zh-rTW/strings.xml +++ b/manager/app/src/main/res/values-zh-rTW/strings.xml @@ -312,9 +312,8 @@ 應用程式需重新啟動以套用新的 DPI 設定,不會影響系統狀態列或其他應用程式 DPI 已設為 %1$d,重新啟動應用程式後生效 - 應用程式語言 - 跟隨系統 - 語言已更改,重新啟動應用程式以套用變更 + 應用程式語言 + 跟隨系統 卡片暗度調整 錯誤代碼 diff --git a/manager/app/src/main/res/values/strings.xml b/manager/app/src/main/res/values/strings.xml index c0e10bbf..63d2451a 100644 --- a/manager/app/src/main/res/values/strings.xml +++ b/manager/app/src/main/res/values/strings.xml @@ -314,9 +314,8 @@ Application needs to be restarted to apply the new DPI settings, does not affect the system status bar or other applications DPI has been set to %1$d, effective after restarting the application - App Language - Follow System - Language changed, restarting to apply changes + App Language + Follow System Card Darkness Adjustment error code