diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 6c40127d..517f0395 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,3 +1,5 @@ +@file:Suppress("UnstableApiUsage")// androidResources.localeFilters + plugins { id("easter.egg.app") } @@ -5,13 +7,8 @@ plugins { android { namespace = "com.dede.android_eggs" - defaultConfig { - applicationId = "com.dede.android_eggs" - versionCode = 58 - versionName = "3.4.0" - testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" - - resourceConfigurations += listOf( + androidResources { + localeFilters += listOf( "zh", "zh-rTW", "ru", "uk-rUA", "en", "it", "de", "fr", "nl-rNL", "hu-rHU", @@ -20,11 +17,18 @@ android { "ja-rJP", "ko-rKR", "vi-rVN", "th-rTH", "fil-rPH", "lo-rLA", "ar-rSA", "cs-rCZ", "ta-rIN", "ro-rRO", "sv-rSE", "my-rMM", ) + } + + defaultConfig { + applicationId = "com.dede.android_eggs" + versionCode = 58 + versionName = "3.4.0" + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" setProperty("archivesBaseName", "easter_eggs_${versionName}_${versionCode}") // Language configuration only - buildConfigField("int", "LANGUAGE_RES", resourceConfigurations.size.toString()) + buildConfigField("int", "LANGUAGE_RES", androidResources.localeFilters.size.toString()) } signingConfigs { diff --git a/app/src/main/java/com/dede/android_eggs/views/settings/compose/prefs/LanguagePref.kt b/app/src/main/java/com/dede/android_eggs/views/settings/compose/prefs/LanguagePref.kt index 98fb7e87..0ae348f6 100644 --- a/app/src/main/java/com/dede/android_eggs/views/settings/compose/prefs/LanguagePref.kt +++ b/app/src/main/java/com/dede/android_eggs/views/settings/compose/prefs/LanguagePref.kt @@ -172,7 +172,7 @@ object LanguagePrefUtil { // check gradle resourceConfigurations count actual = BuildConfig.LANGUAGE_RES check(expected == actual) { - "android.defaultConfig.resourceConfigurations length, expected: %d, actual: %d." + "android.androidResources.localeFilters length, expected: %d, actual: %d." .format(expected, actual) } }