Skip to content

fix: untranslated comment strings #1764

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions packages/ariakit/src/comments/Comment.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import { Group as AriakitGroup } from "@ariakit/react";

import { assertEmpty } from "@blocknote/core";
import { ComponentProps, useFocusWithin } from "@blocknote/react";
import {
ComponentProps,
useDictionary,
useFocusWithin,
} from "@blocknote/react";
import { forwardRef, useState } from "react";

const AuthorInfo = forwardRef<
Expand All @@ -12,6 +16,7 @@ const AuthorInfo = forwardRef<
>
>((props, _ref) => {
const { authorInfo, timeString, edited, ...rest } = props;
const dict = useDictionary();

assertEmpty(rest, false);

Expand All @@ -34,7 +39,7 @@ const AuthorInfo = forwardRef<
<div className={"bn-ak-username"}>
{authorInfo.username}
<span>
{timeString} {edited && "(edited)"}
{timeString} {edited && `(${dict.comments.edited})`}
</span>
</div>
</AriakitGroup>
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/i18n/locales/ar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,9 @@ export const ar: Dictionary = {
},
},
comments: {
edited: "تم التحرير",
save_button_text: "حفظ",
cancel_button_text: "إلغاء",
actions: {
add_reaction: "أضف تفاعلًا",
resolve: "حل",
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/i18n/locales/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,9 @@ export const de: Dictionary = {
},
},
comments: {
edited: "bearbeitet",
save_button_text: "Speichern",
cancel_button_text: "Abbrechen",
actions: {
add_reaction: "Reaktion hinzufügen",
resolve: "Lösen",
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/i18n/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,9 @@ export const en = {
},
},
comments: {
edited: "edited",
save_button_text: "Save",
cancel_button_text: "Cancel",
actions: {
add_reaction: "Add reaction",
resolve: "Resolve",
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/i18n/locales/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,9 @@ export const es: Dictionary = {
},
},
comments: {
edited: "editado",
save_button_text: "Guardar",
cancel_button_text: "Cancelar",
actions: {
add_reaction: "Agregar reacción",
resolve: "Resolver",
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/i18n/locales/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,9 @@ export const fr: Dictionary = {
},
},
comments: {
edited: "modifié",
save_button_text: "Enregistrer",
cancel_button_text: "Annuler",
actions: {
add_reaction: "Ajouter une réaction",
resolve: "Résoudre",
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/i18n/locales/hr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,9 @@ export const hr: Dictionary = {
},
},
comments: {
edited: "uredio",
save_button_text: "Spremi",
cancel_button_text: "Odustani",
actions: {
add_reaction: "Dodaj reakciju",
resolve: "Riješi",
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/i18n/locales/is.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,9 @@ export const is: Dictionary = {
},
},
comments: {
edited: "breytt",
save_button_text: "Vista",
cancel_button_text: "Hætta",
actions: {
add_reaction: "Bæta við viðbrögðum",
resolve: "Leysa",
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/i18n/locales/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,9 @@ export const it: Dictionary = {
},
},
comments: {
edited: "modificato",
save_button_text: "Salva",
cancel_button_text: "Annulla",
actions: {
add_reaction: "Aggiungi reazione",
resolve: "Risolvi",
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/i18n/locales/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,9 @@ export const ja: Dictionary = {
},
},
comments: {
edited: "編集済み",
save_button_text: "保存",
cancel_button_text: "キャンセル",
actions: {
add_reaction: "リアクションを追加",
resolve: "解決",
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/i18n/locales/ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,9 @@ export const ko: Dictionary = {
},
},
comments: {
edited: "수정됨",
save_button_text: "저장",
cancel_button_text: "취소",
actions: {
add_reaction: "반응 추가",
resolve: "해결",
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/i18n/locales/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,9 @@ export const nl: Dictionary = {
},
},
comments: {
edited: "bewerkt",
save_button_text: "Opslaan",
cancel_button_text: "Annuleren",
actions: {
add_reaction: "Reactie toevoegen",
resolve: "Oplossen",
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/i18n/locales/no.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,9 @@ export const no: Dictionary = {
},
},
comments: {
edited: "redigert",
save_button_text: "Lagre",
cancel_button_text: "Avbryt",
actions: {
add_reaction: "Legg til reaksjon",
resolve: "Løs",
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/i18n/locales/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,9 @@ export const pl: Dictionary = {
},
},
comments: {
edited: "edytowany",
save_button_text: "Zapisz",
cancel_button_text: "Anuluj",
actions: {
add_reaction: "Dodaj reakcję",
resolve: "Rozwiąż",
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/i18n/locales/pt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,9 @@ export const pt: Dictionary = {
},
},
comments: {
edited: "editado",
save_button_text: "Salvar",
cancel_button_text: "Cancelar",
actions: {
add_reaction: "Adicionar reação",
resolve: "Resolver",
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/i18n/locales/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,9 @@ export const ru: Dictionary = {
},
},
comments: {
edited: "изменен",
save_button_text: "Сохранить",
cancel_button_text: "Отменить",
actions: {
add_reaction: "Добавить реакцию",
resolve: "Решить",
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/i18n/locales/sk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,9 @@ export const sk = {
},
},
comments: {
edited: "upravený",
save_button_text: "Uložiť",
cancel_button_text: "Zrušiť",
actions: {
add_reaction: "Pridať reakciu",
resolve: "Vyriešiť",
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/i18n/locales/uk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,9 @@ export const uk: Dictionary = {
},
},
comments: {
edited: "відредаговано",
save_button_text: "Зберегти",
cancel_button_text: "Скасувати",
actions: {
add_reaction: "Додати реакцію",
resolve: "Вирішити",
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/i18n/locales/vi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,9 @@ export const vi: Dictionary = {
},
},
comments: {
edited: "đã chỉnh sửa",
save_button_text: "Lưu",
cancel_button_text: "Hủy",
actions: {
add_reaction: "Thêm phản ứng",
resolve: "Giải quyết",
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/i18n/locales/zh-tw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,9 @@ export const zhTW: Dictionary = {
},
},
comments: {
edited: "已編輯",
save_button_text: "儲存",
cancel_button_text: "取消",
actions: {
add_reaction: "新增回應",
resolve: "解決",
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/i18n/locales/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,9 @@ export const zh: Dictionary = {
},
},
comments: {
edited: "已编辑",
save_button_text: "保存",
cancel_button_text: "取消",
actions: {
add_reaction: "添加反应",
resolve: "解决",
Expand Down
5 changes: 3 additions & 2 deletions packages/mantine/src/comments/Comment.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assertEmpty } from "@blocknote/core";
import { ComponentProps, mergeRefs } from "@blocknote/react";
import { ComponentProps, mergeRefs, useDictionary } from "@blocknote/react";
import { Avatar, Group, Skeleton, Text } from "@mantine/core";
import { useFocusWithin, useHover } from "@mantine/hooks";
import { forwardRef } from "react";
Expand All @@ -12,6 +12,7 @@ const AuthorInfo = forwardRef<
>
>((props, _ref) => {
const { authorInfo, timeString, edited, ...rest } = props;
const dict = useDictionary();

assertEmpty(rest, false);

Expand Down Expand Up @@ -40,7 +41,7 @@ const AuthorInfo = forwardRef<
<Text fz="sm" fw={"bold"}>
{authorInfo.username}
<Text fz="xs" c="dimmed" span ml={"xs"}>
{timeString} {edited && "(edited)"}
{timeString} {edited && `(${dict.comments.edited})`}
</Text>
</Text>
</Group>
Expand Down
8 changes: 4 additions & 4 deletions packages/react/src/components/Comments/Comment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -297,20 +297,20 @@ export const Comment = ({
)}
>
<Components.Generic.Toolbar.Button
mainTooltip="Save"
mainTooltip={dict.comments.save_button_text}
variant="compact"
onClick={onEditSubmit}
isDisabled={isEmpty}
>
Save
{dict.comments.save_button_text}
</Components.Generic.Toolbar.Button>
<Components.Generic.Toolbar.Button
className={"bn-button"}
mainTooltip="Cancel"
mainTooltip={dict.comments.cancel_button_text}
variant="compact"
onClick={onEditCancel}
>
Cancel
{dict.comments.cancel_button_text}
</Components.Generic.Toolbar.Button>
</Components.Generic.Toolbar.Root>
)}
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/components/Comments/Thread.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,12 @@ export const Thread = ({
)}
>
<Components.Generic.Toolbar.Button
mainTooltip="Save"
mainTooltip={dict.comments.save_button_text}
variant="compact"
isDisabled={isEmpty}
onClick={onNewCommentSave}
>
Save
{dict.comments.save_button_text}
</Components.Generic.Toolbar.Button>
</Components.Generic.Toolbar.Root>
);
Expand Down
9 changes: 7 additions & 2 deletions packages/shadcn/src/comments/Comment.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { assertEmpty } from "@blocknote/core";
import { ComponentProps, useFocusWithin } from "@blocknote/react";
import {
ComponentProps,
useDictionary,
useFocusWithin,
} from "@blocknote/react";
import { forwardRef, useState } from "react";

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

assertEmpty(rest, false);

Expand Down Expand Up @@ -61,7 +66,7 @@ const AuthorInfo = forwardRef<
>
<span className={"bn-text-sm bn-font-bold"}>{authorInfo.username}</span>
<span className={"bn-text-xs"}>
{timeString} {edited && "(edited)"}
{timeString} {edited && `(${dict.comments.edited})`}
</span>
</div>
</div>
Expand Down