Skip to content

Commit 7188c44

Browse files
authored
Add missing translations (#331)
1 parent 0657f8e commit 7188c44

File tree

15 files changed

+82
-39
lines changed

15 files changed

+82
-39
lines changed

admin/src/components/ApproveFlow/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ export const ApproveFlow: FC<{ id: number, canModerate: AllowedActions['canModer
5555
<>
5656
<IconButton
5757
onClick={handleApproveClick}
58-
label="Approve"
58+
label={getMessage("page.details.actions.comment.reports.approve", "Approve")}
5959
>
6060
<Check />
6161
</IconButton>
6262
<IconButton
63-
label="Reject"
63+
label={getMessage("page.details.actions.comment.reports.reject", "Reject")}
6464
onClick={handleRejectClick}
6565
>
6666
<Cross />

admin/src/components/CommentRow/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ export const CommentRow: FC<Props> = ({ item }) => {
131131
{canReviewReports && <ReviewFlow item={item} />}
132132
<IconButton
133133
onClick={onClickDetails(item.id)}
134-
label="View"
134+
label={getMessage("page.details.filters.label", "View")}
135135
>
136136
<Eye />
137137
</IconButton>

admin/src/components/ReviewFlow/ReportReviewTable.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,22 +79,22 @@ export const ReportReviewTable: FC<Props> = ({
7979
</Th>
8080
<Th>
8181
<Typography variant="sigma">
82-
Reason
82+
{getMessage('page.reports.table.header.reason', 'Reason')}
8383
</Typography>
8484
</Th>
8585
<Th>
8686
<Typography variant="sigma">
87-
Content
87+
{getMessage('page.reports.table.header.content', 'Content')}
8888
</Typography>
8989
</Th>
9090
<Th>
9191
<Typography variant="sigma">
92-
CreateAt
92+
{getMessage('page.reports.table.header.issueDate', 'Issue date')}
9393
</Typography>
9494
</Th>
9595
<Th>
9696
<Typography variant="sigma">
97-
Status
97+
{getMessage('page.reports.table.header.status', 'Status')}
9898
</Typography>
9999
</Th>
100100
<Th />

admin/src/components/SideNav/index.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
import { SubNav, SubNavHeader, SubNavLink, SubNavSection, SubNavSections } from '@strapi/design-system';
22

3+
import { getMessage } from '../../utils';
4+
35
export const SideNav = () => {
4-
// TODO: add translations
56
return (
67
<SubNav ariaLabel="Comments sub nav">
7-
<SubNavHeader label="Comments" />
8+
<SubNavHeader label={getMessage('plugin.name')} />
89
<SubNavSections>
9-
<SubNavSection label="Moderation">
10+
<SubNavSection label={getMessage('nav.header.moderation')}>
1011
<SubNavLink href="/admin/plugins/comments/discover">
11-
Discover
12+
{getMessage('nav.item.discover')}
1213
</SubNavLink>
1314
<SubNavLink
1415
href="/admin/plugins/comments/reports"
1516
withBullet={false}
1617
>
17-
Reports
18+
{getMessage('nav.item.reports')}
1819
</SubNavLink>
1920
</SubNavSection>
2021
</SubNavSections>

admin/src/components/Wysiwyg/WysiwygNav.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -91,18 +91,18 @@ const WysiwygNav = ({
9191
</Field.Root>
9292

9393
<MainButtons>
94-
<IconButton disabled label="Bold" name="Bold">
94+
<IconButton disabled label={getMessage('wysiwyg.bold', "Bold")} name="Bold">
9595
<Bold />
9696
</IconButton>
97-
<IconButton disabled label="Italic" name="Italic">
97+
<IconButton disabled label={getMessage('wysiwyg.italic', "Italic")} name="Italic">
9898
<Italic />
9999
</IconButton>
100-
<IconButton disabled label="Underline" name="Underline">
100+
<IconButton disabled label={getMessage('wysiwyg.underline', "Underline")} name="Underline">
101101
<Underline />
102102
</IconButton>
103103
</MainButtons>
104104

105-
<MoreButton disabled label="More">
105+
<MoreButton disabled label={getMessage('common.more', "More")}>
106106
<More />
107107
</MoreButton>
108108
</Flex>
@@ -145,27 +145,27 @@ const WysiwygNav = ({
145145
</Field.Root>
146146

147147
<MainButtons>
148-
<IconButton onClick={() => onActionClick('Bold', editorRef)} label="Bold" name="Bold">
148+
<IconButton onClick={() => onActionClick('Bold', editorRef)} label={getMessage('wysiwyg.bold', "Bold")} name="Bold">
149149
<Bold />
150150
</IconButton>
151151
<IconButton
152152
onClick={() => onActionClick('Italic', editorRef)}
153-
label="Italic"
153+
label={getMessage('wysiwyg.italic', "Italic")}
154154
name="Italic"
155155
>
156156
<Italic />
157157
</IconButton>
158158
<IconButton
159159
onClick={() => onActionClick('Underline', editorRef)}
160-
label="Underline"
160+
label={getMessage('wysiwyg.underline', "Underline")}
161161
name="Underline"
162162
>
163163
<Underline />
164164
</IconButton>
165165
</MainButtons>
166166
<Popover.Root>
167167
<Popover.Trigger>
168-
<MoreButton label="More">
168+
<MoreButton label={getMessage('common.more', "More")}>
169169
<More />
170170
</MoreButton>
171171
</Popover.Trigger>
@@ -174,21 +174,21 @@ const WysiwygNav = ({
174174
<IconButtonGroupMargin>
175175
<IconButton
176176
onClick={() => onActionClick('Strikethrough', editorRef, handleTogglePopover)}
177-
label="Strikethrough"
177+
label={getMessage('wysiwyg.strikethrough', "Strikethrough")}
178178
name="Strikethrough"
179179
>
180180
<StrikeThrough />
181181
</IconButton>
182182
<IconButton
183183
onClick={() => onActionClick('BulletList', editorRef, handleTogglePopover)}
184-
label="BulletList"
184+
label={getMessage('wysiwyg.bulletList', "BulletList")}
185185
name="BulletList"
186186
>
187187
<BulletList />
188188
</IconButton>
189189
<IconButton
190190
onClick={() => onActionClick('NumberList', editorRef, handleTogglePopover)}
191-
label="NumberList"
191+
label={getMessage('wysiwyg.numberList', "NumberList")}
192192
name="NumberList"
193193
>
194194
<NumberList />
@@ -197,21 +197,21 @@ const WysiwygNav = ({
197197
<IconButtonGroup>
198198
<IconButton
199199
onClick={() => onActionClick('Code', editorRef, handleTogglePopover)}
200-
label="Code"
200+
label={getMessage('wysiwyg.code', "Code")}
201201
name="Code"
202202
>
203203
<Code />
204204
</IconButton>
205205
<IconButton
206206
onClick={() => onActionClick('Link', editorRef, handleTogglePopover)}
207-
label="Link"
207+
label={getMessage('wysiwyg.link', "Link")}
208208
name="Link"
209209
>
210210
<Link />
211211
</IconButton>
212212
<IconButton
213213
onClick={() => onActionClick('Quote', editorRef, handleTogglePopover)}
214-
label="Quote"
214+
label={getMessage('wysiwyg.quote', "Quote")}
215215
name="Quote"
216216
>
217217
<Quotes />

admin/src/pages/Details/DetailsEntry.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export const DetailsEntry: FC<DetailsEntryProps> = ({ config, entity, filters, o
9292
onCheckedChange={handleOnChange}
9393
>
9494
{getMessage(
95-
"page.details.filters.removed.label",
95+
"page.details.filters.removed.visibility",
9696
"Show removed comments"
9797
)}
9898
</Checkbox>

admin/src/pages/Discover/index.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,20 @@ export const Discover: FC<{ config: Config }> = ({ config }) => {
1919
<Page.Main>
2020
<Layouts.Header
2121
title={getMessage('page.discover.header')}
22-
subtitle={`${pagination.total} entries found`}
22+
subtitle={getMessage(
23+
{
24+
id: `page.discover.header.count`,
25+
props: {
26+
count: pagination.total,
27+
},
28+
},
29+
`${pagination.total} entries found`
30+
)}
2331
as="h2"
2432
/>
2533
<Layouts.Action startActions={
2634
<>
27-
<SearchInput label="Search" />
35+
<SearchInput label={getMessage('common.search', "Search")} />
2836
<CommentsStatusFilters setQueryParams={setQueryParams}/>
2937
</>
3038
}/>

admin/src/pages/Reports/index.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,21 @@ export const Reports: FC<{ config: Config }> = ({ config }) => {
6161
<Page.Title children={'Comments - reports'} />
6262
<Page.Main>
6363
<Layouts.Header
64-
title="Resolve threads"
65-
subtitle={`${pagination.total} entries found`}
64+
title={getMessage('page.reports.header', 'Resolved reports')}
65+
subtitle={getMessage(
66+
{
67+
id: `page.discover.header.count`,
68+
props: {
69+
count: pagination.total,
70+
},
71+
},
72+
`${pagination.total} entries found`
73+
)}
6674
as="h2"
6775
/>
6876
<Layouts.Action startActions={(
6977
<Flex gap="2">
70-
<SearchInput label="Search" />
78+
<SearchInput label={getMessage('common.search', "Search")} />
7179
{selectedItems.length > 0 && (
7280
<Button
7381
variant="success"

admin/src/translations/en.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ const en = {
33
'plugin.section': 'Comments plugin',
44
'plugin.section.item': 'Configuration',
55
'common.button.back': 'Go back',
6+
'common.more': 'More',
7+
'common.search': 'Search',
68
'nav.header.moderation': 'Moderation',
79
'nav.header.settings': 'Settings',
810
'nav.item.updates': 'Updates',
@@ -22,7 +24,7 @@ const en = {
2224
'page.common.item.status.setFilter': 'Set status...',
2325
'page.updates.header': 'Recent updates',
2426
'page.discover.header': 'Discover threads',
25-
'page.discover.header.count': 'entries found',
27+
'page.discover.header.count': '{count} entries found',
2628
'page.discover.table.header.id': 'ID',
2729
'page.discover.table.header.author': 'Author',
2830
'page.discover.table.header.message': 'Message',
@@ -99,6 +101,8 @@ const en = {
99101
'page.details.actions.comment.delete': 'Delete comment',
100102
'page.details.actions.comment.delete.confirmation.success': 'Comment has been deleted',
101103
'page.details.actions.comment.reports.review': 'Review',
104+
'page.details.actions.comment.reports.approve': 'Approve',
105+
'page.details.actions.comment.reports.reject': 'Reject',
102106
'page.details.actions.thread.block': 'Block thread',
103107
'page.details.actions.thread.block.confirmation.header': 'Moderation: Block thread',
104108
'page.details.actions.thread.block.confirmation.description': 'Do you really want to block whole thread? No further discussions are going to be allowed.',
@@ -191,6 +195,15 @@ const en = {
191195
'customField.comments.input.populate.label': 'Populate',
192196
'customField.comments.input.populate.author.label': 'Populate author field',
193197
'customField.comments.input.populate.avatar.label': 'Populate avatar field',
198+
'wysiwyg.bold': 'Bold',
199+
'wysiwyg.italic': 'Italic',
200+
'wysiwyg.underline': 'Underline',
201+
'wysiwyg.strikethrough': 'Strikethrough',
202+
'wysiwyg.bulletList': 'Bullet list',
203+
'wysiwyg.numberList': 'Number list',
204+
'wysiwyg.code': 'Code',
205+
'wysiwyg.link': 'Link',
206+
'wysiwyg.quote': 'Quote',
194207
};
195208

196209
export type CommentsPluginTranslations = Partial<typeof en>;

admin/src/translations/fr.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ export default {
55
'plugin.section': 'Plugin de commentaires',
66
'plugin.section.item': 'Configuration',
77
'common.button.back': 'Retour',
8+
'common.more': 'Plus',
9+
'common.search': 'Rechercher',
810
'nav.header.moderation': 'Modération',
911
'nav.header.settings': 'Paramètres',
1012
'nav.item.updates': 'Mises à jour',
@@ -24,7 +26,7 @@ export default {
2426
'page.common.item.status.setFilter': 'Définir le statut…',
2527
'page.updates.header': 'Mises à jour récentes',
2628
'page.discover.header': 'Découvrir les fils de discussion',
27-
'page.discover.header.count': 'entrées trouvées',
29+
'page.discover.header.count': '{count} entrées trouvées',
2830
'page.discover.table.header.id': 'ID',
2931
'page.discover.table.header.author': 'Auteur',
3032
'page.discover.table.header.message': 'Message',
@@ -101,6 +103,8 @@ export default {
101103
'page.details.actions.comment.delete': 'Supprimer le commentaire',
102104
'page.details.actions.comment.delete.confirmation.success': 'Le commentaire a été supprimé',
103105
'page.details.actions.comment.reports.review': 'Examiner',
106+
'page.details.actions.comment.reports.approve': 'Approuver',
107+
'page.details.actions.comment.reports.reject': 'Rejeter',
104108
'page.details.actions.thread.block': 'Bloquer le fil de discussion',
105109
'page.details.actions.thread.block.confirmation.header': 'Modération : Bloquer le fil de discussion',
106110
'page.details.actions.thread.block.confirmation.description': 'Voulez-vous vraiment bloquer tout le fil de discussion ? Aucune autre discussion ne sera autorisée.',
@@ -193,4 +197,13 @@ export default {
193197
'customField.comments.input.populate.label': 'Charger',
194198
'customField.comments.input.populate.author.label': 'Charger le champ auteur',
195199
'customField.comments.input.populate.avatar.label': 'Charger le champ avatar',
200+
'wysiwyg.bold': 'Gras',
201+
'wysiwyg.italic': 'Italique',
202+
'wysiwyg.underline': 'Souligné',
203+
'wysiwyg.strikethrough': 'Barré',
204+
'wysiwyg.bulletList': 'Liste à puces',
205+
'wysiwyg.numberList': 'Liste numérotée',
206+
'wysiwyg.code': 'Code',
207+
'wysiwyg.link': 'Lien',
208+
'wysiwyg.quote': 'Citation',
196209
} satisfies CommentsPluginTranslations;

0 commit comments

Comments
 (0)