Skip to content

Commit f466baf

Browse files
fix(locales): add translations for some comment strings (#1764)
Co-authored-by: Nick the Sick <[email protected]>
1 parent 95a72b7 commit f466baf

File tree

25 files changed

+83
-12
lines changed

25 files changed

+83
-12
lines changed

packages/ariakit/src/comments/Comment.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import { Group as AriakitGroup } from "@ariakit/react";
22

33
import { assertEmpty } from "@blocknote/core";
4-
import { ComponentProps, useFocusWithin } from "@blocknote/react";
4+
import {
5+
ComponentProps,
6+
useDictionary,
7+
useFocusWithin,
8+
} from "@blocknote/react";
59
import { forwardRef, useState } from "react";
610

711
const AuthorInfo = forwardRef<
@@ -12,6 +16,7 @@ const AuthorInfo = forwardRef<
1216
>
1317
>((props, _ref) => {
1418
const { authorInfo, timeString, edited, ...rest } = props;
19+
const dict = useDictionary();
1520

1621
assertEmpty(rest, false);
1722

@@ -34,7 +39,7 @@ const AuthorInfo = forwardRef<
3439
<div className={"bn-ak-username"}>
3540
{authorInfo.username}
3641
<span>
37-
{timeString} {edited && "(edited)"}
42+
{timeString} {edited && `(${dict.comments.edited})`}
3843
</span>
3944
</div>
4045
</AriakitGroup>

packages/core/src/i18n/locales/ar.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,9 @@ export const ar: Dictionary = {
320320
},
321321
},
322322
comments: {
323+
edited: "تم التحرير",
324+
save_button_text: "حفظ",
325+
cancel_button_text: "إلغاء",
323326
actions: {
324327
add_reaction: "أضف تفاعلًا",
325328
resolve: "حل",

packages/core/src/i18n/locales/de.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,9 @@ export const de: Dictionary = {
334334
},
335335
},
336336
comments: {
337+
edited: "bearbeitet",
338+
save_button_text: "Speichern",
339+
cancel_button_text: "Abbrechen",
337340
actions: {
338341
add_reaction: "Reaktion hinzufügen",
339342
resolve: "Lösen",

packages/core/src/i18n/locales/en.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,9 @@ export const en = {
335335
},
336336
},
337337
comments: {
338+
edited: "edited",
339+
save_button_text: "Save",
340+
cancel_button_text: "Cancel",
338341
actions: {
339342
add_reaction: "Add reaction",
340343
resolve: "Resolve",

packages/core/src/i18n/locales/es.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,9 @@ export const es: Dictionary = {
333333
},
334334
},
335335
comments: {
336+
edited: "editado",
337+
save_button_text: "Guardar",
338+
cancel_button_text: "Cancelar",
336339
actions: {
337340
add_reaction: "Agregar reacción",
338341
resolve: "Resolver",

packages/core/src/i18n/locales/fr.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,9 @@ export const fr: Dictionary = {
359359
},
360360
},
361361
comments: {
362+
edited: "modifié",
363+
save_button_text: "Enregistrer",
364+
cancel_button_text: "Annuler",
362365
actions: {
363366
add_reaction: "Ajouter une réaction",
364367
resolve: "Résoudre",

packages/core/src/i18n/locales/hr.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,9 @@ export const hr: Dictionary = {
348348
},
349349
},
350350
comments: {
351+
edited: "uredio",
352+
save_button_text: "Spremi",
353+
cancel_button_text: "Odustani",
351354
actions: {
352355
add_reaction: "Dodaj reakciju",
353356
resolve: "Riješi",

packages/core/src/i18n/locales/is.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,9 @@ export const is: Dictionary = {
327327
},
328328
},
329329
comments: {
330+
edited: "breytt",
331+
save_button_text: "Vista",
332+
cancel_button_text: "Hætta",
330333
actions: {
331334
add_reaction: "Bæta við viðbrögðum",
332335
resolve: "Leysa",

packages/core/src/i18n/locales/it.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,9 @@ export const it: Dictionary = {
336336
},
337337
},
338338
comments: {
339+
edited: "modificato",
340+
save_button_text: "Salva",
341+
cancel_button_text: "Annulla",
339342
actions: {
340343
add_reaction: "Aggiungi reazione",
341344
resolve: "Risolvi",

packages/core/src/i18n/locales/ja.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,9 @@ export const ja: Dictionary = {
355355
},
356356
},
357357
comments: {
358+
edited: "編集済み",
359+
save_button_text: "保存",
360+
cancel_button_text: "キャンセル",
358361
actions: {
359362
add_reaction: "リアクションを追加",
360363
resolve: "解決",

packages/core/src/i18n/locales/ko.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,9 @@ export const ko: Dictionary = {
348348
},
349349
},
350350
comments: {
351+
edited: "수정됨",
352+
save_button_text: "저장",
353+
cancel_button_text: "취소",
351354
actions: {
352355
add_reaction: "반응 추가",
353356
resolve: "해결",

packages/core/src/i18n/locales/nl.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,9 @@ export const nl: Dictionary = {
334334
},
335335
},
336336
comments: {
337+
edited: "bewerkt",
338+
save_button_text: "Opslaan",
339+
cancel_button_text: "Annuleren",
337340
actions: {
338341
add_reaction: "Reactie toevoegen",
339342
resolve: "Oplossen",

packages/core/src/i18n/locales/no.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,9 @@ export const no: Dictionary = {
334334
},
335335
},
336336
comments: {
337+
edited: "redigert",
338+
save_button_text: "Lagre",
339+
cancel_button_text: "Avbryt",
337340
actions: {
338341
add_reaction: "Legg til reaksjon",
339342
resolve: "Løs",

packages/core/src/i18n/locales/pl.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,9 @@ export const pl: Dictionary = {
319319
},
320320
},
321321
comments: {
322+
edited: "edytowany",
323+
save_button_text: "Zapisz",
324+
cancel_button_text: "Anuluj",
322325
actions: {
323326
add_reaction: "Dodaj reakcję",
324327
resolve: "Rozwiąż",

packages/core/src/i18n/locales/pt.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,9 @@ export const pt: Dictionary = {
327327
},
328328
},
329329
comments: {
330+
edited: "editado",
331+
save_button_text: "Salvar",
332+
cancel_button_text: "Cancelar",
330333
actions: {
331334
add_reaction: "Adicionar reação",
332335
resolve: "Resolver",

packages/core/src/i18n/locales/ru.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,9 @@ export const ru: Dictionary = {
362362
},
363363
},
364364
comments: {
365+
edited: "изменен",
366+
save_button_text: "Сохранить",
367+
cancel_button_text: "Отменить",
365368
actions: {
366369
add_reaction: "Добавить реакцию",
367370
resolve: "Решить",

packages/core/src/i18n/locales/sk.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,9 @@ export const sk = {
333333
},
334334
},
335335
comments: {
336+
edited: "upravený",
337+
save_button_text: "Uložiť",
338+
cancel_button_text: "Zrušiť",
336339
actions: {
337340
add_reaction: "Pridať reakciu",
338341
resolve: "Vyriešiť",

packages/core/src/i18n/locales/uk.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,9 @@ export const uk: Dictionary = {
359359
},
360360
},
361361
comments: {
362+
edited: "відредаговано",
363+
save_button_text: "Зберегти",
364+
cancel_button_text: "Скасувати",
362365
actions: {
363366
add_reaction: "Додати реакцію",
364367
resolve: "Вирішити",

packages/core/src/i18n/locales/vi.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,9 @@ export const vi: Dictionary = {
334334
},
335335
},
336336
comments: {
337+
edited: "đã chỉnh sửa",
338+
save_button_text: "Lưu",
339+
cancel_button_text: "Hủy",
337340
actions: {
338341
add_reaction: "Thêm phản ứng",
339342
resolve: "Giải quyết",

packages/core/src/i18n/locales/zh-tw.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,9 @@ export const zhTW: Dictionary = {
368368
},
369369
},
370370
comments: {
371+
edited: "已編輯",
372+
save_button_text: "儲存",
373+
cancel_button_text: "取消",
371374
actions: {
372375
add_reaction: "新增回應",
373376
resolve: "解決",

packages/core/src/i18n/locales/zh.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,9 @@ export const zh: Dictionary = {
368368
},
369369
},
370370
comments: {
371+
edited: "已编辑",
372+
save_button_text: "保存",
373+
cancel_button_text: "取消",
371374
actions: {
372375
add_reaction: "添加反应",
373376
resolve: "解决",

packages/mantine/src/comments/Comment.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { assertEmpty } from "@blocknote/core";
2-
import { ComponentProps, mergeRefs } from "@blocknote/react";
2+
import { ComponentProps, mergeRefs, useDictionary } from "@blocknote/react";
33
import { Avatar, Group, Skeleton, Text } from "@mantine/core";
44
import { useFocusWithin, useHover } from "@mantine/hooks";
55
import { forwardRef } from "react";
@@ -12,6 +12,7 @@ const AuthorInfo = forwardRef<
1212
>
1313
>((props, _ref) => {
1414
const { authorInfo, timeString, edited, ...rest } = props;
15+
const dict = useDictionary();
1516

1617
assertEmpty(rest, false);
1718

@@ -40,7 +41,7 @@ const AuthorInfo = forwardRef<
4041
<Text fz="sm" fw={"bold"}>
4142
{authorInfo.username}
4243
<Text fz="xs" c="dimmed" span ml={"xs"}>
43-
{timeString} {edited && "(edited)"}
44+
{timeString} {edited && `(${dict.comments.edited})`}
4445
</Text>
4546
</Text>
4647
</Group>

packages/react/src/components/Comments/Comment.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,20 +297,20 @@ export const Comment = ({
297297
)}
298298
>
299299
<Components.Generic.Toolbar.Button
300-
mainTooltip="Save"
300+
mainTooltip={dict.comments.save_button_text}
301301
variant="compact"
302302
onClick={onEditSubmit}
303303
isDisabled={isEmpty}
304304
>
305-
Save
305+
{dict.comments.save_button_text}
306306
</Components.Generic.Toolbar.Button>
307307
<Components.Generic.Toolbar.Button
308308
className={"bn-button"}
309-
mainTooltip="Cancel"
309+
mainTooltip={dict.comments.cancel_button_text}
310310
variant="compact"
311311
onClick={onEditCancel}
312312
>
313-
Cancel
313+
{dict.comments.cancel_button_text}
314314
</Components.Generic.Toolbar.Button>
315315
</Components.Generic.Toolbar.Root>
316316
)}

packages/react/src/components/Comments/Thread.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,12 @@ export const Thread = ({
134134
)}
135135
>
136136
<Components.Generic.Toolbar.Button
137-
mainTooltip="Save"
137+
mainTooltip={dict.comments.save_button_text}
138138
variant="compact"
139139
isDisabled={isEmpty}
140140
onClick={onNewCommentSave}
141141
>
142-
Save
142+
{dict.comments.save_button_text}
143143
</Components.Generic.Toolbar.Button>
144144
</Components.Generic.Toolbar.Root>
145145
);

packages/shadcn/src/comments/Comment.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import { assertEmpty } from "@blocknote/core";
2-
import { ComponentProps, useFocusWithin } from "@blocknote/react";
2+
import {
3+
ComponentProps,
4+
useDictionary,
5+
useFocusWithin,
6+
} from "@blocknote/react";
37
import { forwardRef, useState } from "react";
48

59
import { cn } from "../lib/utils.js";
@@ -13,6 +17,7 @@ const AuthorInfo = forwardRef<
1317
>
1418
>((props, _ref) => {
1519
const { authorInfo, timeString, edited, ...rest } = props;
20+
const dict = useDictionary();
1621

1722
assertEmpty(rest, false);
1823

@@ -61,7 +66,7 @@ const AuthorInfo = forwardRef<
6166
>
6267
<span className={"bn-text-sm bn-font-bold"}>{authorInfo.username}</span>
6368
<span className={"bn-text-xs"}>
64-
{timeString} {edited && "(edited)"}
69+
{timeString} {edited && `(${dict.comments.edited})`}
6570
</span>
6671
</div>
6772
</div>

0 commit comments

Comments
 (0)