diff --git a/.env.production b/.env.production index 4a91ae0..1ba045b 100644 --- a/.env.production +++ b/.env.production @@ -2,4 +2,4 @@ # To override locally, make a copy called `.env.production.local` # Refer: https://nextjs.org/docs/basic-features/environment-variables -NEXT_PUBLIC_OONI_API=https://api.ooni.io +NEXT_PUBLIC_OONI_API=https://api.ooni.org diff --git a/Readme.md b/Readme.md index b4b83cc..be9a059 100644 --- a/Readme.md +++ b/Readme.md @@ -26,16 +26,3 @@ Create a build: ``` yarn run build ``` - - -Upload a release: - -``` -yarn run release -``` - -Generate a OONI Run link: - -``` -yarn run genurl -- path/to/list.csv -``` diff --git a/components/Footer.tsx b/components/Footer.tsx index 7ae3be2..b37e1dd 100644 --- a/components/Footer.tsx +++ b/components/Footer.tsx @@ -41,7 +41,7 @@ const Footer = () => { -
+
{intl.formatMessage({ id: 'Footer.Heading.About' })} @@ -66,7 +66,7 @@ const Footer = () => { label={intl.formatMessage({ id: 'Footer.Link.Contact' })} />
-
+
{intl.formatMessage({ id: 'Footer.Heading.OONIProbe' })} @@ -83,11 +83,11 @@ const Footer = () => { label={intl.formatMessage({ id: 'Footer.Link.Code' })} />
-
+
{intl.formatMessage({ id: 'Footer.Heading.Updates' })} diff --git a/components/LocaleSwitcher.tsx b/components/LocaleSwitcher.tsx index 4834d01..e22d0ed 100644 --- a/components/LocaleSwitcher.tsx +++ b/components/LocaleSwitcher.tsx @@ -3,12 +3,39 @@ import { getDirection } from 'pages/_app' import type { ReactNode } from 'react' import { useIntl } from 'react-intl' +import '@formatjs/intl-displaynames/polyfill' + +import '@formatjs/intl-displaynames/locale-data/ar' +import '@formatjs/intl-displaynames/locale-data/de' +import '@formatjs/intl-displaynames/locale-data/en' +import '@formatjs/intl-displaynames/locale-data/id' +// import '@formatjs/intl-displaynames/locale-data/es' +// import '@formatjs/intl-displaynames/locale-data/fa' +// import '@formatjs/intl-displaynames/locale-data/fr' +import '@formatjs/intl-displaynames/locale-data/km' +// import '@formatjs/intl-displaynames/locale-data/my' +// import '@formatjs/intl-displaynames/locale-data/pt' +import '@formatjs/intl-displaynames/locale-data/ru' +// import '@formatjs/intl-displaynames/locale-data/sw' +// import '@formatjs/intl-displaynames/locale-data/th' +import '@formatjs/intl-displaynames/locale-data/tr' +// import '@formatjs/intl-displaynames/locale-data/vi' +import '@formatjs/intl-displaynames/locale-data/zh-Hans' +import '@formatjs/intl-displaynames/locale-data/zh-Hant' + + +const getLocale = (locale: string) => { + if (locale === 'zh-cn') return 'zh-Hans' + // if (locale === 'pt-BR') return 'pt' + return locale +} + export const getLocalisedLanguageName = ( regionCode: string, locale: string, ) => { try { - return new Intl.DisplayNames([locale], { type: 'language' }).of( + return new Intl.DisplayNames([getLocale(locale)], { type: 'language' }).of( String(regionCode), ) } catch (e) { @@ -51,32 +78,6 @@ const LanguageSelect = (props: LanguageSelectProps) => (
) -// const LanguageSelect = styled.select` -// color: ${(props) => props.theme.colors.white}; -// background: none; -// border: none; -// text-transform: capitalize; -// cursor: pointer; -// font-family: inherit; -// font-size: inherit; -// padding: 0; -// padding-bottom: 6px; -// padding-right: 10px; -// outline: none; -// appearance: none; -// -webkit-appearance: none; -// -moz-appearance: none; -// -ms-appearance: none; -// -o-appearance: none; -// background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%20viewBox%3D%220%200%2012%2012%22%3E%3Ctitle%3Edown-arrow%3C%2Ftitle%3E%3Cg%20fill%3D%22%23FFFFFF%22%3E%3Cpath%20d%3D%22M10.293%2C3.293%2C6%2C7.586%2C1.707%2C3.293A1%2C1%2C0%2C0%2C0%2C.293%2C4.707l5%2C5a1%2C1%2C0%2C0%2C0%2C1.414%2C0l5-5a1%2C1%2C0%2C1%2C0-1.414-1.414Z%22%20fill%3D%22%23FFFFFF%22%3E%3C%2Fpath%3E%3C%2Fg%3E%3C%2Fsvg%3E"); -// background-size: .6em; -// background-position: 100% 0.2rem; -// background-repeat: no-repeat; -// html[dir="rtl"] &, body[dir="rtl"] &: { -// background-position: 0, 0.2rem; -// }, -// ` - const LocaleSwitcher = () => { const router = useRouter() const { pathname, asPath, query } = router diff --git a/components/NavBar.tsx b/components/NavBar.tsx index 95495e3..1365ac5 100644 --- a/components/NavBar.tsx +++ b/components/NavBar.tsx @@ -1,4 +1,4 @@ -// import LocaleSwitcher from "components/LocaleSwitcher" +import LocaleSwitcher from 'components/LocaleSwitcher' import useUser from 'hooks/useUser' import Link from 'next/link' import { useRouter } from 'next/router' @@ -97,7 +97,7 @@ export const NavBar = () => { )} - {/* */} +
diff --git a/components/form/AdminNettestFields.tsx b/components/form/AdminNettestFields.tsx index dc82477..a9ce387 100644 --- a/components/form/AdminNettestFields.tsx +++ b/components/form/AdminNettestFields.tsx @@ -55,7 +55,7 @@ const AdminNettestFields = ({ name }: FieldsPropTypes) => {