Thread
#moko
    jeran

    jeran

    3 months ago
    hello all. my team is using moko resources for KMM. first of all, thank you for all the work! we’re working with formatting plurals and realized that the “zero” type works differently on iOS and on Android. saw this comment in one of the tests:
    // 0 on android in english will be other
    the strings we’re hoping to achieve are: x == 0 -> “Just now” x == 1 -> “1 hour ago” x > 1 -> “x hours ago” how can we achieve this if android doesn’t match zero properly? https://github.com/icerockdev/moko-resources/blob/a4759a4439a492b6b8a6f7fa631be7cf[…]library/src/commonMain/kotlin/com/icerockdev/library/Testing.kt
    alex009

    alex009

    3 months ago
    hi. as i see - only way is process zero count by another logic. something like
    if(counter == 0) MR.strings.some_zero_text.desc()
    else MR.strings.some_plural.desc(counter)
    jeran

    jeran

    3 months ago
    oh i see. this is how the pure android version works as well. i didn’t realize it was expected behavior. thank you