Skip to content

Commit

Permalink
Update LanguageSettingsFragment.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
KesharwaniArpita authored Oct 19, 2024
1 parent 16be181 commit e0d368a
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions app/src/main/java/be/scri/fragments/LanguageSettingsFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -261,17 +261,15 @@ class LanguageSettingsFragment : Fragment() {
}

fun getLanguageStringFromi18n(language: String): Int {
val languageStringResource = when (language) {
"German" -> R.string.app__global_german
"French" -> R.string.app__global_french
"Spanish" -> R.string.app__global_spanish
"Italian" -> R.string.app__global_italian
"Russian" -> R.string.app__global_russian
"Portuguese" -> R.string.app__global_portuguese
"Swedish" -> R.string.app__global_swedish
else -> R.string.app__global_english
}
return languageStringResource
val languageMap = mapOf(
"German" to R.string.app__global_german,
"French" to R.string.app__global_french,
"Spanish" to R.string.app__global_spanish,
"Italian" to R.string.app__global_italian,
"Russian" to R.string.app__global_russian,
"Portuguese" to R.string.app__global_portuguese,
"Swedish" to R.string.app__global_swedish
)
return languageMap[language] ?: R.string.app__global_english
}

}

0 comments on commit e0d368a

Please sign in to comment.