diff --git a/app/src/main/java/com/github/libretube/MainActivity.kt b/app/src/main/java/com/github/libretube/MainActivity.kt
index 49a497a30..f68cf203b 100644
--- a/app/src/main/java/com/github/libretube/MainActivity.kt
+++ b/app/src/main/java/com/github/libretube/MainActivity.kt
@@ -43,8 +43,10 @@ class MainActivity : AppCompatActivity() {
DynamicColors.applyToActivitiesIfAvailable(application)
val languageName = sharedPreferences.getString("language", "sys")
if (languageName != "") {
- var locale = if (languageName != "sys") {
+ var locale = if (languageName != "sys" && "$languageName".length < 3 ){
Locale(languageName)
+ } else if ("$languageName".length > 3) {
+ Locale(languageName?.substring(0,2), languageName?.substring(4,6))
} else {
Locale.getDefault()
}
diff --git a/app/src/main/res/values/array.xml b/app/src/main/res/values/array.xml
index d2bd2232d..a68fe1239 100644
--- a/app/src/main/res/values/array.xml
+++ b/app/src/main/res/values/array.xml
@@ -452,7 +452,7 @@
- fa
- pl
- pt
- - pr-rBR
+ - pt-rBR
- ru
- ckb
- es