Skip to content

Commit d96e8cb

Browse files
authored
feat(l10n): enable i18next plurals (PR #2743)
1 parent d44dab3 commit d96e8cb

33 files changed

+162
-144
lines changed

src/renderer/common/components/ImportAnnotationsDialog.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@ export const ImportAnnotationsDialog: React.FC<React.PropsWithChildren<{ winId:
7373
<span>{originTitle ? __("dialog.annotations.origin", { title: originTitle, author: originCreator ? __("dialog.annotations.descAuthor", { author: originCreator }) : "" }) : ""}</span>
7474
<span>{title ? `${__("dialog.annotations.descTitle")}'${title}'` : ""}</span>
7575
<span>{annotationsList.length ? __("dialog.annotations.descList", {
76-
nb: annotationsList.length,
76+
count: annotationsList.length,
7777
creator: creatorNameList.length ? `${__("dialog.annotations.descCreator")} '${creatorNameList.join(", ")}'` : "", // TODO i18n
7878
title: convertMultiLangStringToString(publicationTitle, locale),
7979
author: authorsLangString[0] ? __("dialog.annotations.descAuthor", { author: convertMultiLangStringToString(authorsLangString[0], locale) }) : "",
8080
}) : <></>}</span>
81-
<span>{annotationsConflictListNewer.length ? __("dialog.annotations.descNewer", { nb: annotationsConflictListNewer.length }) : <></>}</span>
82-
<span>{annotationsConflictListOlder.length ? __("dialog.annotations.descOlder", { nb: annotationsConflictListOlder.length }) : <></>}</span>
81+
<span>{annotationsConflictListNewer.length ? __("dialog.annotations.descNewer", { count: annotationsConflictListNewer.length }) : <></>}</span>
82+
<span>{annotationsConflictListOlder.length ? __("dialog.annotations.descOlder", { count: annotationsConflictListOlder.length }) : <></>}</span>
8383
</AlertDialog.Description>
8484
<div className={stylesAlertModals.AlertDialogButtonContainer}>
8585
<AlertDialog.Cancel asChild onClick={() => dispatch(annotationActions.importConfirmOrAbort.build("abort"))}>

src/renderer/reader/components/ReaderMenu.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1550,7 +1550,7 @@ const AnnotationList: React.FC<{ /*annotationUUIDFocused: string, resetAnnotatio
15501550
<AlertDialog.Content className={stylesAlertModals.AlertDialogContent}>
15511551
<AlertDialog.Title className={stylesAlertModals.AlertDialogTitle}>{__("dialog.deleteAnnotations")}</AlertDialog.Title>
15521552
<AlertDialog.Description className={stylesAlertModals.AlertDialogDescription}>
1553-
{__("dialog.deleteAnnotationsText", { annotationListLength: annotationListFiltered.length })}
1553+
{__("dialog.deleteAnnotationsText", { count: annotationListFiltered.length })}
15541554
</AlertDialog.Description>
15551555
<div className={stylesAlertModals.AlertDialogButtonContainer}>
15561556
<AlertDialog.Cancel asChild>
@@ -2267,7 +2267,7 @@ const BookmarkList: React.FC<{ popoverBoundary: HTMLDivElement, hideBookmarkOnCh
22672267
<AlertDialog.Content className={stylesAlertModals.AlertDialogContent}>
22682268
<AlertDialog.Title className={stylesAlertModals.AlertDialogTitle}>{__("dialog.deleteBookmarks")}</AlertDialog.Title>
22692269
<AlertDialog.Description className={stylesAlertModals.AlertDialogDescription}>
2270-
{__("dialog.deleteBookmarksText", { bookmarkListLength: bookmarkListFiltered.length })}
2270+
{__("dialog.deleteBookmarksText", { count: bookmarkListFiltered.length })}
22712271
</AlertDialog.Description>
22722272
<div className={stylesAlertModals.AlertDialogButtonContainer}>
22732273
<AlertDialog.Cancel asChild>

src/renderer/reader/components/ReaderMenuSearch.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ class ReaderMenuSearch extends React.Component<IProps, IState> {
218218
const { __ } = this.props;
219219

220220
const label = this.props.foundArray?.length ?
221-
__("reader.picker.search.founds", {nResults: this.props.foundArray.length}) :
221+
__("reader.picker.search.founds", {count: this.props.foundArray.length}) :
222222
__("reader.picker.search.notFound");
223223

224224
const memoJsx = renderSearchLinks(label, this.props.foundArray, this.state.nMatchPage, this.props.readingOrder, this.props.toc, this.props.dockedMode, this);
@@ -300,7 +300,7 @@ class ReaderMenuSearch extends React.Component<IProps, IState> {
300300
margin: 0,
301301
marginTop: "-16px",
302302
marginBottom: "20px",
303-
}}>{`[ ${begin === end ? `${end}` : `${begin} ... ${end}`} ] / ${__("reader.picker.search.founds", {nResults: this.props.foundArray.length})}`}</p>
303+
}}>{`[ ${begin === end ? `${end}` : `${begin} ... ${end}`} ] / ${__("reader.picker.search.founds", {count: this.props.foundArray.length})}`}</p>
304304
: <></>
305305
}
306306
</>);

src/renderer/reader/components/picker/Search.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class SearchPicker extends React.Component<IProps, IState> {
100100

101101
const found = foundNumber === 0 ?
102102
__("reader.picker.search.notFound") :
103-
__("reader.picker.search.founds", {nResults: foundNumber});
103+
__("reader.picker.search.founds", {count: foundNumber});
104104

105105
this.loadSeq = this.props.isPdf ? 999 : (this.loadSeq || 0) + 1;
106106

src/resources/locales/ar.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@
139139
"annotations": {
140140
"descAuthor": "تأليف '{{- author}}'",
141141
"descCreator": "أنشأه",
142-
"descList": "سيتم استيراد {{- nb}} ملاحظة (ملاحظات) من {{- creator}} إلى '{{- title}}' لـ {{- author}}",
143-
"descNewer": "تعارض: {{- nb}} ملاحظة (ملاحظات) أحدث",
144-
"descOlder": "تعارض: {{- nb}} ملاحظة (ملاحظات) أقدم",
142+
"descList": "سيتم استيراد {{- count}} ملاحظة (ملاحظات) من {{- creator}} إلى '{{- title}}' لـ {{- author}}",
143+
"descNewer": "تعارض: {{- count}} ملاحظة (ملاحظات) أحدث",
144+
"descOlder": "تعارض: {{- count}} ملاحظة (ملاحظات) أقدم",
145145
"descTitle": "عنوان التعليقات: ",
146146
"importAll": "استيراد كل الملاحظات",
147147
"importWithoutConflict": "استيراد الملاحظات غير المتعارضة فقط",
@@ -157,9 +157,9 @@
157157
}
158158
},
159159
"deleteAnnotations": "حذف التعليقات؟",
160-
"deleteAnnotationsText": "هل أنت متأكد من حذف {{- annotationListLength}} ملاحظة (ملاحظات)؟",
160+
"deleteAnnotationsText": "هل أنت متأكد من حذف {{- count}} ملاحظة (ملاحظات)؟",
161161
"deleteBookmarks": "حذف الإشارات المرجعية؟",
162-
"deleteBookmarksText": "هل أنت متأكد من حذف {{- bookmarkListLength}} إشارة (إشارات) مرجعية؟",
162+
"deleteBookmarksText": "هل أنت متأكد من حذف {{- count}} إشارة (إشارات) مرجعية؟",
163163
"deleteFeed": "حذف الفهرس؟",
164164
"deletePublication": "حذف المنشور؟",
165165
"deletePublicationWithNotes": "تحذير: يحتوي هذا المنشور على تعليقات و/أو إشارات مرجعية، سيتم حذفها أيضًا! (إذا كنت ترغب في الاحتفاظ بها، تأكد من تصدير الملاحظات قبل إزالة المنشور)",
@@ -768,7 +768,7 @@
768768
},
769769
"picker": {
770770
"search": {
771-
"founds": "تم العثور على {{- nResults}} تطابقات",
771+
"founds": "تم العثور على {{- count}} تطابقات",
772772
"input": "النص المطلوب مطابقته",
773773
"next": "التالي",
774774
"notFound": "لم يتم العثور على تطابقات",

src/resources/locales/bg.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@
768768
},
769769
"picker": {
770770
"search": {
771-
"founds": "{{- nResults}} съвпадение(ия)",
771+
"founds": "{{- count}} съвпадение(ия)",
772772
"input": "текст за търсене",
773773
"next": "Следващ",
774774
"notFound": "няма съвпадения",

src/resources/locales/ca.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@
768768
},
769769
"picker": {
770770
"search": {
771-
"founds": "{{- nResults}} trobat/s",
771+
"founds": "{{- count}} trobat/s",
772772
"input": "text de cerca",
773773
"next": "Següent",
774774
"notFound": "no hi ha coincidències",

src/resources/locales/cs.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@
139139
"annotations": {
140140
"descAuthor": "autor: {{- author}}",
141141
"descCreator": "vytvořil(a)",
142-
"descList": "{{- nb}} poznámek od {{- creator}} bude importováno do „{{- title}}“, {{- author}}",
143-
"descNewer": "Konflikt(y): {{- nb}} novější poznámka (novější poznámky)",
144-
"descOlder": "Konflikt(y): {{- nb}} starší poznámka (starší poznámky)",
142+
"descList": "{{- count}} poznámek od {{- creator}} bude importováno do „{{- title}}“, {{- author}}",
143+
"descNewer": "Konflikt(y): {{- count}} novější poznámka (novější poznámky)",
144+
"descOlder": "Konflikt(y): {{- count}} starší poznámka (starší poznámky)",
145145
"descTitle": "Anotace titulu: ",
146146
"importAll": "Importovat všechny poznámky",
147147
"importWithoutConflict": "Importovat pouze poznámky bez konfliktů",
@@ -157,9 +157,9 @@
157157
}
158158
},
159159
"deleteAnnotations": "Odstranit anotace?",
160-
"deleteAnnotationsText": "Opravdu chcete odstranit {{- annotationListLength}} poznámek?",
160+
"deleteAnnotationsText": "Opravdu chcete odstranit {{- count}} poznámek?",
161161
"deleteBookmarks": "Odstranit záložky?",
162-
"deleteBookmarksText": "Jste si jisti, že chcete odstranit {{- bookmarkListLength}} záložek?",
162+
"deleteBookmarksText": "Jste si jisti, že chcete odstranit {{- count}} záložek?",
163163
"deleteFeed": "Odstranit katalog?",
164164
"deletePublication": "Odstranit publikaci?",
165165
"deletePublicationWithNotes": "Upozornění: tato publikace obsahuje anotace a/nebo záložky, které budou taktéž smazány! (pokud si je chcete ponechat, před odstraněním publikace poznámky exportujte)",
@@ -768,7 +768,7 @@
768768
},
769769
"picker": {
770770
"search": {
771-
"founds": "{{- nResults}} shod",
771+
"founds": "{{- count}} shod",
772772
"input": "přesná shoda",
773773
"next": "Další",
774774
"notFound": "žádná shoda",

src/resources/locales/da.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@
139139
"annotations": {
140140
"descAuthor": "af {{- author}}",
141141
"descCreator": "lavet af",
142-
"descList": "{{- nb}} note(r) fra {{- creator}} vil blive associeret med {{- title}} {{- author}}",
143-
"descNewer": "{{- nb}} nyere version af disse noter er allerede associeret med denne bog",
144-
"descOlder": "{{- nb}} ældre version af disse noter er allerede associeret med denne bog",
142+
"descList": "{{- count}} note(r) fra {{- creator}} vil blive associeret med {{- title}} {{- author}}",
143+
"descNewer": "{{- count}} nyere version af disse noter er allerede associeret med denne bog",
144+
"descOlder": "{{- count}} ældre version af disse noter er allerede associeret med denne bog",
145145
"descTitle": "Navn på notesamling: ",
146146
"importAll": "Importér alle noter",
147147
"importWithoutConflict": "Importér noter uden sammenfald",
@@ -157,9 +157,9 @@
157157
}
158158
},
159159
"deleteAnnotations": "Slet alle noter?",
160-
"deleteAnnotationsText": "Vil du slette {{- annotationListLength}} note(r)?",
160+
"deleteAnnotationsText": "Vil du slette {{- count}} note(r)?",
161161
"deleteBookmarks": "Slet bogmærker?",
162-
"deleteBookmarksText": "Er du sikker på at du vil slette {{- bookmarkListLength}} bogmærke(r)?",
162+
"deleteBookmarksText": "Er du sikker på at du vil slette {{- count}} bogmærke(r)?",
163163
"deleteFeed": "Er du sikker på at du vil slette dette katalog?",
164164
"deletePublication": "Er du sikker på at du vil fjerne bogen?",
165165
"deletePublicationWithNotes": "Advarsel: denne bog har noter og/eller bogmærker, som også vil blive slettet! (hvis du vil beholde dem, så eksporter dem venligst inden du sletter bogen)",
@@ -768,7 +768,7 @@
768768
},
769769
"picker": {
770770
"search": {
771-
"founds": "{{- nResults}} resultat(er)",
771+
"founds": "{{- count}} resultat(er)",
772772
"input": "søgetekst",
773773
"next": "Næste",
774774
"notFound": "ingen resultater",

src/resources/locales/de.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@
139139
"annotations": {
140140
"descAuthor": "nach '{{- author}}'",
141141
"descCreator": "Erstellt von",
142-
"descList": "{{- nb}} Notiz(en) {{- creator}} werden nach '{{- title}}' {{- author}} importiert",
143-
"descNewer": "Konflikt: {{- nb}} neuere Notiz(en)",
144-
"descOlder": "Konflikt: {{- nb}} ältere Notiz(en)",
142+
"descList": "{{- count}} Notiz(en) {{- creator}} werden nach '{{- title}}' {{- author}} importiert",
143+
"descNewer": "Konflikt: {{- count}} neuere Notiz(en)",
144+
"descOlder": "Konflikt: {{- count}} ältere Notiz(en)",
145145
"descTitle": "Titel der Notiz: ",
146146
"importAll": "Importiere alle Notizen",
147147
"importWithoutConflict": "Importiere nur konfliktfreie Notizen",
@@ -157,7 +157,7 @@
157157
}
158158
},
159159
"deleteAnnotations": "Anmerkungen löschen?",
160-
"deleteAnnotationsText": "Sind Sie sicher, dass Sie {{- annotationListLength}} Notiz(en) löschen wollen?",
160+
"deleteAnnotationsText": "Sind Sie sicher, dass Sie {{- count}} Notiz(en) löschen wollen?",
161161
"deleteBookmarks": "",
162162
"deleteBookmarksText": "",
163163
"deleteFeed": "Willst du diesen Katalog wirklich löschen?",
@@ -768,7 +768,7 @@
768768
},
769769
"picker": {
770770
"search": {
771-
"founds": "{{- nResults}} Fundstelle(n)",
771+
"founds": "{{- count}} Fundstelle(n)",
772772
"input": "Text suchen",
773773
"next": "Nächste",
774774
"notFound": "keine Treffer",

0 commit comments

Comments
 (0)