[PR #678] [MERGED] I18n plural forms #1379

Closed
opened 2026-05-07 01:01:50 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/binwiederhier/ntfy/pull/678
Author: @bmoczulski
Created: 3/21/2023
Status: Merged
Merged: 3/25/2023
Merged by: @binwiederhier

Base: mainHead: i18n-plural-forms


📝 Commits (2)

  • 338cab1 i18n: Introduce plural forms for reservations, emails, messages
  • 80b0a94 i18n-pl: Provide translations for plural forms of reservations. emails, messages

📊 Changes

3 files changed (+19 additions, -7 deletions)

View changed files

📝 web/public/static/langs/en.json (+6 -3)
📝 web/public/static/langs/pl.json (+10 -1)
📝 web/src/components/UpgradeDialog.js (+3 -3)

📄 Description

While working on Polish translations I noticed that some labels can't be translated correctly due lack of plural forms. In Polish there are two plural forms of nouns - one for cadrinality 2-4 mod 10 (except 12-14) and the another for everything else > 1. Other languages have different rules for plurals, sometimes even more complex. Considering that both react-i18next and Weblate fully support translation of plural forms I propose to change the affected entries by adding {count: n} to relevant t() calls and _one/_other suffix for English translation. This will make both systems aware of plurality of these labels. Weblate will show a form with all required plural variants in a given language and react-i18next will look for appropriate suffixes based on count and language.

This is my firs PR here so let me take the opportunity to congratulate you on creating this awesome utility. I'm currently evaluating ntfy in my monitoring deployment and I have to admit I'm impressed by the plethora of features and comprehensive documentation. Well done! The very least I can do in return is to provide some translations in my mother tongue.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/binwiederhier/ntfy/pull/678 **Author:** [@bmoczulski](https://github.com/bmoczulski) **Created:** 3/21/2023 **Status:** ✅ Merged **Merged:** 3/25/2023 **Merged by:** [@binwiederhier](https://github.com/binwiederhier) **Base:** `main` ← **Head:** `i18n-plural-forms` --- ### 📝 Commits (2) - [`338cab1`](https://github.com/binwiederhier/ntfy/commit/338cab1660cfde9dbae40d5ce345c8f645f86c52) i18n: Introduce plural forms for reservations, emails, messages - [`80b0a94`](https://github.com/binwiederhier/ntfy/commit/80b0a94f7e63a479e6197472e8d1ee4f6fd046ae) i18n-pl: Provide translations for plural forms of reservations. emails, messages ### 📊 Changes **3 files changed** (+19 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `web/public/static/langs/en.json` (+6 -3) 📝 `web/public/static/langs/pl.json` (+10 -1) 📝 `web/src/components/UpgradeDialog.js` (+3 -3) </details> ### 📄 Description While working on Polish translations I noticed that some labels can't be translated correctly due lack of plural forms. In Polish there are two plural forms of nouns - one for cadrinality 2-4 mod 10 (except 12-14) and the another for everything else > 1. Other languages have different rules for plurals, sometimes even more complex. Considering that both react-i18next and Weblate fully support translation of plural forms I propose to change the affected entries by adding `{count: n}` to relevant `t()` calls and `_one/_other` suffix for English translation. This will make both systems aware of plurality of these labels. Weblate will show a form with all required plural variants in a given language and react-i18next will look for appropriate suffixes based on `count` and language. This is my firs PR here so let me take the opportunity to congratulate you on creating this awesome utility. I'm currently evaluating ntfy in my monitoring deployment and I have to admit I'm impressed by the plethora of features and comprehensive documentation. Well done! The very least I can do in return is to provide some translations in my mother tongue. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-07 01:01:50 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ntfy#1379
No description provided.