Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The 'ZERO' plural resolver for pt_BR is wrong #809

Open
emersonsiega opened this issue Mar 5, 2024 · 0 comments
Open

The 'ZERO' plural resolver for pt_BR is wrong #809

emersonsiega opened this issue Mar 5, 2024 · 0 comments
Labels
type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@emersonsiega
Copy link

emersonsiega commented Mar 5, 2024

Describe the bug
In Brazilian Portuguese, the zero is considered a plural.
Like: 0 apples, 0 transactions, and so on..

The Intl.plural is incorrectly resolving ZERO as ONE.

To Reproduce
Correct result for en_US:

import 'package:intl/intl.dart';

void main() {  
  final number = 0;
  final other = '0 apples';
  final one = '0 apple';
  
  final plural = Intl.plural(
      number,
      one: one,
      other: other,
    );
  
  print(plural); 
  //PRINTS: 0 apples
}

Incorrect result for pt_BR:

import 'package:intl/intl.dart';

void main() {
  Intl.defaultLocale = 'pt_BR';
  
  final number = 0;
  final other = '0 apples';
  final one = '0 apple';
  
  final plural = Intl.plural(
      number,
      one: one,
      other: other,
    );
  
  print(plural);  
  //PRINTS: 0 apple
}
@emersonsiega emersonsiega added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

1 participant