Browse Source

Fallback to `other` pluralization when the right one not found

pull/4519/head
Chanjung Kim 8 months ago
parent
commit
877fbcc2b0
  1. 3
      components/resources/library/src/commonMain/kotlin/org/jetbrains/compose/resources/StringResources.kt

3
components/resources/library/src/commonMain/kotlin/org/jetbrains/compose/resources/StringResources.kt

@ -235,7 +235,8 @@ private suspend fun loadPluralString(
)
val pluralCategory = pluralRuleList.getCategory(quantity)
val str = item.items[pluralCategory]
?: error("String ID=`${resource.key}` does not have the pluralization $pluralCategory for quantity $quantity!")
?: item.items[PluralCategory.OTHER]
?: error("Quantity string ID=`${resource.key}` does not have the pluralization $pluralCategory for quantity $quantity!")
return str
}

Loading…
Cancel
Save