Skip to content

Pluralisation always uses the other variant #398

Description

@dolezvo1

I'm not sure if I'm not missing something, but I tried to use pluralisation like this:

-terms-email = { $count ->
   [one] email
  *[other] emails
}
delete-emails = Delete { $count } { -terms-email($count) }
let msg = bundle.get_message("delete-emails").unwrap();
let pattern = msg.value().unwrap();
let mut args = fluent_bundle::FluentArgs::new();
args.set("count", count);
let mut errors = Vec::new();
let r = bundle.format_pattern(&pattern, Some(&args), &mut errors);
if !errors.is_empty() {
    println!("errors: {:?}", errors);
}
r

What I'm experiencing is that I am unable to get the library use the singular or the few form. It just always seems to use the other form, i.e. Delete 1 emails.

This is quite surprising, since I could not find any explicit mention of any Project Fluent features not being supported, much less features that are showcased on Project Fluent's main page.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions