Skip to content

Incorrect handling of empty string in pluralization for n = 0 #1972

@anonymous-aka

Description

@anonymous-aka

Reporting a bug?

In the latest update of vue-i18n (checked on v10.0.1), there seems to be an issue with pluralization when handling an empty string for the n = 0 case. The expected behavior is for the translation function to return an empty string when n is 0, but instead, it returns undefined.

Expected behavior

case n = 0 should return an <empty string> and not 'undefined'.

Reproduction

Please follow the link for the minimal reproduction:
https://stackblitz.com/edit/vitejs-vite-9tydzp?file=src%2FApp.vue

System Info

System:
    OS: macOS 13.6.7
    CPU: (8) arm64 Apple M2
    Memory: 124.00 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
Binaries:
    Node: 20.14.0 - ~/.nvm/versions/node/v20.14.0/bin/node
    npm: 10.7.0 - ~/.nvm/versions/node/v20.14.0/bin/npm
Browsers:
    Chrome: 129.0.6668.59

Screenshot

No response

Additional context

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: PR WelcomeWelcome to Pull RequestType: BugBug or Bug fixes🔨 p3-minor-bugPriority 3: a bug in an edge case that only affects very specific usage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions