From 4e7a96c5a831882463802cdd4f84fe1464969cb0 Mon Sep 17 00:00:00 2001
From: Armand Philippot
Date: Wed, 23 Mar 2022 12:29:43 +0100
Subject: 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.
---
src/components/Branding/Branding.tsx | 1 +
src/components/Breadcrumb/Breadcrumb.tsx | 7 +++++++
src/components/Buttons/ButtonHelp/ButtonHelp.tsx | 1 +
src/components/Buttons/ButtonToolbar/ButtonToolbar.tsx | 2 ++
src/components/Comment/Comment.tsx | 5 +++++
src/components/CommentForm/CommentForm.tsx | 12 ++++++++++++
src/components/CommentsList/CommentsList.tsx | 3 +++
src/components/ContactForm/ContactForm.tsx | 8 ++++++++
src/components/Footer/Footer.tsx | 1 +
src/components/FooterNav/FooterNav.tsx | 2 ++
src/components/Icons/Moon/Moon.tsx | 1 +
src/components/Icons/Sun/Sun.tsx | 1 +
src/components/Layouts/Layout.tsx | 2 ++
src/components/MDX/CodeBlock/CodeBlock.tsx | 5 +++++
src/components/MainNav/MainNav.tsx | 8 ++++++++
src/components/MetaItems/Author/Author.tsx | 1 +
src/components/MetaItems/CommentsCount/CommentsCount.tsx | 2 ++
src/components/MetaItems/Dates/Dates.tsx | 2 ++
src/components/MetaItems/PostsCount/PostsCount.tsx | 2 ++
src/components/MetaItems/ReadingTime/ReadingTime.tsx | 6 +++++-
src/components/MetaItems/Thematics/Thematics.tsx | 1 +
src/components/MetaItems/Topics/Topics.tsx | 1 +
src/components/MetaItems/Website/Website.tsx | 1 +
src/components/Pagination/Pagination.tsx | 5 +++++
src/components/PaginationCursor/PaginationCursor.tsx | 2 ++
src/components/PostFooter/PostFooter.tsx | 1 +
src/components/PostPreview/PostPreview.tsx | 1 +
src/components/PostsList/PostsList.tsx | 2 ++
src/components/ProjectPreview/ProjectPreview.tsx | 2 ++
src/components/ProjectSummary/ProjectSummary.tsx | 8 ++++++++
src/components/SearchForm/SearchForm.tsx | 3 +++
src/components/Settings/AckeeSelect/AckeeSelect.tsx | 6 ++++++
.../Settings/PrismThemeToggle/PrismThemeToggle.tsx | 1 +
src/components/Settings/ReduceMotion/ReduceMotion.tsx | 3 +++
src/components/Settings/Settings.tsx | 1 +
src/components/Settings/ThemeToggle/ThemeToggle.tsx | 1 +
src/components/Spinner/Spinner.tsx | 1 +
src/components/Tooltip/Tooltip.tsx | 2 ++
.../WidgetParts/ExpandableWidget/ExpandableWidget.tsx | 2 ++
src/components/Widgets/CVPreview/CVPreview.tsx | 1 +
src/components/Widgets/RecentPosts/RecentPosts.tsx | 2 ++
src/components/Widgets/RelatedThematics/RelatedThematics.tsx | 1 +
src/components/Widgets/RelatedTopics/RelatedTopics.tsx | 1 +
src/components/Widgets/Sharing/Sharing.tsx | 12 +++++++++++-
src/components/Widgets/SocialMedia/SocialMedia.tsx | 4 ++++
src/components/Widgets/ThematicsList/ThematicsList.tsx | 1 +
src/components/Widgets/ToC/ToC.tsx | 3 +++
src/components/Widgets/TopicsList/TopicsList.tsx | 1 +
src/pages/404.tsx | 5 +++++
src/pages/article/[slug].tsx | 7 +++++++
src/pages/blog/index.tsx | 9 +++++++++
src/pages/blog/page/[id].tsx | 9 ++++++++-
src/pages/contact.tsx | 7 +++++++
src/pages/cv.tsx | 7 +++++++
src/pages/index.tsx | 9 +++++++++
src/pages/mentions-legales.tsx | 3 +++
src/pages/projet/[slug].tsx | 2 ++
src/pages/projets.tsx | 2 ++
src/pages/recherche/index.tsx | 9 +++++++++
src/pages/sujet/[slug].tsx | 4 ++++
src/pages/thematique/[slug].tsx | 4 ++++
61 files changed, 216 insertions(+), 3 deletions(-)
(limited to 'src')
diff --git a/src/components/Branding/Branding.tsx b/src/components/Branding/Branding.tsx
index 5c76fd2..b19116d 100644
--- a/src/components/Branding/Branding.tsx
+++ b/src/components/Branding/Branding.tsx
@@ -76,6 +76,7 @@ const Branding: BrandingReturn = ({ isHome = false }) => {
{
defaultMessage: '{brandingName} picture',
description: 'Branding: branding name picture.',
+ id: 'ILRLTq',
},
{
brandingName: settings.name,
diff --git a/src/components/Breadcrumb/Breadcrumb.tsx b/src/components/Breadcrumb/Breadcrumb.tsx
index 92350c0..a7b945a 100644
--- a/src/components/Breadcrumb/Breadcrumb.tsx
+++ b/src/components/Breadcrumb/Breadcrumb.tsx
@@ -25,6 +25,7 @@ const Breadcrumb = ({ pageTitle }: { pageTitle: string }) => {
{intl.formatMessage({
defaultMessage: 'Home',
description: 'Breadcrumb: Home item',
+ id: 'Enij19',
})}
@@ -37,6 +38,7 @@ const Breadcrumb = ({ pageTitle }: { pageTitle: string }) => {
{intl.formatMessage({
defaultMessage: 'Blog',
description: 'Breadcrumb: Blog item',
+ id: 'z0ic9c',
})}
@@ -51,6 +53,7 @@ const Breadcrumb = ({ pageTitle }: { pageTitle: string }) => {
{intl.formatMessage({
defaultMessage: 'Projects',
description: 'Breadcrumb: Projects item',
+ id: 'Igx3qp',
})}
@@ -70,6 +73,7 @@ const Breadcrumb = ({ pageTitle }: { pageTitle: string }) => {
name: intl.formatMessage({
defaultMessage: 'Home',
description: 'Breadcrumb: Home item',
+ id: 'Enij19',
}),
item: settings.url,
};
@@ -83,6 +87,7 @@ const Breadcrumb = ({ pageTitle }: { pageTitle: string }) => {
name: intl.formatMessage({
defaultMessage: 'Blog',
description: 'Breadcrumb: Blog item',
+ id: 'z0ic9c',
}),
item: `${settings.url}/blog`,
};
@@ -97,6 +102,7 @@ const Breadcrumb = ({ pageTitle }: { pageTitle: string }) => {
name: intl.formatMessage({
defaultMessage: 'Projects',
description: 'Breadcrumb: Projects item',
+ id: 'Igx3qp',
}),
item: `${settings.url}/projets`,
};
@@ -136,6 +142,7 @@ const Breadcrumb = ({ pageTitle }: { pageTitle: string }) => {
{intl.formatMessage({
defaultMessage: 'You are here:',
description: 'Breadcrumb: You are here prefix',
+ id: '16zl9Z',
})}
{getItems()}
diff --git a/src/components/Buttons/ButtonHelp/ButtonHelp.tsx b/src/components/Buttons/ButtonHelp/ButtonHelp.tsx
index 252e58c..2616a8f 100644
--- a/src/components/Buttons/ButtonHelp/ButtonHelp.tsx
+++ b/src/components/Buttons/ButtonHelp/ButtonHelp.tsx
@@ -32,6 +32,7 @@ const ButtonHelp = ({
{intl.formatMessage({
defaultMessage: 'Help',
description: 'ButtonHelp: screen reader text',
+ id: 'oPf+XA',
})}
diff --git a/src/components/Buttons/ButtonToolbar/ButtonToolbar.tsx b/src/components/Buttons/ButtonToolbar/ButtonToolbar.tsx
index e9f6079..7ceb70d 100644
--- a/src/components/Buttons/ButtonToolbar/ButtonToolbar.tsx
+++ b/src/components/Buttons/ButtonToolbar/ButtonToolbar.tsx
@@ -44,6 +44,7 @@ const ButtonToolbar = (
{
defaultMessage: 'Close {type}',
description: 'ButtonToolbar: Close button',
+ id: 'SWq8a4',
},
{
type,
@@ -56,6 +57,7 @@ const ButtonToolbar = (
{
defaultMessage: 'Open {type}',
description: 'ButtonToolbar: Open button',
+ id: 'Z1eSIz',
},
{
type,
diff --git a/src/components/Comment/Comment.tsx b/src/components/Comment/Comment.tsx
index e20c5aa..355363b 100644
--- a/src/components/Comment/Comment.tsx
+++ b/src/components/Comment/Comment.tsx
@@ -56,6 +56,7 @@ const Comment = ({
{
defaultMessage: '{date} at {time}',
description: 'Comment: publication date',
+ id: 'CT3ydM',
},
{
date,
@@ -88,6 +89,7 @@ const Comment = ({
{intl.formatMessage({
defaultMessage: 'Published on:',
description: 'Comment: publication date label',
+ id: 'soj7do',
})}
@@ -109,10 +111,12 @@ const Comment = ({
? intl.formatMessage({
defaultMessage: 'Cancel reply',
description: 'Comment: reply button',
+ id: 'e1Forh',
})
: intl.formatMessage({
defaultMessage: 'Reply',
description: 'Comment: reply button',
+ id: 'hzHuCc',
})}
@@ -148,6 +152,7 @@ const Comment = ({
{intl.formatMessage({
defaultMessage: 'This comment is awaiting moderation.',
description: 'Comment: awaiting moderation message',
+ id: 'rXeTkM',
})}
);
diff --git a/src/components/CommentForm/CommentForm.tsx b/src/components/CommentForm/CommentForm.tsx
index eb7c100..128dc58 100644
--- a/src/components/CommentForm/CommentForm.tsx
+++ b/src/components/CommentForm/CommentForm.tsx
@@ -63,6 +63,7 @@ const CommentForm = ({
intl.formatMessage({
defaultMessage: 'Thanks for your comment!',
description: 'CommentForm: success notice',
+ id: 'AVUUgG',
})
);
} else {
@@ -71,6 +72,7 @@ const CommentForm = ({
defaultMessage:
'Thanks for your comment! It is now awaiting moderation.',
description: 'CommentForm: success notice but awaiting moderation',
+ id: 'Ul2NIl',
})
);
}
@@ -85,6 +87,7 @@ const CommentForm = ({
defaultMessage:
'An unexpected error happened. Comment cannot be submitted.',
description: 'CommentForm: error notice',
+ id: 'cjK9Ad',
})
);
}
@@ -105,6 +108,7 @@ const CommentForm = ({
defaultMessage:
'Some required fields are empty. Comment cannot be submitted.',
description: 'CommentForm: missing required fields',
+ id: 'Rle+UK',
})
);
}
@@ -126,21 +130,25 @@ const CommentForm = ({
const nameLabelBody = intl.formatMessage({
defaultMessage: 'Name',
description: 'CommentForm: Name field label',
+ id: 'F7QxJH',
});
const emailLabelBody = intl.formatMessage({
defaultMessage: 'Email',
description: 'CommentForm: Email field label',
+ id: 'Oim3rQ',
});
const websiteLabelBody = intl.formatMessage({
defaultMessage: 'Website',
description: 'CommentForm: Website field label',
+ id: 'jN+dY5',
});
const commentLabelBody = intl.formatMessage({
defaultMessage: 'Comment',
description: 'CommentForm: Comment field label',
+ id: 'J4nhm4',
});
return (
@@ -149,6 +157,7 @@ const CommentForm = ({
{intl.formatMessage({
defaultMessage: 'Leave a comment',
description: 'CommentForm: Form title',
+ id: '+aHn7j',
})}