diff --git a/components/dashboard/Form.js b/components/dashboard/Form.js index 46f9b5bf..24df986c 100644 --- a/components/dashboard/Form.js +++ b/components/dashboard/Form.js @@ -7,6 +7,7 @@ import { Controller, useForm } from 'react-hook-form' import { useIntl } from 'react-intl' import DateRangePicker from 'components/DateRangePicker' +import { SOCIAL_MEDIA_TESTS_STRINGS } from 'pages/social-media' import { getLocalisedRegionName } from 'utils/i18nCountries' const cleanedUpData = (values) => { @@ -36,8 +37,11 @@ export const Form = ({ }, [domains]) const appOptions = useMemo(() => { - return apps?.map((a) => ({ label: a, value: a })) - }, [apps]) + return apps?.map((a) => ({ + label: intl.formatMessage({ id: SOCIAL_MEDIA_TESTS_STRINGS[a] }), + value: a, + })) + }, [apps, intl]) // initial placement of query params when they are not defined // biome-ignore lint/correctness/useExhaustiveDependencies: @@ -57,8 +61,6 @@ export const Form = ({ router.replace(href, undefined, { shallow: true }) }, []) - console.log('query', query) - // Sync page URL params with changes from form values const onChange = useCallback( ({ since, until, probe_cc }) => { diff --git a/pages/social-media.js b/pages/social-media.js index 051bde79..462b3256 100644 --- a/pages/social-media.js +++ b/pages/social-media.js @@ -25,6 +25,16 @@ const SOCIAL_MEDIA_IM_TESTS = [ 'facebook_messenger', ] +export const SOCIAL_MEDIA_TESTS_STRINGS = { + telegram: 'Tests.Telegram.Name', + facebook_messenger: 'Tests.Facebook.Name', + whatsapp: 'Tests.WhatsApp.Name', + signal: 'Tests.Signal.Name', + psiphon: 'Tests.Psiphon.Name', + tor: 'Tests.Tor.Name', + torsf: 'Tests.TorSnowflake.Name', +} + export const getServerSideProps = async () => { try { const { reports, findings, countries, selectedCountries } = @@ -101,7 +111,11 @@ const Page = (props) => {