From 767b344885cf3ab0f37d6c4471eb3576aa0af322 Mon Sep 17 00:00:00 2001 From: Avery Huang <68914997+huang0h@users.noreply.github.com> Date: Sun, 7 Jul 2024 20:21:37 -0400 Subject: [PATCH] better translations (#371) * better importing for scripts * undo yarn.lock --- src/components/forms/updateSiteForm/index.tsx | 2 +- src/components/navBar/translationDropdown.tsx | 20 +- src/containers/treePage/ducks/types.ts | 174 +++++++++--------- ...dge-landing.json => cambridgeLanding.json} | 0 src/i18n/en/index.ts | 80 +++++--- src/i18n/en/siteImageReview.json | 0 src/i18n/es/index.ts | 75 +++++--- src/i18n/es/siteImageReview.json | 0 src/i18n/i18n.ts | 109 +---------- src/utils/stringFormat.tsx | 6 +- 10 files changed, 212 insertions(+), 254 deletions(-) rename src/i18n/en/{cambridge-landing.json => cambridgeLanding.json} (100%) delete mode 100644 src/i18n/en/siteImageReview.json delete mode 100644 src/i18n/es/siteImageReview.json diff --git a/src/components/forms/updateSiteForm/index.tsx b/src/components/forms/updateSiteForm/index.tsx index 730eab52..5fede02c 100644 --- a/src/components/forms/updateSiteForm/index.tsx +++ b/src/components/forms/updateSiteForm/index.tsx @@ -45,7 +45,7 @@ const UpdateSiteForm: React.FC = ({ onFinish, initialSiteEntry, }) => { - const { t } = useTranslation(n(site, ['treeInfoTypes', 'forms']), { + const { t } = useTranslation(n(site, ['types', 'forms']), { nsMode: 'fallback', }); diff --git a/src/components/navBar/translationDropdown.tsx b/src/components/navBar/translationDropdown.tsx index c89ceedb..e63993a3 100644 --- a/src/components/navBar/translationDropdown.tsx +++ b/src/components/navBar/translationDropdown.tsx @@ -4,17 +4,17 @@ import i18n from 'i18next'; import { GlobalOutlined } from '@ant-design/icons'; import { LOCALSTORAGE_I18N_KEY } from '../../i18n/i18n'; import styled from 'styled-components'; +import { languages } from '../../i18n/i18n'; -const items: MenuProps['items'] = [ - { - key: 'en', - label: 'English', - }, - { - key: 'es', - label: 'EspaƱol', - }, -]; +// Convert language codes to items whose display is the language name +const items: MenuProps['items'] = languages.map((langCode) => { + const languageName = + new Intl.DisplayNames(langCode, { type: 'language' }).of(langCode) || ''; + return { + key: langCode, + label: languageName[0].toUpperCase() + languageName.slice(1), + }; +}); const triggerChangeLang: MenuProps['onClick'] = ({ key }) => { i18n.changeLanguage(key); diff --git a/src/containers/treePage/ducks/types.ts b/src/containers/treePage/ducks/types.ts index 6bbea541..886329a9 100644 --- a/src/containers/treePage/ducks/types.ts +++ b/src/containers/treePage/ducks/types.ts @@ -150,111 +150,111 @@ export interface SplitSiteEntries { } export const MainSiteEntryNames: Record = { - createdAt: t('main.createdAt', { ns: 'treeInfoTypes' }), - status: t('main.status', { ns: 'treeInfoTypes' }), - genus: t('main.genus', { ns: 'treeInfoTypes' }), - species: t('main.species', { ns: 'treeInfoTypes' }), - commonName: t('main.commonName', { ns: 'treeInfoTypes' }), - diameter: t('main.diameter', { ns: 'treeInfoTypes' }), + createdAt: t('main.createdAt', { ns: 'types' }), + status: t('main.status', { ns: 'types' }), + genus: t('main.genus', { ns: 'types' }), + species: t('main.species', { ns: 'types' }), + commonName: t('main.commonName', { ns: 'types' }), + diameter: t('main.diameter', { ns: 'types' }), }; export const MainSiteEntryOrder: Record = { - [t('main.createdAt', { ns: 'treeInfoTypes' })]: 1, - [t('main.commonName', { ns: 'treeInfoTypes' })]: 2, - [t('main.genus', { ns: 'treeInfoTypes' })]: 3, - [t('main.species', { ns: 'treeInfoTypes' })]: 4, - [t('main.scientificName', { ns: 'treeInfoTypes' })]: 3, - [t('main.diameter', { ns: 'treeInfoTypes' })]: 5, - [t('main.status', { ns: 'treeInfoTypes' })]: 6, + [t('main.createdAt', { ns: 'types' })]: 1, + [t('main.commonName', { ns: 'types' })]: 2, + [t('main.genus', { ns: 'types' })]: 3, + [t('main.species', { ns: 'types' })]: 4, + [t('main.scientificName', { ns: 'types' })]: 3, + [t('main.diameter', { ns: 'types' })]: 5, + [t('main.status', { ns: 'types' })]: 6, }; export const ExtraSiteEntryNames: Record = { // SFTT - treePresent: t('sftt.treePresent', { ns: 'treeInfoTypes' }), - updatedAt: t('sftt.updatedAt', { ns: 'treeInfoTypes' }), - confidence: t('sftt.confidence', { ns: 'treeInfoTypes' }), - circumference: t('sftt.circumference', { ns: 'treeInfoTypes' }), - multistem: t('sftt.multistem', { ns: 'treeInfoTypes' }), - coverage: t('sftt.coverage', { ns: 'treeInfoTypes' }), - pruning: t('sftt.pruning', { ns: 'treeInfoTypes' }), - condition: t('sftt.condition', { ns: 'treeInfoTypes' }), - discoloring: t('sftt.discoloring', { ns: 'treeInfoTypes' }), - leaning: t('sftt.leaning', { ns: 'treeInfoTypes' }), - constrictingGrate: t('sftt.constrictingGrate', { ns: 'treeInfoTypes' }), - wounds: t('sftt.wounds', { ns: 'treeInfoTypes' }), - pooling: t('sftt.pooling', { ns: 'treeInfoTypes' }), - stakesWithWires: t('sftt.stakesWithWires', { ns: 'treeInfoTypes' }), - stakesWithoutWires: t('sftt.stakesWithoutWires', { ns: 'treeInfoTypes' }), - light: t('sftt.light', { ns: 'treeInfoTypes' }), - bicycle: t('sftt.bicycle', { ns: 'treeInfoTypes' }), - bagEmpty: t('sftt.bagEmpty', { ns: 'treeInfoTypes' }), - bagFilled: t('sftt.bagFilled', { ns: 'treeInfoTypes' }), - tape: t('sftt.tape', { ns: 'treeInfoTypes' }), - suckerGrowth: t('sftt.suckerGrowth', { ns: 'treeInfoTypes' }), - siteType: t('sftt.siteType', { ns: 'treeInfoTypes' }), - sidewalkWidth: t('sftt.sidewalkWidth', { ns: 'treeInfoTypes' }), - siteWidth: t('sftt.siteWidth', { ns: 'treeInfoTypes' }), - siteLength: t('sftt.siteLength', { ns: 'treeInfoTypes' }), - material: t('sftt.material', { ns: 'treeInfoTypes' }), - raisedBed: t('sftt.raisedBed', { ns: 'treeInfoTypes' }), - fence: t('sftt.fence', { ns: 'treeInfoTypes' }), - trash: t('sftt.trash', { ns: 'treeInfoTypes' }), - wires: t('sftt.wires', { ns: 'treeInfoTypes' }), - grate: t('sftt.grate', { ns: 'treeInfoTypes' }), - stump: t('sftt.stump', { ns: 'treeInfoTypes' }), - treeNotes: t('sftt.treeNotes', { ns: 'treeInfoTypes' }), - siteNotes: t('sftt.siteNotes', { ns: 'treeInfoTypes' }), - plantingDate: t('sftt.plantingDate', { ns: 'treeInfoTypes' }), - editEntry: t('sftt.editEntry', { ns: 'treeInfoTypes' }), - deleteEntry: t('sftt.deleteEntry', { ns: 'treeInfoTypes' }), + treePresent: t('sftt.treePresent', { ns: 'types' }), + updatedAt: t('sftt.updatedAt', { ns: 'types' }), + confidence: t('sftt.confidence', { ns: 'types' }), + circumference: t('sftt.circumference', { ns: 'types' }), + multistem: t('sftt.multistem', { ns: 'types' }), + coverage: t('sftt.coverage', { ns: 'types' }), + pruning: t('sftt.pruning', { ns: 'types' }), + condition: t('sftt.condition', { ns: 'types' }), + discoloring: t('sftt.discoloring', { ns: 'types' }), + leaning: t('sftt.leaning', { ns: 'types' }), + constrictingGrate: t('sftt.constrictingGrate', { ns: 'types' }), + wounds: t('sftt.wounds', { ns: 'types' }), + pooling: t('sftt.pooling', { ns: 'types' }), + stakesWithWires: t('sftt.stakesWithWires', { ns: 'types' }), + stakesWithoutWires: t('sftt.stakesWithoutWires', { ns: 'types' }), + light: t('sftt.light', { ns: 'types' }), + bicycle: t('sftt.bicycle', { ns: 'types' }), + bagEmpty: t('sftt.bagEmpty', { ns: 'types' }), + bagFilled: t('sftt.bagFilled', { ns: 'types' }), + tape: t('sftt.tape', { ns: 'types' }), + suckerGrowth: t('sftt.suckerGrowth', { ns: 'types' }), + siteType: t('sftt.siteType', { ns: 'types' }), + sidewalkWidth: t('sftt.sidewalkWidth', { ns: 'types' }), + siteWidth: t('sftt.siteWidth', { ns: 'types' }), + siteLength: t('sftt.siteLength', { ns: 'types' }), + material: t('sftt.material', { ns: 'types' }), + raisedBed: t('sftt.raisedBed', { ns: 'types' }), + fence: t('sftt.fence', { ns: 'types' }), + trash: t('sftt.trash', { ns: 'types' }), + wires: t('sftt.wires', { ns: 'types' }), + grate: t('sftt.grate', { ns: 'types' }), + stump: t('sftt.stump', { ns: 'types' }), + treeNotes: t('sftt.treeNotes', { ns: 'types' }), + siteNotes: t('sftt.siteNotes', { ns: 'types' }), + plantingDate: t('sftt.plantingDate', { ns: 'types' }), + editEntry: t('sftt.editEntry', { ns: 'types' }), + deleteEntry: t('sftt.deleteEntry', { ns: 'types' }), // CAMBRIDGE - trunks: t('cambridge.trunks', { ns: 'treeInfoTypes' }), - speciesShort: t('cambridge.speciesShort', { ns: 'treeInfoTypes' }), - location: t('cambridge.location', { ns: 'treeInfoTypes' }), - siteRetiredReason: t('cambridge.siteRetiredReason', { ns: 'treeInfoTypes' }), - inspectr: t('cambridge.inspectr', { ns: 'treeInfoTypes' }), - abutsOpenArea: t('cambridge.abutsOpenArea', { ns: 'treeInfoTypes' }), - treeWellCover: t('cambridge.treeWellCover', { ns: 'treeInfoTypes' }), + trunks: t('cambridge.trunks', { ns: 'types' }), + speciesShort: t('cambridge.speciesShort', { ns: 'types' }), + location: t('cambridge.location', { ns: 'types' }), + siteRetiredReason: t('cambridge.siteRetiredReason', { ns: 'types' }), + inspectr: t('cambridge.inspectr', { ns: 'types' }), + abutsOpenArea: t('cambridge.abutsOpenArea', { ns: 'types' }), + treeWellCover: t('cambridge.treeWellCover', { ns: 'types' }), treeGrateActionReq: t('cambridge.treeGrateActionReq', { - ns: 'treeInfoTypes', + ns: 'types', }), - globalId: t('cambridge.globalId', { ns: 'treeInfoTypes' }), - pb: t('cambridge.pb', { ns: 'treeInfoTypes' }), - siteReplanted: t('cambridge.siteReplanted', { ns: 'treeInfoTypes' }), - overheadWires: t('cambridge.overheadWires', { ns: 'treeInfoTypes' }), - ownership: t('cambridge.ownership', { ns: 'treeInfoTypes' }), - scheduledRemoval: t('cambridge.scheduledRemoval', { ns: 'treeInfoTypes' }), - structuralSoil: t('cambridge.structuralSoil', { ns: 'treeInfoTypes' }), + globalId: t('cambridge.globalId', { ns: 'types' }), + pb: t('cambridge.pb', { ns: 'types' }), + siteReplanted: t('cambridge.siteReplanted', { ns: 'types' }), + overheadWires: t('cambridge.overheadWires', { ns: 'types' }), + ownership: t('cambridge.ownership', { ns: 'types' }), + scheduledRemoval: t('cambridge.scheduledRemoval', { ns: 'types' }), + structuralSoil: t('cambridge.structuralSoil', { ns: 'types' }), wateringResponsibility: t('cambridge.wateringResponsibility', { - ns: 'treeInfoTypes', + ns: 'types', }), - cultivar: t('cambridge.cultivar', { ns: 'treeInfoTypes' }), - solarRating: t('cambridge.solarRating', { ns: 'treeInfoTypes' }), - bareRoot: t('cambridge.bareRoot', { ns: 'treeInfoTypes' }), - adaCompliant: t('cambridge.adaCompliant', { ns: 'treeInfoTypes' }), + cultivar: t('cambridge.cultivar', { ns: 'types' }), + solarRating: t('cambridge.solarRating', { ns: 'types' }), + bareRoot: t('cambridge.bareRoot', { ns: 'types' }), + adaCompliant: t('cambridge.adaCompliant', { ns: 'types' }), cartegraphPlantDate: t('cambridge.cartegraphPlantDate', { - ns: 'treeInfoTypes', + ns: 'types', }), - locationRetired: t('cambridge.locationRetired', { ns: 'treeInfoTypes' }), - createdDate: t('cambridge.createdDate', { ns: 'treeInfoTypes' }), - order: t('cambridge.order', { ns: 'treeInfoTypes' }), - plantingSeason: t('cambridge.plantingSeason', { ns: 'treeInfoTypes' }), - exposedRootFlare: t('cambridge.exposedRootFlare', { ns: 'treeInfoTypes' }), - stTreePruningZone: t('cambridge.stTreePruningZone', { ns: 'treeInfoTypes' }), - memTree: t('cambridge.memTree', { ns: 'treeInfoTypes' }), + locationRetired: t('cambridge.locationRetired', { ns: 'types' }), + createdDate: t('cambridge.createdDate', { ns: 'types' }), + order: t('cambridge.order', { ns: 'types' }), + plantingSeason: t('cambridge.plantingSeason', { ns: 'types' }), + exposedRootFlare: t('cambridge.exposedRootFlare', { ns: 'types' }), + stTreePruningZone: t('cambridge.stTreePruningZone', { ns: 'types' }), + memTree: t('cambridge.memTree', { ns: 'types' }), cartegraphRetireDate: t('cambridge.cartegraphRetireDate', { - ns: 'treeInfoTypes', + ns: 'types', }), - removalReason: t('cambridge.removalReason', { ns: 'treeInfoTypes' }), + removalReason: t('cambridge.removalReason', { ns: 'types' }), offStTreePruningZone: t('cambridge.offStTreePruningZone', { - ns: 'treeInfoTypes', + ns: 'types', }), - plantingContract: t('cambridge.plantingContract', { ns: 'treeInfoTypes' }), - treeWellDepth: t('cambridge.treeWellDepth', { ns: 'treeInfoTypes' }), - removalDate: t('cambridge.removalDate', { ns: 'treeInfoTypes' }), - scientificName: t('cambridge.scientificName', { ns: 'treeInfoTypes' }), - biocharAdded: t('cambridge.biocharAdded', { ns: 'treeInfoTypes' }), - lastEditedUser: t('cambridge.lastEditedUser', { ns: 'treeInfoTypes' }), + plantingContract: t('cambridge.plantingContract', { ns: 'types' }), + treeWellDepth: t('cambridge.treeWellDepth', { ns: 'types' }), + removalDate: t('cambridge.removalDate', { ns: 'types' }), + scientificName: t('cambridge.scientificName', { ns: 'types' }), + biocharAdded: t('cambridge.biocharAdded', { ns: 'types' }), + lastEditedUser: t('cambridge.lastEditedUser', { ns: 'types' }), }; export interface TreeCare { diff --git a/src/i18n/en/cambridge-landing.json b/src/i18n/en/cambridgeLanding.json similarity index 100% rename from src/i18n/en/cambridge-landing.json rename to src/i18n/en/cambridgeLanding.json diff --git a/src/i18n/en/index.ts b/src/i18n/en/index.ts index ff61d89c..ff85bf34 100644 --- a/src/i18n/en/index.ts +++ b/src/i18n/en/index.ts @@ -1,29 +1,55 @@ -// SFTT -export { default as landing } from './landing.json'; -export { default as maps } from './maps.json'; -export { default as notFound } from './notFound.json'; -export { default as forgotPassword } from './forgotPassword.json'; -export { default as forgotPasswordReset } from './forgotPasswordReset.json'; -export { default as reports } from './reports.json'; -export { default as login } from './login.json'; -export { default as signup } from './signup.json'; -export { default as home } from './home.json'; -export { default as settings } from './settings.json'; -export { default as faq } from './faq.json'; -export { default as myTrees } from './myTrees.json'; -export { default as site } from './site.json'; -export { default as admin } from './admin.json'; +import landing from './landing.json'; +import maps from './maps.json'; +import notFound from './notFound.json'; +import forgotPassword from './forgotPassword.json'; +import forgotPasswordReset from './forgotPasswordReset.json'; +import reports from './reports.json'; +import login from './login.json'; +import signup from './signup.json'; +import home from './home.json'; +import settings from './settings.json'; +import faq from './faq.json'; +import myTrees from './myTrees.json'; +import site from './site.json'; +import admin from './admin.json'; +import treePage from './treePage/treePage.json'; +import treeInfo from './treePage/treeInfo.json'; +import shareMenu from './treePage/shareMenu.json'; +import treeActivity from './treePage/treeActivity.json'; +import careEntry from './treePage/careEntry.json'; +import types from './treePage/types.json'; +import forms from './forms.json'; +import tables from './tables.json'; +import content from './content.json'; +import cambridgeLanding from './cambridgeLanding.json'; -export { default as treePage } from './treePage/treePage.json'; -export { default as treeInfo } from './treePage/treeInfo.json'; -export { default as shareMenu } from './treePage/shareMenu.json'; -export { default as treeActivity } from './treePage/treeActivity.json'; -export { default as careEntry } from './treePage/careEntry.json'; -export { default as treeInfoTypes } from './treePage/types.json'; +const translations = { + en: { + landing, + maps, + notFound, + forgotPassword, + forgotPasswordReset, + reports, + login, + signup, + home, + settings, + faq, + myTrees, + site, + admin, + treePage, + treeInfo, + shareMenu, + treeActivity, + careEntry, + types, + forms, + tables, + content, + cambridgeLanding, + }, +}; -export { default as forms } from './forms.json'; -export { default as tables } from './tables.json'; -export { default as content } from './content.json'; - -// CAMBRIDGE -export { default as cambridgeLanding } from './cambridge-landing.json'; +export default translations; diff --git a/src/i18n/en/siteImageReview.json b/src/i18n/en/siteImageReview.json deleted file mode 100644 index e69de29b..00000000 diff --git a/src/i18n/es/index.ts b/src/i18n/es/index.ts index 1e35157d..de5ba71a 100644 --- a/src/i18n/es/index.ts +++ b/src/i18n/es/index.ts @@ -1,26 +1,53 @@ -// SFTT -export { default as landingEs } from './landing.json'; -export { default as mapsEs } from './maps.json'; -export { default as notFoundEs } from './notFound.json'; -export { default as forgotPasswordEs } from './forgotPassword.json'; -export { default as forgotPasswordResetEs } from './forgotPasswordReset.json'; -export { default as reportsEs } from './reports.json'; -export { default as loginEs } from './login.json'; -export { default as signupEs } from './signup.json'; -export { default as homeEs } from './home.json'; -export { default as settingsEs } from './settings.json'; -export { default as faqEs } from './faq.json'; -export { default as myTreesEs } from './myTrees.json'; -export { default as siteEs } from './site.json'; -export { default as adminEs } from './admin.json'; +import landing from './landing.json'; +import maps from './maps.json'; +import notFound from './notFound.json'; +import forgotPassword from './forgotPassword.json'; +import forgotPasswordReset from './forgotPasswordReset.json'; +import reports from './reports.json'; +import login from './login.json'; +import signup from './signup.json'; +import home from './home.json'; +import settings from './settings.json'; +import faq from './faq.json'; +import myTrees from './myTrees.json'; +import site from './site.json'; +import admin from './admin.json'; +import treePage from './treePage/treePage.json'; +import treeInfo from './treePage/treeInfo.json'; +import shareMenu from './treePage/shareMenu.json'; +import treeActivity from './treePage/treeActivity.json'; +import careEntry from './treePage/careEntry.json'; +import types from './treePage/types.json'; +import forms from './forms.json'; +import tables from './tables.json'; +import content from './content.json'; -export { default as treePageEs } from './treePage/treePage.json'; -export { default as treeInfoEs } from './treePage/treeInfo.json'; -export { default as shareMenuEs } from './treePage/shareMenu.json'; -export { default as treeActivityEs } from './treePage/treeActivity.json'; -export { default as careEntryEs } from './treePage/careEntry.json'; -export { default as treeInfoTypesEs } from './treePage/types.json'; +const translations = { + es: { + landing, + maps, + notFound, + forgotPassword, + forgotPasswordReset, + reports, + login, + signup, + home, + settings, + faq, + myTrees, + site, + admin, + treePage, + treeInfo, + shareMenu, + treeActivity, + careEntry, + types, + forms, + tables, + content, + }, +}; -export { default as formsEs } from './forms.json'; -export { default as tablesEs } from './tables.json'; -export { default as contentEs } from './content.json'; +export default translations; diff --git a/src/i18n/es/siteImageReview.json b/src/i18n/es/siteImageReview.json deleted file mode 100644 index e69de29b..00000000 diff --git a/src/i18n/i18n.ts b/src/i18n/i18n.ts index 2c3a30df..e189c095 100644 --- a/src/i18n/i18n.ts +++ b/src/i18n/i18n.ts @@ -1,56 +1,8 @@ import i18n from 'i18next'; import { initReactI18next } from 'react-i18next'; -import { - landing, - maps, - notFound, - forgotPassword, - forgotPasswordReset, - reports, - login, - signup, - home, - settings, - faq, - myTrees, - site, - admin, - forms, - tables, - content, - cambridgeLanding, - treePage, - treeInfo, - shareMenu, - treeActivity, - careEntry, - treeInfoTypes, -} from './en'; -import { - landingEs, - mapsEs, - notFoundEs, - forgotPasswordEs, - forgotPasswordResetEs, - reportsEs, - loginEs, - signupEs, - homeEs, - settingsEs, - faqEs, - myTreesEs, - siteEs, - adminEs, - formsEs, - tablesEs, - contentEs, - treePageEs, - treeInfoEs, - shareMenuEs, - treeActivityEs, - careEntryEs, - treeInfoTypesEs, -} from './es'; + +import enTranslations from './en'; +import esTranslations from './es'; export const LOCALSTORAGE_I18N_KEY = 'i18n-lang'; @@ -63,59 +15,12 @@ export function getActiveLanguage(): string { // (tip move them in a JSON file and import them, // or even better, manage them separated from your code: https://react.i18next.com/guides/multiple-translation-files) const resources = { - en: { - landing, - maps, - notFound, - forgotPassword, - forgotPasswordReset, - reports, - login, - signup, - home, - settings, - faq, - myTrees, - site, - admin, - forms, - tables, - content, - cambridgeLanding, - treePage, - treeInfo, - shareMenu, - treeActivity, - careEntry, - treeInfoTypes, - }, - es: { - landing: landingEs, - maps: mapsEs, - notFound: notFoundEs, - forgotPassword: forgotPasswordEs, - forgotPasswordReset: forgotPasswordResetEs, - reports: reportsEs, - login: loginEs, - signup: signupEs, - home: homeEs, - settings: settingsEs, - faq: faqEs, - myTrees: myTreesEs, - site: siteEs, - admin: adminEs, - forms: formsEs, - tables: tablesEs, - content: contentEs, - treePage: treePageEs, - treeInfo: treeInfoEs, - shareMenu: shareMenuEs, - treeActivity: treeActivityEs, - careEntry: careEntryEs, - treeInfoTypes: treeInfoTypesEs, - }, + ...enTranslations, + ...esTranslations, }; +export const languages = Object.keys(resources); + i18n // passes i18n down to react-i18next .use(initReactI18next) diff --git a/src/utils/stringFormat.tsx b/src/utils/stringFormat.tsx index 9e0f94f2..31281d97 100644 --- a/src/utils/stringFormat.tsx +++ b/src/utils/stringFormat.tsx @@ -120,9 +120,9 @@ export function getSEFieldDisplayName(field: SiteEntryField): string { * @param entries the list of entries */ export function combineScientificName(entries: Entry[]): Entry[] { - const titleSpecies = t('main.species', { ns: 'treeInfoTypes' }); - const titleGenus = t('main.genus', { ns: 'treeInfoTypes' }); - const titleSciName = t('main.scientificName', { ns: 'treeInfoTypes' }); + const titleSpecies = t('main.species', { ns: 'types' }); + const titleGenus = t('main.genus', { ns: 'types' }); + const titleSciName = t('main.scientificName', { ns: 'types' }); const newEntries: Entry[] = []; let species;