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/components/MetaItems | |
| 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/components/MetaItems')
| -rw-r--r-- | src/components/MetaItems/Author/Author.tsx | 1 | ||||
| -rw-r--r-- | src/components/MetaItems/CommentsCount/CommentsCount.tsx | 2 | ||||
| -rw-r--r-- | src/components/MetaItems/Dates/Dates.tsx | 2 | ||||
| -rw-r--r-- | src/components/MetaItems/PostsCount/PostsCount.tsx | 2 | ||||
| -rw-r--r-- | src/components/MetaItems/ReadingTime/ReadingTime.tsx | 6 | ||||
| -rw-r--r-- | src/components/MetaItems/Thematics/Thematics.tsx | 1 | ||||
| -rw-r--r-- | src/components/MetaItems/Topics/Topics.tsx | 1 | ||||
| -rw-r--r-- | src/components/MetaItems/Website/Website.tsx | 1 |
8 files changed, 15 insertions, 1 deletions
diff --git a/src/components/MetaItems/Author/Author.tsx b/src/components/MetaItems/Author/Author.tsx index c3d78c2..4ff0086 100644 --- a/src/components/MetaItems/Author/Author.tsx +++ b/src/components/MetaItems/Author/Author.tsx @@ -10,6 +10,7 @@ const Author = ({ name, kind }: { name: string; kind: MetaKind }) => { title={intl.formatMessage({ defaultMessage: 'Written by:', description: 'Author: article author meta label', + id: 'jCyqZS', })} value={name} kind={kind} diff --git a/src/components/MetaItems/CommentsCount/CommentsCount.tsx b/src/components/MetaItems/CommentsCount/CommentsCount.tsx index bd1990d..04cffa6 100644 --- a/src/components/MetaItems/CommentsCount/CommentsCount.tsx +++ b/src/components/MetaItems/CommentsCount/CommentsCount.tsx @@ -15,6 +15,7 @@ const CommentsCount = ({ total, kind }: { total: number; kind: MetaKind }) => { defaultMessage: '{total, plural, =0 {No comments} one {# comment} other {# comments}}', description: 'CommentsCount: comment count value', + id: 'lKGNKx', }, { total } ); @@ -25,6 +26,7 @@ const CommentsCount = ({ total, kind }: { total: number; kind: MetaKind }) => { title={intl.formatMessage({ defaultMessage: 'Comments:', description: 'CommentsCount: comment count meta label', + id: '6BRtAu', })} value={ isArticle() ? ( diff --git a/src/components/MetaItems/Dates/Dates.tsx b/src/components/MetaItems/Dates/Dates.tsx index 04dff3a..4314ed9 100644 --- a/src/components/MetaItems/Dates/Dates.tsx +++ b/src/components/MetaItems/Dates/Dates.tsx @@ -27,6 +27,7 @@ const Dates = ({ title={intl.formatMessage({ defaultMessage: 'Published on:', description: 'Dates: publication date meta label', + id: '52Fev1', })} values={[ <time key={publication} dateTime={publication}> @@ -40,6 +41,7 @@ const Dates = ({ title={intl.formatMessage({ defaultMessage: 'Updated on:', description: 'Dates: update date meta label', + id: 'C+r/LF', })} values={[ <time key={update} dateTime={update}> diff --git a/src/components/MetaItems/PostsCount/PostsCount.tsx b/src/components/MetaItems/PostsCount/PostsCount.tsx index 9fb1784..679abcd 100644 --- a/src/components/MetaItems/PostsCount/PostsCount.tsx +++ b/src/components/MetaItems/PostsCount/PostsCount.tsx @@ -10,12 +10,14 @@ const PostsCount = ({ total, kind }: { total: number; kind: MetaKind }) => { title={intl.formatMessage({ defaultMessage: 'Total:', description: 'PostCount: total found articles meta label', + id: 'p1zZ/Z', })} value={intl.formatMessage( { defaultMessage: '{total, plural, =0 {No articles} one {# article} other {# articles}}', description: 'PostCount: total found articles', + id: '4EMSLO', }, { total } )} diff --git a/src/components/MetaItems/ReadingTime/ReadingTime.tsx b/src/components/MetaItems/ReadingTime/ReadingTime.tsx index 94215b3..79d6f3c 100644 --- a/src/components/MetaItems/ReadingTime/ReadingTime.tsx +++ b/src/components/MetaItems/ReadingTime/ReadingTime.tsx @@ -20,6 +20,7 @@ const ReadingTime = ({ return intl.formatMessage({ defaultMessage: 'less than 1 minute', description: 'ReadingTime: Reading time value', + id: 'ySsWZl', }); } @@ -28,6 +29,7 @@ const ReadingTime = ({ defaultMessage: '{time, plural, =0 {# minutes} one {# minute} other {# minutes}}', description: 'ReadingTime: reading time value', + id: 'wdqOpf', }, { time } ); @@ -38,12 +40,14 @@ const ReadingTime = ({ title={intl.formatMessage({ defaultMessage: 'Reading time:', description: 'ReadingTime: reading time meta label', + id: 'n0Gbod', })} value={getEstimation()} info={intl.formatMessage( { - defaultMessage: `Approximately {number} words`, + defaultMessage: 'Approximately {number} words', description: 'ReadingTime: number of words', + id: 'k7/SkN', }, { number: words.toLocaleString(locale) } )} diff --git a/src/components/MetaItems/Thematics/Thematics.tsx b/src/components/MetaItems/Thematics/Thematics.tsx index a127715..e655c5d 100644 --- a/src/components/MetaItems/Thematics/Thematics.tsx +++ b/src/components/MetaItems/Thematics/Thematics.tsx @@ -30,6 +30,7 @@ const Thematics = ({ defaultMessage: '{thematicsCount, plural, =0 {Thematics:} one {Thematic:} other {Thematics:}}', description: 'Thematics: thematics list meta label', + id: '1r4ujR', }, { thematicsCount: list.length } )} diff --git a/src/components/MetaItems/Topics/Topics.tsx b/src/components/MetaItems/Topics/Topics.tsx index 4f2dc1f..d5d90f0 100644 --- a/src/components/MetaItems/Topics/Topics.tsx +++ b/src/components/MetaItems/Topics/Topics.tsx @@ -24,6 +24,7 @@ const Topics = ({ list, kind }: { list: TopicPreview[]; kind: MetaKind }) => { defaultMessage: '{topicsCount, plural, =0 {Topics:} one {Topic:} other {Topics:}}', description: 'Topics: topics list meta label', + id: '0pp/IQ', }, { topicsCount: list.length } )} diff --git a/src/components/MetaItems/Website/Website.tsx b/src/components/MetaItems/Website/Website.tsx index bcf3fc8..7d2dc06 100644 --- a/src/components/MetaItems/Website/Website.tsx +++ b/src/components/MetaItems/Website/Website.tsx @@ -10,6 +10,7 @@ const Website = ({ url, kind }: { url: string; kind: MetaKind }) => { title={intl.formatMessage({ defaultMessage: 'Website:', description: 'Website: website meta label', + id: 'JsOoAW', })} value={<a href={url}>{url}</a>} kind={kind} |
