Skip to content

Commit

Permalink
Merge pull request #1828 from HedvigInsurance/fix/handle_odd_locales
Browse files Browse the repository at this point in the history
Default to a language instead of crashing
  • Loading branch information
StylianosGakis authored Oct 16, 2023
2 parents acab349 + eccef66 commit 6c5cbcb
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.hedvig.android.language

import androidx.annotation.StringRes
import com.hedvig.android.logger.LogPriority
import com.hedvig.android.logger.logcat
import giraffe.type.Locale

enum class Language {
Expand Down Expand Up @@ -70,7 +72,7 @@ enum class Language {
SETTING_EN_NO -> EN_NO
SETTING_DA_DK -> DA_DK
SETTING_EN_DK -> EN_DK
else -> throw RuntimeException("Invalid language value: $value")
else -> EN_SE.also { logcat(LogPriority.WARN) { "Defaulting to EN_SE for language tag: $value" } }
}
}
}

0 comments on commit 6c5cbcb

Please sign in to comment.