diff --git a/canopeum_frontend/.eslintrc.cjs b/canopeum_frontend/.eslintrc.cjs index 3f888ce62..4004c4e5c 100644 --- a/canopeum_frontend/.eslintrc.cjs +++ b/canopeum_frontend/.eslintrc.cjs @@ -82,6 +82,9 @@ module.exports = { // We need to apply it directly on object literals to check for excess properties // https://www.typescriptlang.org/docs/handbook/2/objects.html#excess-property-checks 'no-autofix/no-relative-import-paths/no-relative-import-paths': 'off', + // i18next uses snake_case for special handling + // https://www.i18next.com/translation-function/plurals#singular-plural + camelcase: 'off', }, }, ], diff --git a/canopeum_frontend/src/components/CreatePostWidget.tsx b/canopeum_frontend/src/components/CreatePostWidget.tsx index 54301bde5..562ffe575 100644 --- a/canopeum_frontend/src/components/CreatePostWidget.tsx +++ b/canopeum_frontend/src/components/CreatePostWidget.tsx @@ -164,7 +164,7 @@ const CreatePostWidget = ({ siteId, addNewPost }: Props) => {
{postBodyNumberOfWords}/{MAXIMUM_WORDS_PER_POST} - {translate('social.comments.words', { count: MAXIMUM_WORDS_PER_POST })} + {translate('social.comments.word', { count: MAXIMUM_WORDS_PER_POST })}
diff --git a/canopeum_frontend/src/components/social/PostCommentsDialog.tsx b/canopeum_frontend/src/components/social/PostCommentsDialog.tsx index a9c79741b..350283fef 100644 --- a/canopeum_frontend/src/components/social/PostCommentsDialog.tsx +++ b/canopeum_frontend/src/components/social/PostCommentsDialog.tsx @@ -165,7 +165,7 @@ const PostCommentsDialog = ({ open, postId, siteId, handleClose }: Props) => { > {commentBodyNumberOfWords}/{MAXIMUM_WORDS_PER_COMMENT} - {translate('social.comments.words', { count: MAXIMUM_WORDS_PER_COMMENT })} + {translate('social.comments.word', { count: MAXIMUM_WORDS_PER_COMMENT })} diff --git a/canopeum_frontend/src/locale/en/analytics.ts b/canopeum_frontend/src/locale/en/analytics.ts index 62166d5e2..d57b10200 100644 --- a/canopeum_frontend/src/locale/en/analytics.ts +++ b/canopeum_frontend/src/locale/en/analytics.ts @@ -3,6 +3,8 @@ export default { 'create-site': 'Create a New Site', 'edit-site-info': 'Edit Site Information', average: 'average', + batch_one: 'batch', + batch_other: 'batches', sufficient: 'sufficient', insufficient: 'insufficient', 'table-row-1': 'batch name / ID', @@ -27,9 +29,7 @@ export default { 'success-rate-chart': { title: 'Average Annual Success Rate Per Site', }, - batches: { - 'batch-tracking': 'Batch Tracking', - }, + 'batch-tracking': 'Batch Tracking', 'site-summary': { planted: 'Planted', survived: 'Survived', diff --git a/canopeum_frontend/src/locale/en/social.ts b/canopeum_frontend/src/locale/en/social.ts index 87ee9f48e..0d9299c17 100644 --- a/canopeum_frontend/src/locale/en/social.ts +++ b/canopeum_frontend/src/locale/en/social.ts @@ -7,6 +7,8 @@ export default { }, comments: { 'leave-a-comment': 'Leave a Comment', + word_one: 'word', + word_other: 'words', comments: 'Comments', send: 'Send', 'comment-body-required': 'Your comment cannot be empty.', diff --git a/canopeum_frontend/src/locale/fr/analytics.ts b/canopeum_frontend/src/locale/fr/analytics.ts index 9c288f1d7..6d8d4ba78 100644 --- a/canopeum_frontend/src/locale/fr/analytics.ts +++ b/canopeum_frontend/src/locale/fr/analytics.ts @@ -5,6 +5,8 @@ export default { 'create-site': 'Créer un Nouveau Site', 'edit-site-info': "Modifier les données d'un Site", average: 'moyenne', + batch_one: 'lot', + batch_other: 'lots', sufficient: 'suffisant', insufficient: 'insuffisant', 'table-row-1': 'nom du lot / ID', @@ -29,9 +31,7 @@ export default { 'success-rate-chart': { title: 'Taux De Réussite Annuel Moyen Par Site', }, - batches: { - 'batch-tracking': 'Suivi des Lots', - }, + 'batch-tracking': 'Suivi des Lots', 'site-summary': { planted: 'Planté', survived: 'Survécu', diff --git a/canopeum_frontend/src/locale/fr/social.ts b/canopeum_frontend/src/locale/fr/social.ts index 972019611..db6cc3171 100644 --- a/canopeum_frontend/src/locale/fr/social.ts +++ b/canopeum_frontend/src/locale/fr/social.ts @@ -9,6 +9,8 @@ export default { }, comments: { 'leave-a-comment': 'Laisser un Commentaire', + word_one: 'mot', + word_other: 'mots', comments: 'Commentaires', send: 'Envoyer', 'comment-body-required': 'Votre commentaire ne peut pas être vide.', diff --git a/canopeum_frontend/src/pages/Analytics.tsx b/canopeum_frontend/src/pages/Analytics.tsx index b3b3c0e5e..4622816e7 100644 --- a/canopeum_frontend/src/pages/Analytics.tsx +++ b/canopeum_frontend/src/pages/Analytics.tsx @@ -160,7 +160,7 @@ const Analytics = () => { {site.batches.length}{' '} - {translate('analytics.batches', { count: site.batches.length })} + {translate('analytics.batch', { count: site.batches.length })} @@ -223,7 +223,7 @@ const Analytics = () => {
-
{translate('analytics.batches.batch-tracking')}
+
{translate('analytics.batch-tracking')}
Filters Go Here