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

[i18n] Add irregular pluralizations #629

Closed
19 tasks
obulat opened this issue Jan 25, 2022 · 0 comments · Fixed by #5177
Closed
19 tasks

[i18n] Add irregular pluralizations #629

obulat opened this issue Jan 25, 2022 · 0 comments · Fixed by #5177
Assignees
Labels
💻 aspect: code Concerns the software code in the repository ✨ goal: improvement Improvement to an existing user-facing feature 🟩 priority: low Low priority and doesn't need to be rushed 🧱 stack: frontend Related to the Nuxt frontend

Comments

@obulat
Copy link
Contributor

obulat commented Jan 25, 2022

Problem

Some languages have more than one plural noun form that correspond to different numbers. We need to set up the pluralization for languages other than Russian.

Description

Vue-i18n uses the pluralization config to select the correct form, and here is the example implementation for Russian:
https://github.com/WordPress/openverse-frontend/blob/0f784f4df9fdf4b460dab387f0877229420efebc/src/plugins/vue-i18n.js#L11-L30
This corresponds to the following config in the .po format:
"pluralExpression": "(n % 10 == 1 && n % 100 != 11) ? 0 : ((n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14)) ? 1 : 2)",

It is OK to create one PR per single locale group with the same pluralExpression, one from the following list:

Locales:

  • Arabic ar, Algerian Arabic arq, Moroccan Arabic ary
  • Bengali (India) bn_IN, Breton bre, Persian (Afghanistan) fa_AF, Persian fa_IR, French (Belgium) fr_BE, French (Canada) fr_CA, French (France) fr_FR, Arpitan frp, Borana-Arsi-Guji Oromo gax, Indonesian id_ID, Kabyle kab, Lingala lin, Maori mri, Occitan oci, Picard pcd, Portuguese (Brazil) pt_BR, Saraiki skr, Tahitian tah, Turkish tr_TR, Turkmen tuk, Tamazight (Central Atlas) tzm
  • Cornish cor
  • Czech cs_CZ, Slovak sk_SK
  • Welsh cy
  • Lower Sorbian dsb, Upper Sorbian hsb, Slovenian `sl_SI
  • Irish ga
  • Scottish Gaelic gd
  • Icelandic is_IS', 'Macedonian mk_MK
  • Lithuanian lt_LT
  • Latvian lv
  • Montenegrin me_ME
  • Polish pl_PL
  • Romanian ro_RO
  • Silesian szl
  • Tamazight zgh

These locales use a single version, so probably don't need any pluralization set up?

  • Emoji art_xemoji, Balochi Southern bcc, Tibetan bo, Dzongkha dzo, Igbo ibo, Japanese ja, Georgian ka_GE, Kyrgyz kir, Khmer km, Korean ko_KR, Lao lo, Mauritian Creole mfe, Malay ms_MY, Rohingya rhg, Sundanese su_ID, Thai th, Tigrinya tir, Tatar tt_RU, Uzbek uz_UZ, Vietnamese vi, Wolof wol, Chinese (China) zh_CN, Chinese (Hong Kong) zh_HK, Chinese (Singapore) zh_SG, Chinese (Taiwan) zh_TW

These locales should use the same rules as Russian:

  • Belarusian bel, Ukrainian uk, Serbian sr_RS, Croatian hr, Bosnian bs_BA

Additional context

To get the .po format pluralization rules, run pnpm run dev. This should create a src/locales/scripts/wp-locales.json file, with an object with locale properties for all available locales. Only the locales with irregular plurals have the "pluralExpression" property.

Implementation

  • 🙋 I would be interested in implementing this feature.
@obulat obulat added 🟩 priority: low Low priority and doesn't need to be rushed 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work ✨ goal: improvement Improvement to an existing user-facing feature 💻 aspect: code Concerns the software code in the repository labels Jan 25, 2022
@obulat obulat changed the title <Replace this with actual title> [i18n] Add irregular pluralizations Jan 25, 2022
@obulat obulat removed the 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work label Feb 15, 2022
@obulat obulat transferred this issue from WordPress/openverse-frontend Feb 22, 2023
@obulat obulat added the 🧱 stack: frontend Related to the Nuxt frontend label Feb 22, 2023
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Openverse Backlog Feb 23, 2023
@obulat obulat mentioned this issue Nov 22, 2024
8 tasks
@openverse-bot openverse-bot moved this from 📋 Backlog to ✅ Done in Openverse Backlog Dec 4, 2024
@obulat obulat self-assigned this Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💻 aspect: code Concerns the software code in the repository ✨ goal: improvement Improvement to an existing user-facing feature 🟩 priority: low Low priority and doesn't need to be rushed 🧱 stack: frontend Related to the Nuxt frontend
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant