internetarchive / internetarchive/openlibrary

Arabic (ar) pluralization incorrect in message file

Open
#12,461 4 comments 0 reactions 1 assignee Claimed by @joannajiang711 View on GitHub
Lead: @cdrini Needs: Review Assignee Priority: 4 Theme: Internationalization (i18n) Type: Bug
Dominant language
Python
Stars
6.7k
Forks
2k
Avg merge
2d 19h
Merged PRs (30d)
138

Description

### Problem

A native Arabic speaker should verify this, but the current declaration of `Plural-forms` appears incorrect for Arabic and it should be six forms, not three, per https://github.com/ergenius/gettext-po-samples/blob/596e24c081dd88cf4644dd4d11ff90de1814daad/po/ar.po#L13 and some other Internet references.

The canonical CLDR definition is here: https://www.unicode.org/cldr/charts/48/supplemental/language_plural_rules.html#ar

The current declaration is: https://github.com/internetarchive/openlibrary/blob/4f4def6691ac3fda9b747f1775613812f5b1d53b/openlibrary/i18n/ar/messages.po#L15

and should instead be:
```
"Plural-Forms: nplurals=6; plural=((n == 0) ? 0 : ((n == 1) ? 1 : ((n == 2) ? 2 : ((n % 100 >= 3 && n % 100 <= 10) ? 3 : ((n % 100 >= 11 && n % 100 <= 99) ? 4 : 5)))));\n"
```

### Reproducing the bug

1. Go to ...
2. Do ...

* Expected behavior:
* Actual behavior:

### Context

- Browser (Chrome, Safari, Firefox, etc):
- OS (Windows, Mac, etc):
- Logged in (Y/N):
- Environment (prod, dev, local): prod

### Breakdown

Implementation Details (for maintainers)

#### Requirements Checklist
* [ ]

#### Related files

*

#### Stakeholders

*


#### Instructions for Contributors

- Please [run these commands](https://docs.openlibrary.org/developers/tools/git.html#working-on-your-branch) to ensure your repository is up to date **before** [creating a new branch](https://docs.openlibrary.org/developers/tools/git.html#making-changes-and-creating-a-pull-request) to work on this issue and **each time after** pushing code to Github, because the pre-commit bot may add commits to your PRs upstream.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.