diff --git a/package.json b/package.json index f0853d12..e7493cb7 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,6 @@ "README.md" ], "dependencies": { - "@types/history": "^4.7.11", "json-e": "^4.4.3", "lodash": "^4.17.21", "qs": "^6.10.3", @@ -25,6 +24,7 @@ "devDependencies": { "@balena/lint": "^6.2.0", "@types/enzyme": "^3.10.12", + "@types/history": "^4.7.11", "@types/jest": "^26.0.24", "@types/jsdom": "^20.0.0", "@types/lodash": "^4.14.185", diff --git a/src/AutoUI/NoRecordsFoundView.tsx b/src/AutoUI/NoRecordsFoundView.tsx index 79fed090..f3c11955 100644 --- a/src/AutoUI/NoRecordsFoundView.tsx +++ b/src/AutoUI/NoRecordsFoundView.tsx @@ -38,7 +38,7 @@ export const NoRecordsFoundView = >({ {noDataInfo?.title ?? t('no_data.no_resource_data_title', { - resource: t(`resource.${model.resource}_plural`).toLowerCase(), + resource: t(`resource.${model.resource}_other`).toLowerCase(), })} {noDataInfo?.subtitle && ( diff --git a/src/AutoUI/index.tsx b/src/AutoUI/index.tsx index 449fa3e6..abbd03fb 100644 --- a/src/AutoUI/index.tsx +++ b/src/AutoUI/index.tsx @@ -389,7 +389,7 @@ export const AutoUI = >({ label={ isBusyMessage ?? t('loading.resource', { - resource: t(`resource.${model.resource}_plural`).toLowerCase(), + resource: t(`resource.${model.resource}_other`).toLowerCase(), }) } show={data == null || loading || !!isBusyMessage} @@ -503,7 +503,7 @@ export const AutoUI = >({ ) : ( t('no_data.no_resource_data', { resource: t( - `resource.${model.resource}_plural`, + `resource.${model.resource}_other`, ).toLowerCase(), }) )) diff --git a/src/hooks/useTranslation.tsx b/src/hooks/useTranslation.tsx index 17adad20..9a2845ce 100644 --- a/src/hooks/useTranslation.tsx +++ b/src/hooks/useTranslation.tsx @@ -23,7 +23,7 @@ const translationMap = { 'no_data.no_resource_data_description': "This is a bit empty right now, let's go ahead and add one", 'questions.how_about_adding_one': 'How about adding one?', - 'resource.item_plural': 'Items', + 'resource.item_other': 'Items', 'success.resource_added_successfully': '{{name}} added successfully', }; @@ -39,7 +39,7 @@ const getTranslation = ( return translation; } if (opts.count != null && opts.count > 1) { - const pluralKey = `${str}_plural` as keyof typeof translationMap; + const pluralKey = `${str}_other` as keyof typeof translationMap; translation = translationMap[pluralKey] ?? translationMap[str as keyof typeof translationMap];