Skip to content

Commit

Permalink
Merge pull request #1246 from Gary-Community-Ventures/refactor/nav-lang
Browse files Browse the repository at this point in the history
Refactor/nav lang
  • Loading branch information
CalebPena authored Aug 19, 2024
2 parents 70fe5ef + 8e75aab commit b55d13e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
15 changes: 15 additions & 0 deletions src/Components/Results/ProgramPage/NavigatorLanguages.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { FormattedMessage } from 'react-intl';

export const allNavigatorLanguages = {
'en-us': <FormattedMessage id="navLanguage.en-us" defaultMessage="English Available" />,
es: <FormattedMessage id="navLanguage.es" defaultMessage="Spanish Available" />,
vi: <FormattedMessage id="navLanguage.vi" defaultMessage="Vietnamese Available" />,
fr: <FormattedMessage id="navLanguage.fr" defaultMessage="French Available" />,
am: <FormattedMessage id="navLanguage.am" defaultMessage="Amharic Available" />,
so: <FormattedMessage id="navLanguage.so" defaultMessage="Somali Available" />,
ru: <FormattedMessage id="navLanguage.ru" defaultMessage="Russian Available" />,
ne: <FormattedMessage id="navLanguage.ne" defaultMessage="Nepali Available" />,
my: <FormattedMessage id="navLanguage.my" defaultMessage="Burmese Available" />,
zh: <FormattedMessage id="navLanguage.zh" defaultMessage="Chinese Available" />,
ar: <FormattedMessage id="navLanguage.ar" defaultMessage="Arabic Available" />,
};
6 changes: 3 additions & 3 deletions src/Components/Results/ProgramPage/ProgramPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import { useContext } from 'react';
import { Context } from '../../Wrapper/Wrapper';
import { findValidationForProgram, useResultsContext, useResultsLink } from '../Results';
import { deleteValidation, postValidation } from '../../../apiCalls';
import { languageOptions, Language } from '../../../Assets/languageOptions.tsx';
import { Language } from '../../../Assets/languageOptions.tsx';
import { allNavigatorLanguages } from './NavigatorLanguages.tsx';

type ProgramPageProps = {
program: Program;
Expand Down Expand Up @@ -123,8 +124,7 @@ const ProgramPage = ({ program }: ProgramPageProps) => {
{navigatorLanguages.map((lang) => {
return (
<p className="navigator-lang-flag" key={lang}>
{languageOptions[lang]}
<FormattedMessage id="programPage.lang-available" defaultMessage=" Available" />
{allNavigatorLanguages[lang]}
</p>
);
})}
Expand Down

0 comments on commit b55d13e

Please sign in to comment.