diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-03-23 12:29:43 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-03-23 12:29:43 +0100 |
| commit | 4e7a96c5a831882463802cdd4f84fe1464969cb0 (patch) | |
| tree | 528e2766120465bd74e94a8f5d37db7c3cd5a3cc /src/pages | |
| parent | 3a20d3ef2d6fcb6c77ca5ad6aeaf6179d23ecb3e (diff) | |
refactor: use formatjs swc plugin
I'm not able to configure SWC plugins in Next.js so to make it works,
all translation must have an id.
Diffstat (limited to 'src/pages')
| -rw-r--r-- | src/pages/404.tsx | 5 | ||||
| -rw-r--r-- | src/pages/article/[slug].tsx | 7 | ||||
| -rw-r--r-- | src/pages/blog/index.tsx | 9 | ||||
| -rw-r--r-- | src/pages/blog/page/[id].tsx | 9 | ||||
| -rw-r--r-- | src/pages/contact.tsx | 7 | ||||
| -rw-r--r-- | src/pages/cv.tsx | 7 | ||||
| -rw-r--r-- | src/pages/index.tsx | 9 | ||||
| -rw-r--r-- | src/pages/mentions-legales.tsx | 3 | ||||
| -rw-r--r-- | src/pages/projet/[slug].tsx | 2 | ||||
| -rw-r--r-- | src/pages/projets.tsx | 2 | ||||
| -rw-r--r-- | src/pages/recherche/index.tsx | 9 | ||||
| -rw-r--r-- | src/pages/sujet/[slug].tsx | 4 | ||||
| -rw-r--r-- | src/pages/thematique/[slug].tsx | 4 |
13 files changed, 76 insertions, 1 deletions
diff --git a/src/pages/404.tsx b/src/pages/404.tsx index d5b2e86..24c6951 100644 --- a/src/pages/404.tsx +++ b/src/pages/404.tsx @@ -16,12 +16,14 @@ const Error404: NextPageWithLayout = () => { { defaultMessage: 'Error 404: Page not found - {websiteName}', description: '404Page: SEO - Page title', + id: '310o3F', }, { websiteName: settings.name } ); const pageDescription = intl.formatMessage({ defaultMessage: 'Page not found.', description: '404Page: SEO - Meta description', + id: '48Ww//', }); return ( @@ -35,12 +37,14 @@ const Error404: NextPageWithLayout = () => { title={intl.formatMessage({ defaultMessage: 'Page not found', description: '404Page: page title', + id: 'OccTWi', })} /> <div className={styles.body}> <FormattedMessage defaultMessage="Sorry, it seems that the page your are looking for does not exist. If you think this path should work, feel free to <link>contact me</link> with the necessary information so that I can fix the problem." description="404Page: page body" + id="ZWh78Y" values={{ link: (chunks: string) => ( <Link href="/contact/"> @@ -64,6 +68,7 @@ export const getStaticProps: GetStaticProps = async ( const breadcrumbTitle = intl.formatMessage({ defaultMessage: 'Error 404', description: '404Page: breadcrumb item', + id: 'ywkCsK', }); const { locale } = context; const translation = await loadTranslation(locale); diff --git a/src/pages/article/[slug].tsx b/src/pages/article/[slug].tsx index 656f7c9..41b84b6 100644 --- a/src/pages/article/[slug].tsx +++ b/src/pages/article/[slug].tsx @@ -140,22 +140,27 @@ const SingleArticle: NextPageWithLayout<ArticleProps> = ({ const copyText = intl.formatMessage({ defaultMessage: 'Copy', description: 'Prism: copy button text (no clicked)', + id: '/ly3AC', }); const copiedText = intl.formatMessage({ defaultMessage: 'Copied!', description: 'Prism: copy button text (clicked)', + id: 'OV9r1K', }); const errorText = intl.formatMessage({ defaultMessage: 'Use Ctrl+c to copy', description: 'Prism: error text', + id: 'z9qkcQ', }); const darkTheme = intl.formatMessage({ defaultMessage: 'Dark Theme 🌙', description: 'Prism: toggle dark theme button text', + id: 'nFMdWI', }); const lightTheme = intl.formatMessage({ defaultMessage: 'Light Theme 🌞', description: 'Prism: toggle light theme button text', + id: 'Ua2g2p', }); return ( @@ -190,6 +195,7 @@ const SingleArticle: NextPageWithLayout<ArticleProps> = ({ ariaLabel={intl.formatMessage({ defaultMessage: 'Table of Contents', description: 'ArticlePage: ToC sidebar aria-label', + id: '9nhYRA', })} > <ToC /> @@ -204,6 +210,7 @@ const SingleArticle: NextPageWithLayout<ArticleProps> = ({ ariaLabel={intl.formatMessage({ defaultMessage: 'Sidebar', description: 'ArticlePage: right sidebar aria-label', + id: 'JeYOeA', })} > <Sharing title={title} excerpt={intro} /> diff --git a/src/pages/blog/index.tsx b/src/pages/blog/index.tsx index 366fc28..b5ced07 100644 --- a/src/pages/blog/index.tsx +++ b/src/pages/blog/index.tsx @@ -97,6 +97,7 @@ const Blog: NextPageWithLayout<BlogPageProps> = ({ return intl.formatMessage({ defaultMessage: 'Failed to load.', description: 'BlogPage: failed to load text', + id: 'C/XGkH', }); if (!data) return <Spinner />; @@ -107,6 +108,7 @@ const Blog: NextPageWithLayout<BlogPageProps> = ({ { defaultMessage: 'Blog: development, open source - {websiteName}', description: 'BlogPage: SEO - Page title', + id: '+Y+tLK', }, { websiteName: settings.name } ); @@ -115,6 +117,7 @@ const Blog: NextPageWithLayout<BlogPageProps> = ({ defaultMessage: "Discover {websiteName}'s writings. He talks about web development, Linux and open source mostly.", description: 'BlogPage: SEO - Meta description', + id: '18h/t0', }, { websiteName: settings.name } ); @@ -153,6 +156,7 @@ const Blog: NextPageWithLayout<BlogPageProps> = ({ const title = intl.formatMessage({ defaultMessage: 'Blog', description: 'BlogPage: page title', + id: '7TbbIk', }); return ( @@ -193,6 +197,7 @@ const Blog: NextPageWithLayout<BlogPageProps> = ({ {intl.formatMessage({ defaultMessage: 'Load more?', description: 'BlogPage: load more text', + id: 'Kqq2cm', })} </Button> </> @@ -205,6 +210,7 @@ const Blog: NextPageWithLayout<BlogPageProps> = ({ title={intl.formatMessage({ defaultMessage: 'Filter by:', description: 'BlogPage: sidebar title', + id: 'KERk7L', })} > <ThematicsList @@ -212,6 +218,7 @@ const Blog: NextPageWithLayout<BlogPageProps> = ({ title={intl.formatMessage({ defaultMessage: 'Thematics', description: 'BlogPage: thematics list widget title', + id: 'HriY57', })} /> <TopicsList @@ -219,6 +226,7 @@ const Blog: NextPageWithLayout<BlogPageProps> = ({ title={intl.formatMessage({ defaultMessage: 'Topics', description: 'BlogPage: topics list widget title', + id: '2D9tB5', })} /> </Sidebar> @@ -236,6 +244,7 @@ export const getStaticProps: GetStaticProps = async ( const breadcrumbTitle = intl.formatMessage({ defaultMessage: 'Blog', description: 'BlogPage: breadcrumb item', + id: 'R0eDmw', }); const firstPosts = await getPublishedPosts({ first: settings.postsPerPage }); const totalPosts = await getPostsTotal(); diff --git a/src/pages/blog/page/[id].tsx b/src/pages/blog/page/[id].tsx index 2cbd486..6c4d2f8 100644 --- a/src/pages/blog/page/[id].tsx +++ b/src/pages/blog/page/[id].tsx @@ -44,8 +44,9 @@ const BlogPage: NextPageWithLayout<BlogPageProps> = ({ const pageTitle = intl.formatMessage( { - defaultMessage: `Blog - Page {number} - {websiteName}`, + defaultMessage: 'Blog - Page {number} - {websiteName}', description: 'BlogPage: SEO - Page title', + id: '8w+jnD', }, { number: pageNumber, websiteName: settings.name } ); @@ -54,6 +55,7 @@ const BlogPage: NextPageWithLayout<BlogPageProps> = ({ defaultMessage: "Discover {websiteName}'s writings. He talks about web development, Linux and open source mostly.", description: 'BlogPage: SEO - Meta description', + id: '18h/t0', }, { websiteName: settings.name } ); @@ -92,6 +94,7 @@ const BlogPage: NextPageWithLayout<BlogPageProps> = ({ const title = intl.formatMessage({ defaultMessage: 'Blog', description: 'BlogPage: page title', + id: '7TbbIk', }); return ( @@ -123,6 +126,7 @@ const BlogPage: NextPageWithLayout<BlogPageProps> = ({ title={intl.formatMessage({ defaultMessage: 'Filter by:', description: 'BlogPage: sidebar title', + id: 'KERk7L', })} > <ThematicsList @@ -130,6 +134,7 @@ const BlogPage: NextPageWithLayout<BlogPageProps> = ({ title={intl.formatMessage({ defaultMessage: 'Thematics', description: 'BlogPage: thematics list widget title', + id: 'HriY57', })} /> <TopicsList @@ -137,6 +142,7 @@ const BlogPage: NextPageWithLayout<BlogPageProps> = ({ title={intl.formatMessage({ defaultMessage: 'Topics', description: 'BlogPage: topics list widget title', + id: '2D9tB5', })} /> </Sidebar> @@ -154,6 +160,7 @@ export const getStaticProps: GetStaticProps = async ( const breadcrumbTitle = intl.formatMessage({ defaultMessage: 'Blog', description: 'BlogPage: breadcrumb item', + id: 'R0eDmw', }); const { locale, params } = context; const queriedPageNumber = params ? Number(params.id) : 1; diff --git a/src/pages/contact.tsx b/src/pages/contact.tsx index 9f8ec0f..5934dd9 100644 --- a/src/pages/contact.tsx +++ b/src/pages/contact.tsx @@ -22,6 +22,7 @@ const ContactPage: NextPageWithLayout = () => { { defaultMessage: 'Contact form - {websiteName}', description: 'ContactPage: SEO - Page title', + id: 'Y3qRib', }, { websiteName: settings.name } ); @@ -30,6 +31,7 @@ const ContactPage: NextPageWithLayout = () => { defaultMessage: "Contact {websiteName} through its website. All you need to do it's to fill the contact form.", description: 'ContactPage: SEO - Meta description', + id: 'OIffB4', }, { websiteName: settings.name } ); @@ -37,10 +39,12 @@ const ContactPage: NextPageWithLayout = () => { const title = intl.formatMessage({ defaultMessage: 'Contact', description: 'ContactPage: page title', + id: 'AN9iy7', }); const intro = intl.formatMessage({ defaultMessage: 'Please fill the form to contact me.', description: 'ContactPage: page introduction', + id: '8Ls2mD', }); const webpageSchema: WebPage = { @@ -99,6 +103,7 @@ const ContactPage: NextPageWithLayout = () => { {intl.formatMessage({ defaultMessage: 'All fields marked with * are required.', description: 'ContactPage: required fields text', + id: 'txusHd', })} </p> <ContactForm /> @@ -108,6 +113,7 @@ const ContactPage: NextPageWithLayout = () => { title={intl.formatMessage({ defaultMessage: 'Find me elsewhere', description: 'ContactPage: social media widget title', + id: 'Qh2CwH', })} github={true} gitlab={true} @@ -128,6 +134,7 @@ export const getStaticProps: GetStaticProps = async ( const breadcrumbTitle = intl.formatMessage({ defaultMessage: 'Contact', description: 'ContactPage: breadcrumb item', + id: 'CzTbM4', }); const { locale } = context; const translation = await loadTranslation(locale); diff --git a/src/pages/cv.tsx b/src/pages/cv.tsx index 39dfeed..71eb449 100644 --- a/src/pages/cv.tsx +++ b/src/pages/cv.tsx @@ -31,6 +31,7 @@ const CV: NextPageWithLayout = () => { { defaultMessage: 'CV Front-end developer - {websiteName}', description: 'CVPage: SEO - Page title', + id: 'Y1ZdJ6', }, { websiteName: settings.name } ); @@ -39,6 +40,7 @@ const CV: NextPageWithLayout = () => { defaultMessage: 'Discover the curriculum of {websiteName}, front-end developer located in France: skills, experiences and training.', description: 'CVPage: SEO - Meta description', + id: 'bBdMGm', }, { websiteName: settings.name } ); @@ -86,6 +88,7 @@ const CV: NextPageWithLayout = () => { { defaultMessage: "{name}'s CV", description: 'CVPage: page title', + id: 'Mj2BQf', }, { name: settings.name } ); @@ -117,6 +120,7 @@ const CV: NextPageWithLayout = () => { ariaLabel={intl.formatMessage({ defaultMessage: 'Table of Contents', description: 'CVPage: ToC sidebar aria-label', + id: 'g4DckL', })} > <ToC /> @@ -129,12 +133,14 @@ const CV: NextPageWithLayout = () => { ariaLabel={intl.formatMessage({ defaultMessage: 'Sidebar', description: 'CVPage: right sidebar aria-label', + id: 'QHOm5t', })} > <CVPreview title={intl.formatMessage({ defaultMessage: 'Others formats', description: 'CVPage: cv preview widget title', + id: 'B9OCyV', })} imgSrc={image} pdf={pdf} @@ -143,6 +149,7 @@ const CV: NextPageWithLayout = () => { title={intl.formatMessage({ defaultMessage: 'Open-source projects', description: 'CVPage: social media widget title', + id: '+Dre5J', })} github={true} gitlab={true} diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 513df69..ca0a809 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -38,6 +38,7 @@ const Home: NextPageWithLayout<HomePageProps> = ({ {intl.formatMessage({ defaultMessage: 'Web development', description: 'HomePage: link to web development thematic', + id: 'vkF/RP', })} </ButtonLink> </li> @@ -46,6 +47,7 @@ const Home: NextPageWithLayout<HomePageProps> = ({ {intl.formatMessage({ defaultMessage: 'Projects', description: 'HomePage: link to projects', + id: 'N44SOc', })} </ButtonLink> </li> @@ -84,6 +86,7 @@ const Home: NextPageWithLayout<HomePageProps> = ({ {intl.formatMessage({ defaultMessage: 'Free', description: 'HomePage: link to free thematic', + id: 'w8GrOf', })} </ButtonLink> </li> @@ -92,6 +95,7 @@ const Home: NextPageWithLayout<HomePageProps> = ({ {intl.formatMessage({ defaultMessage: 'Linux', description: 'HomePage: link to Linux thematic', + id: 'jASD7k', })} </ButtonLink> </li> @@ -107,6 +111,7 @@ const Home: NextPageWithLayout<HomePageProps> = ({ {intl.formatMessage({ defaultMessage: 'Shaarli', description: 'HomePage: link to Shaarli', + id: 'i5L19t', })} </ButtonLink> </li> @@ -123,6 +128,7 @@ const Home: NextPageWithLayout<HomePageProps> = ({ {intl.formatMessage({ defaultMessage: 'Contact me', description: 'HomePage: contact button text', + id: 'sO/Iwj', })} </ButtonLink> </li> @@ -132,6 +138,7 @@ const Home: NextPageWithLayout<HomePageProps> = ({ {intl.formatMessage({ defaultMessage: 'Subscribe', description: 'HomePage: RSS feed subscription text', + id: 'T4YA64', })} </ButtonLink> </li> @@ -157,6 +164,7 @@ const Home: NextPageWithLayout<HomePageProps> = ({ { defaultMessage: '{websiteName} | Front-end developer: WordPress/React', description: 'HomePage: SEO - Page title', + id: 'PXp2hv', }, { websiteName: settings.name } ); @@ -165,6 +173,7 @@ const Home: NextPageWithLayout<HomePageProps> = ({ defaultMessage: '{websiteName} is a front-end developer located in France. He codes and he writes mostly about web development and open-source.', description: 'HomePage: SEO - Meta description', + id: 'tMuNTy', }, { websiteName: settings.name } ); diff --git a/src/pages/mentions-legales.tsx b/src/pages/mentions-legales.tsx index 1bc5c31..b103b5e 100644 --- a/src/pages/mentions-legales.tsx +++ b/src/pages/mentions-legales.tsx @@ -35,6 +35,7 @@ const LegalNotice: NextPageWithLayout = () => { { defaultMessage: 'Legal notice - {websiteName}', description: 'LegalNoticePage: SEO - Page title', + id: '4zAUSu', }, { websiteName: settings.name } ); @@ -42,6 +43,7 @@ const LegalNotice: NextPageWithLayout = () => { { defaultMessage: "Discover the legal notice of {websiteName}'s website.", description: 'LegalNoticePage: SEO - Meta description', + id: 'uvB+32', }, { websiteName: settings.name } ); @@ -49,6 +51,7 @@ const LegalNotice: NextPageWithLayout = () => { const title = intl.formatMessage({ defaultMessage: 'Legal notice', description: 'LegalNoticePage: page title', + id: '/IirIt', }); const publicationDate = new Date(dates.publication); const updateDate = new Date(dates.update); diff --git a/src/pages/projet/[slug].tsx b/src/pages/projet/[slug].tsx index 51f3d0b..b9a8f39 100644 --- a/src/pages/projet/[slug].tsx +++ b/src/pages/projet/[slug].tsx @@ -117,6 +117,7 @@ const Project: NextPageWithLayout<ProjectProps> = ({ ariaLabel={intl.formatMessage({ defaultMessage: 'Table of Contents', description: 'ProjectPage: ToC sidebar aria-label', + id: '6dXfvr', })} > <ToC /> @@ -130,6 +131,7 @@ const Project: NextPageWithLayout<ProjectProps> = ({ ariaLabel={intl.formatMessage({ defaultMessage: 'Sidebar', description: 'ProjectPage: right sidebar aria-label', + id: 'hHrNd0', })} > <Sharing title={title} excerpt={intro} /> diff --git a/src/pages/projets.tsx b/src/pages/projets.tsx index 7fb7187..8a81f39 100644 --- a/src/pages/projets.tsx +++ b/src/pages/projets.tsx @@ -28,6 +28,7 @@ const Projects = ({ projects }: { projects: Project[] }) => { { defaultMessage: 'Projects: open-source makings - {websiteName}', description: 'ProjectsPage: SEO - Page title', + id: 'SX1z3t', }, { websiteName: settings.name } ); @@ -36,6 +37,7 @@ const Projects = ({ projects }: { projects: Project[] }) => { defaultMessage: 'Discover {websiteName} projects. Mostly related to web development and open source.', description: 'ProjectsPage: SEO - Meta description', + id: 's6U1Xt', }, { websiteName: settings.name } ); diff --git a/src/pages/recherche/index.tsx b/src/pages/recherche/index.tsx index 42e45cd..b843f8d 100644 --- a/src/pages/recherche/index.tsx +++ b/src/pages/recherche/index.tsx @@ -81,12 +81,14 @@ const Search: NextPageWithLayout = () => { { defaultMessage: 'Search results for {query}', description: 'SearchPage: search results text', + id: 'VSGuGE', }, { query } ) : intl.formatMessage({ defaultMessage: 'Search', description: 'SearchPage: page title', + id: 'U+35YD', }); const description = query @@ -94,6 +96,7 @@ const Search: NextPageWithLayout = () => { { defaultMessage: 'Discover search results for {query}', description: 'SearchPage: meta description with query', + id: 'A4LTGq', }, { query } ) @@ -101,6 +104,7 @@ const Search: NextPageWithLayout = () => { { defaultMessage: 'Search for a post on {websiteName}', description: 'SearchPage: meta description without query', + id: 'PrIz5o', }, { websiteName: settings.name } ); @@ -122,6 +126,7 @@ const Search: NextPageWithLayout = () => { return intl.formatMessage({ defaultMessage: 'Failed to load.', description: 'SearchPage: failed to load text', + id: 'fOe8rH', }); if (!data) return <Spinner />; @@ -155,6 +160,7 @@ const Search: NextPageWithLayout = () => { {intl.formatMessage({ defaultMessage: 'Load more?', description: 'SearchPage: load more text', + id: 'pEtJik', })} </Button> </> @@ -165,12 +171,14 @@ const Search: NextPageWithLayout = () => { title={intl.formatMessage({ defaultMessage: 'Thematics', description: 'SearchPage: thematics list widget title', + id: 'Dq6+WH', })} /> <TopicsList title={intl.formatMessage({ defaultMessage: 'Topics', description: 'SearchPage: topics list widget title', + id: 'N804XO', })} /> </Sidebar> @@ -188,6 +196,7 @@ export const getStaticProps: GetStaticProps = async ( const breadcrumbTitle = intl.formatMessage({ defaultMessage: 'Search', description: 'SearchPage: breadcrumb item', + id: 'TfU6Qm', }); const { locale } = context; const translation = await loadTranslation(locale); diff --git a/src/pages/sujet/[slug].tsx b/src/pages/sujet/[slug].tsx index bb22a88..30dd36c 100644 --- a/src/pages/sujet/[slug].tsx +++ b/src/pages/sujet/[slug].tsx @@ -138,6 +138,7 @@ const Topic: NextPageWithLayout<TopicProps> = ({ topic, allTopics }) => { ariaLabel={intl.formatMessage({ defaultMessage: 'Table of Contents', description: 'TopicPage: ToC sidebar aria-label', + id: 'lsDB5G', })} > <ToC /> @@ -151,6 +152,7 @@ const Topic: NextPageWithLayout<TopicProps> = ({ topic, allTopics }) => { { defaultMessage: 'All posts in {name}', description: 'TopicPage: posts list title', + id: 'FLkF2R', }, { name: topic.title } )} @@ -164,6 +166,7 @@ const Topic: NextPageWithLayout<TopicProps> = ({ topic, allTopics }) => { ariaLabel={intl.formatMessage({ defaultMessage: 'Sidebar', description: 'TopicPage: right sidebar aria-label', + id: 'eu3beS', })} > <RelatedThematics thematics={relatedThematics.current} /> @@ -172,6 +175,7 @@ const Topic: NextPageWithLayout<TopicProps> = ({ topic, allTopics }) => { title={intl.formatMessage({ defaultMessage: 'Others topics', description: 'TopicPage: topics list widget title', + id: '+4tiVb', })} /> </Sidebar> diff --git a/src/pages/thematique/[slug].tsx b/src/pages/thematique/[slug].tsx index edc4296..db22214 100644 --- a/src/pages/thematique/[slug].tsx +++ b/src/pages/thematique/[slug].tsx @@ -128,6 +128,7 @@ const Thematic: NextPageWithLayout<ThematicProps> = ({ ariaLabel={intl.formatMessage({ defaultMessage: 'Table of Contents', description: 'ThematicPage: ToC sidebar aria-label', + id: 'YwvYfw', })} > <ToC /> @@ -141,6 +142,7 @@ const Thematic: NextPageWithLayout<ThematicProps> = ({ { defaultMessage: 'All posts in {name}', description: 'ThematicPage: posts list title', + id: 'P7fxX2', }, { name: thematic.title } )} @@ -154,6 +156,7 @@ const Thematic: NextPageWithLayout<ThematicProps> = ({ ariaLabel={intl.formatMessage({ defaultMessage: 'Sidebar', description: 'ThematicPage: right sidebar aria-label', + id: 'syLgY9', })} > <RelatedTopics topics={relatedTopics.current} /> @@ -162,6 +165,7 @@ const Thematic: NextPageWithLayout<ThematicProps> = ({ title={intl.formatMessage({ defaultMessage: 'Others thematics', description: 'ThematicPage: thematics list widget title', + id: 'norrGp', })} /> </Sidebar> |
