fix: complete Chinese frontend localization

This commit is contained in:
2026-08-23 15:05:45 +08:00
parent 5a8a478386
commit 61123f708d
18 changed files with 721 additions and 163 deletions

View File

@@ -28,6 +28,7 @@ import ButtonComponent from "~/components/Button";
import ReactiveButton from "~/components/ReactiveButton"; import ReactiveButton from "~/components/ReactiveButton";
import UserMenu from "~/components/UserMenu"; import UserMenu from "~/components/UserMenu";
import WorkspaceMenu from "~/components/WorkspaceMenu"; import WorkspaceMenu from "~/components/WorkspaceMenu";
import { useLinguiContext } from "~/providers/lingui";
import { useWorkspace } from "~/providers/workspace"; import { useWorkspace } from "~/providers/workspace";
import { api } from "~/utils/api"; import { api } from "~/utils/api";
@@ -50,6 +51,7 @@ export default function SideNavigation({
}: SideNavigationProps) { }: SideNavigationProps) {
const router = useRouter(); const router = useRouter();
const { workspace } = useWorkspace(); const { workspace } = useWorkspace();
const { locale } = useLinguiContext();
const [isCollapsed, setIsCollapsed] = useState(false); const [isCollapsed, setIsCollapsed] = useState(false);
const [isInitialised, setIsInitialised] = useState(false); const [isInitialised, setIsInitialised] = useState(false);
@@ -143,7 +145,7 @@ export default function SideNavigation({
}, },
}, },
], ],
[isDarkMode], [isDarkMode, locale, router],
); );
const toggleCollapse = () => { const toggleCollapse = () => {

View File

@@ -7,6 +7,7 @@ import { HiCheck, HiMagnifyingGlass } from "react-icons/hi2";
import { twMerge } from "tailwind-merge"; import { twMerge } from "tailwind-merge";
import { useKeyboardShortcut } from "~/providers/keyboard-shortcuts"; import { useKeyboardShortcut } from "~/providers/keyboard-shortcuts";
import { useLinguiContext } from "~/providers/lingui";
import { useModal } from "~/providers/modal"; import { useModal } from "~/providers/modal";
import { useWorkspace } from "~/providers/workspace"; import { useWorkspace } from "~/providers/workspace";
import { api } from "~/utils/api"; import { api } from "~/utils/api";
@@ -20,6 +21,7 @@ export default function WorkspaceMenu({
}) { }) {
const { workspace, isLoading, availableWorkspaces, switchWorkspace } = const { workspace, isLoading, availableWorkspaces, switchWorkspace } =
useWorkspace(); useWorkspace();
const { locale } = useLinguiContext();
const { openModal } = useModal(); const { openModal } = useModal();
const { data: hasPartnerSlot } = const { data: hasPartnerSlot } =
api.workspace.hasAvailablePartnerSlot.useQuery(); api.workspace.hasAvailablePartnerSlot.useQuery();
@@ -37,7 +39,7 @@ export default function WorkspaceMenu({
description: t`Open command menu`, description: t`Open command menu`,
group: "GENERAL" as const, group: "GENERAL" as const,
}), }),
[], [locale],
); );
const { tooltipContent: commandPaletteShortcutTooltipContent } = const { tooltipContent: commandPaletteShortcutTooltipContent } =

View File

@@ -37,26 +37,21 @@
62 62
] ]
], ],
"translation": "{0}" "translation": "{0}",
"obsolete": true
}, },
"JArWcF": { "JArWcF": {
"message": "{0} | {1}", "message": "{0} | {1}",
"placeholders": { "placeholders": {
"0": [ "0": [
"card?.title ?? t`Card`", "card?.title ?? t`Card`"
"isTemplate ? \"Templates\" : \"Boards\""
], ],
"1": [ "1": [
"board?.name ?? t`Board`", "board?.name ?? t`Board`"
"workspace.name ?? t`Workspace`"
] ]
}, },
"comments": [], "comments": [],
"origin": [ "origin": [
[
"src/views/boards/index.tsx",
57
],
[ [
"src/views/card/index.tsx", "src/views/card/index.tsx",
321 321
@@ -126,7 +121,8 @@
570 570
] ]
], ],
"translation": "{0} not found" "translation": "{0} not found",
"obsolete": true
}, },
"0xWkkH": { "0xWkkH": {
"message": "{boardCount, plural, one {Import board (1)} other {Import boards ({boardCount})}}", "message": "{boardCount, plural, one {Import board (1)} other {Import boards ({boardCount})}}",
@@ -144,6 +140,25 @@
], ],
"translation": "{boardCount, plural, one {Import board (1)} other {Import boards ({boardCount})}}" "translation": "{boardCount, plural, one {Import board (1)} other {Import boards ({boardCount})}}"
}, },
"xbAVoi": {
"translation": "{boardLabel} | {0}",
"message": "{boardLabel} | {0}",
"placeholders": {
"0": [
"workspace.name ?? t`Workspace`"
],
"boardLabel": [
"boardLabel"
]
},
"comments": [],
"origin": [
[
"src/views/boards/index.tsx",
58
]
]
},
"yndBF+": { "yndBF+": {
"message": "{projectCount, plural, one {Import project (1)} other {Import projects ({projectCount})}}", "message": "{projectCount, plural, one {Import project (1)} other {Import projects ({projectCount})}}",
"placeholders": { "placeholders": {
@@ -335,7 +350,7 @@
"origin": [ "origin": [
[ [
"src/providers/keyboard-shortcuts.tsx", "src/providers/keyboard-shortcuts.tsx",
56 57
] ]
], ],
"translation": "Actions" "translation": "Actions"
@@ -371,7 +386,7 @@
"origin": [ "origin": [
[ [
"src/views/boards/index.tsx", "src/views/boards/index.tsx",
30 37
], ],
[ [
"src/views/settings/components/NewWebhookModal.tsx", "src/views/settings/components/NewWebhookModal.tsx",
@@ -1121,7 +1136,7 @@
"origin": [ "origin": [
[ [
"src/views/boards/index.tsx", "src/views/boards/index.tsx",
31 38
] ]
], ],
"translation": "Archived" "translation": "Archived"
@@ -1188,7 +1203,24 @@
36 36
] ]
], ],
"translation": "Are you sure you want to delete this {0}?" "translation": "Are you sure you want to delete this {0}?",
"obsolete": true
},
"I/URsS": {
"translation": "Are you sure you want to delete this {boardTypeLabel}?",
"message": "Are you sure you want to delete this {boardTypeLabel}?",
"placeholders": {
"boardTypeLabel": [
"boardTypeLabel"
]
},
"comments": [],
"origin": [
[
"src/views/board/components/DeleteBoardConfirmation.tsx",
37
]
]
}, },
"ZT4Khw": { "ZT4Khw": {
"message": "Are you sure you want to delete this card?", "message": "Are you sure you want to delete this card?",
@@ -1478,6 +1510,30 @@
], ],
"translation": "Blog Post" "translation": "Blog Post"
}, },
"TwoUcd": {
"translation": "board",
"message": "board",
"placeholders": {},
"comments": [],
"origin": [
[
"src/views/board/components/DeleteBoardConfirmation.tsx",
17
],
[
"src/views/boards/components/BoardsList.tsx",
17
],
[
"src/views/boards/components/NewBoardForm.tsx",
35
],
[
"src/views/boards/index.tsx",
35
]
]
},
"QD8opX": { "QD8opX": {
"message": "Board", "message": "Board",
"placeholders": {}, "placeholders": {},
@@ -1563,6 +1619,10 @@
"placeholders": {}, "placeholders": {},
"comments": [], "comments": [],
"origin": [ "origin": [
[
"src/views/board/index.tsx",
570
],
[ [
"src/views/public/board/index.tsx", "src/views/public/board/index.tsx",
181 181
@@ -1669,11 +1729,23 @@
"origin": [ "origin": [
[ [
"src/views/board/components/VisibilityButton.tsx", "src/views/board/components/VisibilityButton.tsx",
49 50
] ]
], ],
"translation": "Board visibility updated" "translation": "Board visibility updated"
}, },
"DaBhdY": {
"translation": "boards",
"message": "boards",
"placeholders": {},
"comments": [],
"origin": [
[
"src/views/boards/components/BoardsList.tsx",
18
]
]
},
"8TveY+": { "8TveY+": {
"message": "Boards", "message": "Boards",
"placeholders": {}, "placeholders": {},
@@ -1681,7 +1753,11 @@
"origin": [ "origin": [
[ [
"src/components/SideNavigation.tsx", "src/components/SideNavigation.tsx",
98 100
],
[
"src/views/boards/index.tsx",
34
], ],
[ [
"src/views/pricing/components/FeatureComparisonTable.tsx", "src/views/pricing/components/FeatureComparisonTable.tsx",
@@ -1697,7 +1773,7 @@
"origin": [ "origin": [
[ [
"src/views/boards/components/BoardsList.tsx", "src/views/boards/components/BoardsList.tsx",
66 68
] ]
], ],
"translation": "Boards you archive will appear here." "translation": "Boards you archive will appear here."
@@ -2141,7 +2217,7 @@
], ],
[ [
"src/views/board/components/DeleteBoardConfirmation.tsx", "src/views/board/components/DeleteBoardConfirmation.tsx",
44 45
], ],
[ [
"src/views/board/components/MoveBoardForm.tsx", "src/views/board/components/MoveBoardForm.tsx",
@@ -3057,7 +3133,24 @@
166 166
] ]
], ],
"translation": "Create {0}" "translation": "Create {0}",
"obsolete": true
},
"d+ACJK": {
"translation": "Create {boardTypeLabel}",
"message": "Create {boardTypeLabel}",
"placeholders": {
"boardTypeLabel": [
"boardTypeLabel"
]
},
"comments": [],
"origin": [
[
"src/views/boards/components/NewBoardForm.tsx",
167
]
]
}, },
"vgdzLf": { "vgdzLf": {
"message": "Create another", "message": "Create another",
@@ -3169,7 +3262,28 @@
45 45
] ]
], ],
"translation": "Create new {0}" "translation": "Create new {0}",
"obsolete": true
},
"O6v9mX": {
"translation": "Create new {boardTypeLabel}",
"message": "Create new {boardTypeLabel}",
"placeholders": {
"boardTypeLabel": [
"boardTypeLabel"
]
},
"comments": [],
"origin": [
[
"src/views/boards/components/BoardsList.tsx",
82
],
[
"src/views/boards/index.tsx",
46
]
]
}, },
"okpxfB": { "okpxfB": {
"message": "Create new key", "message": "Create new key",
@@ -3250,7 +3364,7 @@
], ],
[ [
"src/components/WorkspaceMenu.tsx", "src/components/WorkspaceMenu.tsx",
176 178
] ]
], ],
"translation": "Create workspace" "translation": "Create workspace"
@@ -3535,7 +3649,7 @@
], ],
[ [
"src/views/board/components/DeleteBoardConfirmation.tsx", "src/views/board/components/DeleteBoardConfirmation.tsx",
47 48
], ],
[ [
"src/views/card/components/DeleteCardConfirmation.tsx", "src/views/card/components/DeleteCardConfirmation.tsx",
@@ -4448,11 +4562,11 @@
"origin": [ "origin": [
[ [
"src/views/boards/components/NewBoardForm.tsx", "src/views/boards/components/NewBoardForm.tsx",
77 78
], ],
[ [
"src/views/boards/components/NewBoardForm.tsx", "src/views/boards/components/NewBoardForm.tsx",
92 93
], ],
[ [
"src/views/members/components/InviteMemberForm.tsx", "src/views/members/components/InviteMemberForm.tsx",
@@ -4781,11 +4895,11 @@
"origin": [ "origin": [
[ [
"src/views/boards/components/NewBoardForm.tsx", "src/views/boards/components/NewBoardForm.tsx",
78 79
], ],
[ [
"src/views/boards/components/NewBoardForm.tsx", "src/views/boards/components/NewBoardForm.tsx",
93 94
] ]
], ],
"translation": "Failed to create board" "translation": "Failed to create board"
@@ -5189,7 +5303,7 @@
"origin": [ "origin": [
[ [
"src/providers/keyboard-shortcuts.tsx", "src/providers/keyboard-shortcuts.tsx",
54 55
] ]
], ],
"translation": "General" "translation": "General"
@@ -5256,7 +5370,24 @@
66 66
] ]
], ],
"translation": "Get started by creating a new {0}" "translation": "Get started by creating a new {0}",
"obsolete": true
},
"sllapH": {
"translation": "Get started by creating a new {boardTypeLabel}",
"message": "Get started by creating a new {boardTypeLabel}",
"placeholders": {
"boardTypeLabel": [
"boardTypeLabel"
]
},
"comments": [],
"origin": [
[
"src/views/boards/components/BoardsList.tsx",
68
]
]
}, },
"zC8Whw": { "zC8Whw": {
"message": "Get started by creating a new list", "message": "Get started by creating a new list",
@@ -5393,7 +5524,7 @@
"origin": [ "origin": [
[ [
"src/components/SideNavigation.tsx", "src/components/SideNavigation.tsx",
106 108
], ],
[ [
"src/pages/404.tsx", "src/pages/404.tsx",
@@ -5421,7 +5552,7 @@
"origin": [ "origin": [
[ [
"src/components/SideNavigation.tsx", "src/components/SideNavigation.tsx",
130 132
] ]
], ],
"translation": "Go to members" "translation": "Go to members"
@@ -5433,7 +5564,7 @@
"origin": [ "origin": [
[ [
"src/components/SideNavigation.tsx", "src/components/SideNavigation.tsx",
142 144
] ]
], ],
"translation": "Go to settings" "translation": "Go to settings"
@@ -5445,7 +5576,7 @@
"origin": [ "origin": [
[ [
"src/components/SideNavigation.tsx", "src/components/SideNavigation.tsx",
118 120
] ]
], ],
"translation": "Go to templates" "translation": "Go to templates"
@@ -5693,7 +5824,7 @@
"origin": [ "origin": [
[ [
"src/views/boards/index.tsx", "src/views/boards/index.tsx",
82 83
] ]
], ],
"translation": "Import" "translation": "Import"
@@ -6110,7 +6241,7 @@
"origin": [ "origin": [
[ [
"src/providers/keyboard-shortcuts.tsx", "src/providers/keyboard-shortcuts.tsx",
321 323
] ]
], ],
"translation": "Keyboard Shortcuts" "translation": "Keyboard Shortcuts"
@@ -6643,7 +6774,7 @@
"origin": [ "origin": [
[ [
"src/components/SideNavigation.tsx", "src/components/SideNavigation.tsx",
122 124
], ],
[ [
"src/views/board/components/Filters.tsx", "src/views/board/components/Filters.tsx",
@@ -6858,7 +6989,7 @@
], ],
[ [
"src/views/boards/components/NewBoardForm.tsx", "src/views/boards/components/NewBoardForm.tsx",
134 135
], ],
[ [
"src/views/settings/components/NewWebhookModal.tsx", "src/views/settings/components/NewWebhookModal.tsx",
@@ -6878,7 +7009,7 @@
"origin": [ "origin": [
[ [
"src/providers/keyboard-shortcuts.tsx", "src/providers/keyboard-shortcuts.tsx",
55 56
] ]
], ],
"translation": "Navigation" "translation": "Navigation"
@@ -6902,7 +7033,7 @@
"origin": [ "origin": [
[ [
"src/views/boards/index.tsx", "src/views/boards/index.tsx",
104 105
], ],
[ [
"src/views/home/components/Features.tsx", "src/views/home/components/Features.tsx",
@@ -6925,7 +7056,24 @@
120 120
] ]
], ],
"translation": "New {0}" "translation": "New {0}",
"obsolete": true
},
"DKeyWA": {
"translation": "New {boardTypeLabel}",
"message": "New {boardTypeLabel}",
"placeholders": {
"boardTypeLabel": [
"boardTypeLabel"
]
},
"comments": [],
"origin": [
[
"src/views/boards/components/NewBoardForm.tsx",
121
]
]
}, },
"TjREUS": { "TjREUS": {
"message": "New API key", "message": "New API key",
@@ -7113,7 +7261,24 @@
63 63
] ]
], ],
"translation": "No {0}" "translation": "No {0}",
"obsolete": true
},
"NcHwr6": {
"translation": "No {boardLabel}",
"message": "No {boardLabel}",
"placeholders": {
"boardLabel": [
"boardLabel"
]
},
"comments": [],
"origin": [
[
"src/views/boards/components/BoardsList.tsx",
65
]
]
}, },
"tlhgDC": { "tlhgDC": {
"message": "No archived boards", "message": "No archived boards",
@@ -7122,7 +7287,7 @@
"origin": [ "origin": [
[ [
"src/views/boards/components/BoardsList.tsx", "src/views/boards/components/BoardsList.tsx",
63 65
] ]
], ],
"translation": "No archived boards" "translation": "No archived boards"
@@ -7194,7 +7359,7 @@
"origin": [ "origin": [
[ [
"src/providers/keyboard-shortcuts.tsx", "src/providers/keyboard-shortcuts.tsx",
334 336
] ]
], ],
"translation": "No keyboard shortcuts registered." "translation": "No keyboard shortcuts registered."
@@ -7366,7 +7531,7 @@
"origin": [ "origin": [
[ [
"src/components/WorkspaceMenu.tsx", "src/components/WorkspaceMenu.tsx",
37 39
] ]
], ],
"translation": "Open command menu" "translation": "Open command menu"
@@ -7378,7 +7543,7 @@
"origin": [ "origin": [
[ [
"src/providers/keyboard-shortcuts.tsx", "src/providers/keyboard-shortcuts.tsx",
172 174
] ]
], ],
"translation": "Open keyboard shortcuts" "translation": "Open keyboard shortcuts"
@@ -7938,7 +8103,7 @@
], ],
[ [
"src/views/board/components/VisibilityButton.tsx", "src/views/board/components/VisibilityButton.tsx",
57 58
], ],
[ [
"src/views/board/index.tsx", "src/views/board/index.tsx",
@@ -8235,6 +8400,18 @@
], ],
"translation": "Privacy policy" "translation": "Privacy policy"
}, },
"3KKSM4": {
"translation": "private",
"message": "private",
"placeholders": {},
"comments": [],
"origin": [
[
"src/views/board/components/VisibilityButton.tsx",
45
]
]
},
"zwBp5t": { "zwBp5t": {
"message": "Private", "message": "Private",
"placeholders": {}, "placeholders": {},
@@ -8242,7 +8419,7 @@
"origin": [ "origin": [
[ [
"src/views/board/components/VisibilityButton.tsx", "src/views/board/components/VisibilityButton.tsx",
84 85
] ]
], ],
"translation": "Private" "translation": "Private"
@@ -8319,6 +8496,18 @@
], ],
"translation": "Profile picture" "translation": "Profile picture"
}, },
"qvFa8r": {
"translation": "public",
"message": "public",
"placeholders": {},
"comments": [],
"origin": [
[
"src/views/board/components/VisibilityButton.tsx",
45
]
]
},
"7d1a0d": { "7d1a0d": {
"message": "Public", "message": "Public",
"placeholders": {}, "placeholders": {},
@@ -8326,7 +8515,7 @@
"origin": [ "origin": [
[ [
"src/views/board/components/VisibilityButton.tsx", "src/views/board/components/VisibilityButton.tsx",
79 80
] ]
], ],
"translation": "Public" "translation": "Public"
@@ -9153,7 +9342,7 @@
], ],
[ [
"src/components/SideNavigation.tsx", "src/components/SideNavigation.tsx",
134 136
] ]
], ],
"translation": "Settings" "translation": "Settings"
@@ -9541,15 +9730,15 @@
"origin": [ "origin": [
[ [
"src/components/SideNavigation.tsx", "src/components/SideNavigation.tsx",
228 230
], ],
[ [
"src/components/SideNavigation.tsx", "src/components/SideNavigation.tsx",
229 231
], ],
[ [
"src/components/SideNavigation.tsx", "src/components/SideNavigation.tsx",
239 241
] ]
], ],
"translation": "Start free trial" "translation": "Start free trial"
@@ -9734,6 +9923,30 @@
], ],
"translation": "Teams" "translation": "Teams"
}, },
"1ZwmkP": {
"translation": "template",
"message": "template",
"placeholders": {},
"comments": [],
"origin": [
[
"src/views/board/components/DeleteBoardConfirmation.tsx",
17
],
[
"src/views/boards/components/BoardsList.tsx",
17
],
[
"src/views/boards/components/NewBoardForm.tsx",
35
],
[
"src/views/boards/index.tsx",
35
]
]
},
"/K2CvV": { "/K2CvV": {
"message": "Template", "message": "Template",
"placeholders": {}, "placeholders": {},
@@ -9798,6 +10011,30 @@
], ],
"translation": "Template name is required" "translation": "Template name is required"
}, },
"p2sbyZ": {
"translation": "Template not found",
"message": "Template not found",
"placeholders": {},
"comments": [],
"origin": [
[
"src/views/board/index.tsx",
570
]
]
},
"UZREi+": {
"translation": "templates",
"message": "templates",
"placeholders": {},
"comments": [],
"origin": [
[
"src/views/boards/components/BoardsList.tsx",
18
]
]
},
"iTylMl": { "iTylMl": {
"message": "Templates", "message": "Templates",
"placeholders": {}, "placeholders": {},
@@ -9805,7 +10042,11 @@
"origin": [ "origin": [
[ [
"src/components/SideNavigation.tsx", "src/components/SideNavigation.tsx",
110 112
],
[
"src/views/boards/index.tsx",
34
], ],
[ [
"src/views/home/components/Features.tsx", "src/views/home/components/Features.tsx",
@@ -9938,7 +10179,7 @@
"message": "The board has been moved to {0}.", "message": "The board has been moved to {0}.",
"placeholders": { "placeholders": {
"0": [ "0": [
"targetWorkspace?.name ?? \"the workspace\"" "targetWorkspace?.name ?? t`the workspace`"
] ]
}, },
"comments": [], "comments": [],
@@ -10064,7 +10305,36 @@
50 50
] ]
], ],
"translation": "The visibility of your board has been set to {0}." "translation": "The visibility of your board has been set to {0}.",
"obsolete": true
},
"7ENRJu": {
"translation": "The visibility of your board has been set to {visibilityLabel}.",
"message": "The visibility of your board has been set to {visibilityLabel}.",
"placeholders": {
"visibilityLabel": [
"visibilityLabel"
]
},
"comments": [],
"origin": [
[
"src/views/board/components/VisibilityButton.tsx",
51
]
]
},
"VTpWX6": {
"translation": "the workspace",
"message": "the workspace",
"placeholders": {},
"comments": [],
"origin": [
[
"src/views/board/components/MoveBoardForm.tsx",
34
]
]
}, },
"FEr96N": { "FEr96N": {
"message": "Theme", "message": "Theme",
@@ -10101,7 +10371,7 @@
], ],
[ [
"src/views/board/components/DeleteBoardConfirmation.tsx", "src/views/board/components/DeleteBoardConfirmation.tsx",
39 40
], ],
[ [
"src/views/card/components/DeleteCardConfirmation.tsx", "src/views/card/components/DeleteCardConfirmation.tsx",
@@ -10821,7 +11091,7 @@
"origin": [ "origin": [
[ [
"src/views/board/components/VisibilityButton.tsx", "src/views/board/components/VisibilityButton.tsx",
56 57
] ]
], ],
"translation": "Unable to update board visibility" "translation": "Unable to update board visibility"
@@ -11486,7 +11756,7 @@
"origin": [ "origin": [
[ [
"src/views/boards/components/NewBoardForm.tsx", "src/views/boards/components/NewBoardForm.tsx",
154 155
] ]
], ],
"translation": "Use template" "translation": "Use template"
@@ -11618,7 +11888,7 @@
"origin": [ "origin": [
[ [
"src/views/board/components/VisibilityButton.tsx", "src/views/board/components/VisibilityButton.tsx",
103 104
] ]
], ],
"translation": "Visibility" "translation": "Visibility"
@@ -11903,7 +12173,7 @@
], ],
[ [
"src/views/boards/index.tsx", "src/views/boards/index.tsx",
57 58
], ],
[ [
"src/views/members/index.tsx", "src/views/members/index.tsx",
@@ -12276,7 +12546,7 @@
], ],
[ [
"src/views/board/components/VisibilityButton.tsx", "src/views/board/components/VisibilityButton.tsx",
72 73
], ],
[ [
"src/views/board/index.tsx", "src/views/board/index.tsx",
@@ -12288,15 +12558,15 @@
], ],
[ [
"src/views/boards/components/BoardsList.tsx", "src/views/boards/components/BoardsList.tsx",
71 73
], ],
[ [
"src/views/boards/index.tsx", "src/views/boards/index.tsx",
68 69
], ],
[ [
"src/views/boards/index.tsx", "src/views/boards/index.tsx",
89 90
] ]
], ],
"translation": "You don't have permission" "translation": "You don't have permission"

File diff suppressed because one or more lines are too long

View File

@@ -13,7 +13,8 @@ export const locales = [
export type Locale = (typeof locales)[number]; export type Locale = (typeof locales)[number];
export const defaultLocale: Locale = "en"; // 自托管实例默认使用简体中文,用户仍可在设置中切换其他语言。
export const defaultLocale: Locale = "zh-CN";
export const localeNames: Record<Locale, string> = { export const localeNames: Record<Locale, string> = {
en: "English", en: "English",

View File

@@ -37,26 +37,21 @@
62 62
] ]
], ],
"translation": "{0}" "translation": "{0}",
"obsolete": true
}, },
"JArWcF": { "JArWcF": {
"message": "{0} | {1}", "message": "{0} | {1}",
"placeholders": { "placeholders": {
"0": [ "0": [
"card?.title ?? t`Card`", "card?.title ?? t`Card`"
"isTemplate ? \"Templates\" : \"Boards\""
], ],
"1": [ "1": [
"board?.name ?? t`Board`", "board?.name ?? t`Board`"
"workspace.name ?? t`Workspace`"
] ]
}, },
"comments": [], "comments": [],
"origin": [ "origin": [
[
"src/views/boards/index.tsx",
57
],
[ [
"src/views/card/index.tsx", "src/views/card/index.tsx",
321 321
@@ -126,7 +121,8 @@
570 570
] ]
], ],
"translation": "没有找到{0}" "translation": "没有找到{0}",
"obsolete": true
}, },
"0xWkkH": { "0xWkkH": {
"message": "{boardCount, plural, one {Import board (1)} other {Import boards ({boardCount})}}", "message": "{boardCount, plural, one {Import board (1)} other {Import boards ({boardCount})}}",
@@ -144,6 +140,25 @@
], ],
"translation": "{boardCount, plural, one {导入看板 (1)} other {导入看板 ({boardCount})}}" "translation": "{boardCount, plural, one {导入看板 (1)} other {导入看板 ({boardCount})}}"
}, },
"xbAVoi": {
"translation": "{boardLabel} | {0}",
"message": "{boardLabel} | {0}",
"placeholders": {
"0": [
"workspace.name ?? t`Workspace`"
],
"boardLabel": [
"boardLabel"
]
},
"comments": [],
"origin": [
[
"src/views/boards/index.tsx",
58
]
]
},
"yndBF+": { "yndBF+": {
"message": "{projectCount, plural, one {Import project (1)} other {Import projects ({projectCount})}}", "message": "{projectCount, plural, one {Import project (1)} other {Import projects ({projectCount})}}",
"placeholders": { "placeholders": {
@@ -335,7 +350,7 @@
"origin": [ "origin": [
[ [
"src/providers/keyboard-shortcuts.tsx", "src/providers/keyboard-shortcuts.tsx",
56 57
] ]
], ],
"translation": "行动" "translation": "行动"
@@ -371,7 +386,7 @@
"origin": [ "origin": [
[ [
"src/views/boards/index.tsx", "src/views/boards/index.tsx",
30 37
], ],
[ [
"src/views/settings/components/NewWebhookModal.tsx", "src/views/settings/components/NewWebhookModal.tsx",
@@ -382,7 +397,7 @@
106 106
] ]
], ],
"translation": "活跃的" "translation": "进行中"
}, },
"XJOV1Y": { "XJOV1Y": {
"message": "Activity", "message": "Activity",
@@ -1121,10 +1136,10 @@
"origin": [ "origin": [
[ [
"src/views/boards/index.tsx", "src/views/boards/index.tsx",
31 38
] ]
], ],
"translation": "档" "translation": "已归档"
}, },
"lo8xBK": { "lo8xBK": {
"message": "Are you sure want to remove {entityLabel}?", "message": "Are you sure want to remove {entityLabel}?",
@@ -1188,7 +1203,24 @@
36 36
] ]
], ],
"translation": "您确定要删除这个{0}吗?" "translation": "您确定要删除这个{0}吗?",
"obsolete": true
},
"I/URsS": {
"translation": "确定要删除此{boardTypeLabel}吗?",
"message": "Are you sure you want to delete this {boardTypeLabel}?",
"placeholders": {
"boardTypeLabel": [
"boardTypeLabel"
]
},
"comments": [],
"origin": [
[
"src/views/board/components/DeleteBoardConfirmation.tsx",
37
]
]
}, },
"ZT4Khw": { "ZT4Khw": {
"message": "Are you sure you want to delete this card?", "message": "Are you sure you want to delete this card?",
@@ -1478,6 +1510,30 @@
], ],
"translation": "博客" "translation": "博客"
}, },
"TwoUcd": {
"translation": "看板",
"message": "board",
"placeholders": {},
"comments": [],
"origin": [
[
"src/views/board/components/DeleteBoardConfirmation.tsx",
17
],
[
"src/views/boards/components/BoardsList.tsx",
17
],
[
"src/views/boards/components/NewBoardForm.tsx",
35
],
[
"src/views/boards/index.tsx",
35
]
]
},
"QD8opX": { "QD8opX": {
"message": "Board", "message": "Board",
"placeholders": {}, "placeholders": {},
@@ -1563,6 +1619,10 @@
"placeholders": {}, "placeholders": {},
"comments": [], "comments": [],
"origin": [ "origin": [
[
"src/views/board/index.tsx",
570
],
[ [
"src/views/public/board/index.tsx", "src/views/public/board/index.tsx",
181 181
@@ -1669,11 +1729,23 @@
"origin": [ "origin": [
[ [
"src/views/board/components/VisibilityButton.tsx", "src/views/board/components/VisibilityButton.tsx",
49 50
] ]
], ],
"translation": "董事会可见性更新" "translation": "董事会可见性更新"
}, },
"DaBhdY": {
"translation": "看板",
"message": "boards",
"placeholders": {},
"comments": [],
"origin": [
[
"src/views/boards/components/BoardsList.tsx",
18
]
]
},
"8TveY+": { "8TveY+": {
"message": "Boards", "message": "Boards",
"placeholders": {}, "placeholders": {},
@@ -1681,14 +1753,18 @@
"origin": [ "origin": [
[ [
"src/components/SideNavigation.tsx", "src/components/SideNavigation.tsx",
98 100
],
[
"src/views/boards/index.tsx",
34
], ],
[ [
"src/views/pricing/components/FeatureComparisonTable.tsx", "src/views/pricing/components/FeatureComparisonTable.tsx",
73 73
] ]
], ],
"translation": "董事会" "translation": "看板"
}, },
"0RE1AJ": { "0RE1AJ": {
"message": "Boards you archive will appear here.", "message": "Boards you archive will appear here.",
@@ -1697,10 +1773,10 @@
"origin": [ "origin": [
[ [
"src/views/boards/components/BoardsList.tsx", "src/views/boards/components/BoardsList.tsx",
66 68
] ]
], ],
"translation": "您档的版面将出现在这里。" "translation": "您档的看板会显示在这里。"
}, },
"ZDo4HN": { "ZDo4HN": {
"message": "Brainstorming", "message": "Brainstorming",
@@ -2141,7 +2217,7 @@
], ],
[ [
"src/views/board/components/DeleteBoardConfirmation.tsx", "src/views/board/components/DeleteBoardConfirmation.tsx",
44 45
], ],
[ [
"src/views/board/components/MoveBoardForm.tsx", "src/views/board/components/MoveBoardForm.tsx",
@@ -3057,7 +3133,24 @@
166 166
] ]
], ],
"translation": "创建{0}" "translation": "创建{0}",
"obsolete": true
},
"d+ACJK": {
"translation": "创建{boardTypeLabel}",
"message": "Create {boardTypeLabel}",
"placeholders": {
"boardTypeLabel": [
"boardTypeLabel"
]
},
"comments": [],
"origin": [
[
"src/views/boards/components/NewBoardForm.tsx",
167
]
]
}, },
"vgdzLf": { "vgdzLf": {
"message": "Create another", "message": "Create another",
@@ -3169,7 +3262,28 @@
45 45
] ]
], ],
"translation": "创建新的{0}" "translation": "创建新的{0}",
"obsolete": true
},
"O6v9mX": {
"translation": "创建新的{boardTypeLabel}",
"message": "Create new {boardTypeLabel}",
"placeholders": {
"boardTypeLabel": [
"boardTypeLabel"
]
},
"comments": [],
"origin": [
[
"src/views/boards/components/BoardsList.tsx",
82
],
[
"src/views/boards/index.tsx",
46
]
]
}, },
"okpxfB": { "okpxfB": {
"message": "Create new key", "message": "Create new key",
@@ -3250,7 +3364,7 @@
], ],
[ [
"src/components/WorkspaceMenu.tsx", "src/components/WorkspaceMenu.tsx",
176 178
] ]
], ],
"translation": "创建工作区" "translation": "创建工作区"
@@ -3535,7 +3649,7 @@
], ],
[ [
"src/views/board/components/DeleteBoardConfirmation.tsx", "src/views/board/components/DeleteBoardConfirmation.tsx",
47 48
], ],
[ [
"src/views/card/components/DeleteCardConfirmation.tsx", "src/views/card/components/DeleteCardConfirmation.tsx",
@@ -4448,11 +4562,11 @@
"origin": [ "origin": [
[ [
"src/views/boards/components/NewBoardForm.tsx", "src/views/boards/components/NewBoardForm.tsx",
77 78
], ],
[ [
"src/views/boards/components/NewBoardForm.tsx", "src/views/boards/components/NewBoardForm.tsx",
92 93
], ],
[ [
"src/views/members/components/InviteMemberForm.tsx", "src/views/members/components/InviteMemberForm.tsx",
@@ -4781,11 +4895,11 @@
"origin": [ "origin": [
[ [
"src/views/boards/components/NewBoardForm.tsx", "src/views/boards/components/NewBoardForm.tsx",
78 79
], ],
[ [
"src/views/boards/components/NewBoardForm.tsx", "src/views/boards/components/NewBoardForm.tsx",
93 94
] ]
], ],
"translation": "创建板失败" "translation": "创建板失败"
@@ -5189,7 +5303,7 @@
"origin": [ "origin": [
[ [
"src/providers/keyboard-shortcuts.tsx", "src/providers/keyboard-shortcuts.tsx",
54 55
] ]
], ],
"translation": "一般" "translation": "一般"
@@ -5256,7 +5370,24 @@
66 66
] ]
], ],
"translation": "首先创建一个新的{0}" "translation": "首先创建一个新的{0}",
"obsolete": true
},
"sllapH": {
"translation": "创建新的{boardTypeLabel}开始",
"message": "Get started by creating a new {boardTypeLabel}",
"placeholders": {
"boardTypeLabel": [
"boardTypeLabel"
]
},
"comments": [],
"origin": [
[
"src/views/boards/components/BoardsList.tsx",
68
]
]
}, },
"zC8Whw": { "zC8Whw": {
"message": "Get started by creating a new list", "message": "Get started by creating a new list",
@@ -5393,7 +5524,7 @@
"origin": [ "origin": [
[ [
"src/components/SideNavigation.tsx", "src/components/SideNavigation.tsx",
106 108
], ],
[ [
"src/pages/404.tsx", "src/pages/404.tsx",
@@ -5421,7 +5552,7 @@
"origin": [ "origin": [
[ [
"src/components/SideNavigation.tsx", "src/components/SideNavigation.tsx",
130 132
] ]
], ],
"translation": "转到会员" "translation": "转到会员"
@@ -5433,7 +5564,7 @@
"origin": [ "origin": [
[ [
"src/components/SideNavigation.tsx", "src/components/SideNavigation.tsx",
142 144
] ]
], ],
"translation": "进入设置" "translation": "进入设置"
@@ -5445,7 +5576,7 @@
"origin": [ "origin": [
[ [
"src/components/SideNavigation.tsx", "src/components/SideNavigation.tsx",
118 120
] ]
], ],
"translation": "转到模板" "translation": "转到模板"
@@ -5693,7 +5824,7 @@
"origin": [ "origin": [
[ [
"src/views/boards/index.tsx", "src/views/boards/index.tsx",
82 83
] ]
], ],
"translation": "导入" "translation": "导入"
@@ -6110,7 +6241,7 @@
"origin": [ "origin": [
[ [
"src/providers/keyboard-shortcuts.tsx", "src/providers/keyboard-shortcuts.tsx",
321 323
] ]
], ],
"translation": "键盘快捷键" "translation": "键盘快捷键"
@@ -6643,7 +6774,7 @@
"origin": [ "origin": [
[ [
"src/components/SideNavigation.tsx", "src/components/SideNavigation.tsx",
122 124
], ],
[ [
"src/views/board/components/Filters.tsx", "src/views/board/components/Filters.tsx",
@@ -6858,7 +6989,7 @@
], ],
[ [
"src/views/boards/components/NewBoardForm.tsx", "src/views/boards/components/NewBoardForm.tsx",
134 135
], ],
[ [
"src/views/settings/components/NewWebhookModal.tsx", "src/views/settings/components/NewWebhookModal.tsx",
@@ -6878,7 +7009,7 @@
"origin": [ "origin": [
[ [
"src/providers/keyboard-shortcuts.tsx", "src/providers/keyboard-shortcuts.tsx",
55 56
] ]
], ],
"translation": "导航" "translation": "导航"
@@ -6902,7 +7033,7 @@
"origin": [ "origin": [
[ [
"src/views/boards/index.tsx", "src/views/boards/index.tsx",
104 105
], ],
[ [
"src/views/home/components/Features.tsx", "src/views/home/components/Features.tsx",
@@ -6925,7 +7056,24 @@
120 120
] ]
], ],
"translation": "新{0}" "translation": "新{0}",
"obsolete": true
},
"DKeyWA": {
"translation": "新建{boardTypeLabel}",
"message": "New {boardTypeLabel}",
"placeholders": {
"boardTypeLabel": [
"boardTypeLabel"
]
},
"comments": [],
"origin": [
[
"src/views/boards/components/NewBoardForm.tsx",
121
]
]
}, },
"TjREUS": { "TjREUS": {
"message": "New API key", "message": "New API key",
@@ -7113,7 +7261,24 @@
63 63
] ]
], ],
"translation": "没有{0}" "translation": "没有{0}",
"obsolete": true
},
"NcHwr6": {
"translation": "没有{boardLabel}",
"message": "No {boardLabel}",
"placeholders": {
"boardLabel": [
"boardLabel"
]
},
"comments": [],
"origin": [
[
"src/views/boards/components/BoardsList.tsx",
65
]
]
}, },
"tlhgDC": { "tlhgDC": {
"message": "No archived boards", "message": "No archived boards",
@@ -7122,10 +7287,10 @@
"origin": [ "origin": [
[ [
"src/views/boards/components/BoardsList.tsx", "src/views/boards/components/BoardsList.tsx",
63 65
] ]
], ],
"translation": "没有存档板" "translation": "没有已归档的看板"
}, },
"Eg99Sc": { "Eg99Sc": {
"message": "No authentication methods are currently available", "message": "No authentication methods are currently available",
@@ -7194,7 +7359,7 @@
"origin": [ "origin": [
[ [
"src/providers/keyboard-shortcuts.tsx", "src/providers/keyboard-shortcuts.tsx",
334 336
] ]
], ],
"translation": "没有注册快捷键。" "translation": "没有注册快捷键。"
@@ -7366,7 +7531,7 @@
"origin": [ "origin": [
[ [
"src/components/WorkspaceMenu.tsx", "src/components/WorkspaceMenu.tsx",
37 39
] ]
], ],
"translation": "打开命令菜单" "translation": "打开命令菜单"
@@ -7378,7 +7543,7 @@
"origin": [ "origin": [
[ [
"src/providers/keyboard-shortcuts.tsx", "src/providers/keyboard-shortcuts.tsx",
172 174
] ]
], ],
"translation": "打开键盘快捷键" "translation": "打开键盘快捷键"
@@ -7938,7 +8103,7 @@
], ],
[ [
"src/views/board/components/VisibilityButton.tsx", "src/views/board/components/VisibilityButton.tsx",
57 58
], ],
[ [
"src/views/board/index.tsx", "src/views/board/index.tsx",
@@ -8235,6 +8400,18 @@
], ],
"translation": "隐私政策" "translation": "隐私政策"
}, },
"3KKSM4": {
"translation": "私有",
"message": "private",
"placeholders": {},
"comments": [],
"origin": [
[
"src/views/board/components/VisibilityButton.tsx",
45
]
]
},
"zwBp5t": { "zwBp5t": {
"message": "Private", "message": "Private",
"placeholders": {}, "placeholders": {},
@@ -8242,7 +8419,7 @@
"origin": [ "origin": [
[ [
"src/views/board/components/VisibilityButton.tsx", "src/views/board/components/VisibilityButton.tsx",
84 85
] ]
], ],
"translation": "私人" "translation": "私人"
@@ -8319,6 +8496,18 @@
], ],
"translation": "的个人资料图片" "translation": "的个人资料图片"
}, },
"qvFa8r": {
"translation": "公开",
"message": "public",
"placeholders": {},
"comments": [],
"origin": [
[
"src/views/board/components/VisibilityButton.tsx",
45
]
]
},
"7d1a0d": { "7d1a0d": {
"message": "Public", "message": "Public",
"placeholders": {}, "placeholders": {},
@@ -8326,7 +8515,7 @@
"origin": [ "origin": [
[ [
"src/views/board/components/VisibilityButton.tsx", "src/views/board/components/VisibilityButton.tsx",
79 80
] ]
], ],
"translation": "公共" "translation": "公共"
@@ -9153,7 +9342,7 @@
], ],
[ [
"src/components/SideNavigation.tsx", "src/components/SideNavigation.tsx",
134 136
] ]
], ],
"translation": "设置" "translation": "设置"
@@ -9541,15 +9730,15 @@
"origin": [ "origin": [
[ [
"src/components/SideNavigation.tsx", "src/components/SideNavigation.tsx",
228 230
], ],
[ [
"src/components/SideNavigation.tsx", "src/components/SideNavigation.tsx",
229 231
], ],
[ [
"src/components/SideNavigation.tsx", "src/components/SideNavigation.tsx",
239 241
] ]
], ],
"translation": "开始免费试用" "translation": "开始免费试用"
@@ -9734,6 +9923,30 @@
], ],
"translation": "团队" "translation": "团队"
}, },
"1ZwmkP": {
"translation": "模板",
"message": "template",
"placeholders": {},
"comments": [],
"origin": [
[
"src/views/board/components/DeleteBoardConfirmation.tsx",
17
],
[
"src/views/boards/components/BoardsList.tsx",
17
],
[
"src/views/boards/components/NewBoardForm.tsx",
35
],
[
"src/views/boards/index.tsx",
35
]
]
},
"/K2CvV": { "/K2CvV": {
"message": "Template", "message": "Template",
"placeholders": {}, "placeholders": {},
@@ -9798,6 +10011,30 @@
], ],
"translation": "模板名称是必需的" "translation": "模板名称是必需的"
}, },
"p2sbyZ": {
"translation": "未找到模板",
"message": "Template not found",
"placeholders": {},
"comments": [],
"origin": [
[
"src/views/board/index.tsx",
570
]
]
},
"UZREi+": {
"translation": "模板",
"message": "templates",
"placeholders": {},
"comments": [],
"origin": [
[
"src/views/boards/components/BoardsList.tsx",
18
]
]
},
"iTylMl": { "iTylMl": {
"message": "Templates", "message": "Templates",
"placeholders": {}, "placeholders": {},
@@ -9805,7 +10042,11 @@
"origin": [ "origin": [
[ [
"src/components/SideNavigation.tsx", "src/components/SideNavigation.tsx",
110 112
],
[
"src/views/boards/index.tsx",
34
], ],
[ [
"src/views/home/components/Features.tsx", "src/views/home/components/Features.tsx",
@@ -9938,7 +10179,7 @@
"message": "The board has been moved to {0}.", "message": "The board has been moved to {0}.",
"placeholders": { "placeholders": {
"0": [ "0": [
"targetWorkspace?.name ?? \"the workspace\"" "targetWorkspace?.name ?? t`the workspace`"
] ]
}, },
"comments": [], "comments": [],
@@ -10064,7 +10305,36 @@
50 50
] ]
], ],
"translation": "您的板的可见性已设置为{0}。" "translation": "您的板的可见性已设置为{0}。",
"obsolete": true
},
"7ENRJu": {
"translation": "看板可见性已设置为{visibilityLabel}。",
"message": "The visibility of your board has been set to {visibilityLabel}.",
"placeholders": {
"visibilityLabel": [
"visibilityLabel"
]
},
"comments": [],
"origin": [
[
"src/views/board/components/VisibilityButton.tsx",
51
]
]
},
"VTpWX6": {
"translation": "工作区",
"message": "the workspace",
"placeholders": {},
"comments": [],
"origin": [
[
"src/views/board/components/MoveBoardForm.tsx",
34
]
]
}, },
"FEr96N": { "FEr96N": {
"message": "Theme", "message": "Theme",
@@ -10101,7 +10371,7 @@
], ],
[ [
"src/views/board/components/DeleteBoardConfirmation.tsx", "src/views/board/components/DeleteBoardConfirmation.tsx",
39 40
], ],
[ [
"src/views/card/components/DeleteCardConfirmation.tsx", "src/views/card/components/DeleteCardConfirmation.tsx",
@@ -10821,7 +11091,7 @@
"origin": [ "origin": [
[ [
"src/views/board/components/VisibilityButton.tsx", "src/views/board/components/VisibilityButton.tsx",
56 57
] ]
], ],
"translation": "无法更新电路板可见性" "translation": "无法更新电路板可见性"
@@ -11486,7 +11756,7 @@
"origin": [ "origin": [
[ [
"src/views/boards/components/NewBoardForm.tsx", "src/views/boards/components/NewBoardForm.tsx",
154 155
] ]
], ],
"translation": "使用模板" "translation": "使用模板"
@@ -11618,7 +11888,7 @@
"origin": [ "origin": [
[ [
"src/views/board/components/VisibilityButton.tsx", "src/views/board/components/VisibilityButton.tsx",
103 104
] ]
], ],
"translation": "可见性" "translation": "可见性"
@@ -11903,7 +12173,7 @@
], ],
[ [
"src/views/boards/index.tsx", "src/views/boards/index.tsx",
57 58
], ],
[ [
"src/views/members/index.tsx", "src/views/members/index.tsx",
@@ -12276,7 +12546,7 @@
], ],
[ [
"src/views/board/components/VisibilityButton.tsx", "src/views/board/components/VisibilityButton.tsx",
72 73
], ],
[ [
"src/views/board/index.tsx", "src/views/board/index.tsx",
@@ -12288,15 +12558,15 @@
], ],
[ [
"src/views/boards/components/BoardsList.tsx", "src/views/boards/components/BoardsList.tsx",
71 73
], ],
[ [
"src/views/boards/index.tsx", "src/views/boards/index.tsx",
68 69
], ],
[ [
"src/views/boards/index.tsx", "src/views/boards/index.tsx",
89 90
] ]
], ],
"translation": "你没有得到许可" "translation": "你没有得到许可"

File diff suppressed because one or more lines are too long

View File

@@ -82,8 +82,8 @@ const MyApp: AppType = ({ Component, pageProps }: AppPropsWithLayout) => {
)} )}
<script src="/__ENV.js" /> <script src="/__ENV.js" />
<main className="font-sans"> <main className="font-sans">
<KeyboardShortcutProvider> <LinguiProviderWrapper>
<LinguiProviderWrapper> <KeyboardShortcutProvider>
<FontSizeProvider> <FontSizeProvider>
<ThemeProvider attribute="class" defaultTheme="system" enableSystem> <ThemeProvider attribute="class" defaultTheme="system" enableSystem>
<ModalProvider> <ModalProvider>
@@ -99,8 +99,8 @@ const MyApp: AppType = ({ Component, pageProps }: AppPropsWithLayout) => {
</ModalProvider> </ModalProvider>
</ThemeProvider> </ThemeProvider>
</FontSizeProvider> </FontSizeProvider>
</LinguiProviderWrapper> </KeyboardShortcutProvider>
</KeyboardShortcutProvider> </LinguiProviderWrapper>
</main> </main>
</> </>
); );

View File

@@ -20,6 +20,7 @@ import { HiXMark } from "react-icons/hi2";
import { env } from "~/env"; import { env } from "~/env";
import { useEventListener } from "~/hooks/useEventListener"; import { useEventListener } from "~/hooks/useEventListener";
import { useLinguiContext } from "~/providers/lingui";
const ModifierKey = { const ModifierKey = {
CONTROL: "CONTROL", CONTROL: "CONTROL",
@@ -160,6 +161,7 @@ export function KeyboardShortcutProvider({
const sequenceTimeoutRef = useRef<NodeJS.Timeout | null>(null); const sequenceTimeoutRef = useRef<NodeJS.Timeout | null>(null);
const [isLegendOpen, setIsLegendOpen] = useState(false); const [isLegendOpen, setIsLegendOpen] = useState(false);
const { locale } = useLinguiContext();
const openLegendShortcut: KeyboardShortcut = useMemo( const openLegendShortcut: KeyboardShortcut = useMemo(
() => ({ () => ({
@@ -172,7 +174,7 @@ export function KeyboardShortcutProvider({
description: t`Open keyboard shortcuts`, description: t`Open keyboard shortcuts`,
group: ShortcutGroup.GENERAL, group: ShortcutGroup.GENERAL,
}), }),
[setIsLegendOpen], [locale],
); );
const handleKeyDown = useCallback((event: KeyboardEvent) => { const handleKeyDown = useCallback((event: KeyboardEvent) => {

View File

@@ -70,7 +70,7 @@ export function LinguiProviderWrapper({
children, children,
initialLocale = defaultLocale, initialLocale = defaultLocale,
}: LinguiProviderProps) { }: LinguiProviderProps) {
const [locale, setLocale] = useState<Locale>(defaultLocale); const [locale, setLocale] = useState<Locale>(initialLocale);
const [isHydrated, setIsHydrated] = useState(false); const [isHydrated, setIsHydrated] = useState(false);
initializeI18n(); initializeI18n();

View File

@@ -3,6 +3,7 @@ import { i18n } from "@lingui/core";
import type { Locale } from "~/locales"; import type { Locale } from "~/locales";
import { defaultLocale } from "~/locales"; import { defaultLocale } from "~/locales";
import { messages as enMessages } from "~/locales/en/messages"; import { messages as enMessages } from "~/locales/en/messages";
import { messages as zhCNMessages } from "~/locales/zh-CN/messages";
const loadMessages = async (locale: Locale) => { const loadMessages = async (locale: Locale) => {
switch (locale) { switch (locale) {
@@ -34,11 +35,15 @@ const loadMessages = async (locale: Locale) => {
let isInitialized = false; let isInitialized = false;
const loadedLocales = new Set<string>(); const loadedLocales = new Set<string>();
export function initializeI18n(locale: Locale = defaultLocale) { export function initializeI18n() {
if (!isInitialized) { if (!isInitialized) {
i18n.load(defaultLocale, enMessages); // 首屏同步加载中英文,避免默认语言激活前出现中英混排。
i18n.load("en", enMessages);
i18n.load("zh-CN", zhCNMessages);
i18n.activate(defaultLocale); i18n.activate(defaultLocale);
loadedLocales.add(defaultLocale); loadedLocales.add(defaultLocale);
loadedLocales.add("en");
loadedLocales.add("zh-CN");
isInitialized = true; isInitialized = true;
} }

View File

@@ -14,6 +14,7 @@ export function DeleteBoardConfirmation({
}) { }) {
const router = useRouter(); const router = useRouter();
const { closeModal } = useModal(); const { closeModal } = useModal();
const boardTypeLabel = isTemplate ? t`template` : t`board`;
const deleteBoard = api.board.delete.useMutation({ const deleteBoard = api.board.delete.useMutation({
onSuccess: () => { onSuccess: () => {
@@ -33,7 +34,7 @@ export function DeleteBoardConfirmation({
<div className="p-5"> <div className="p-5">
<div className="flex w-full flex-col justify-between pb-4"> <div className="flex w-full flex-col justify-between pb-4">
<h2 className="text-md pb-4 font-medium text-neutral-900 dark:text-dark-1000"> <h2 className="text-md pb-4 font-medium text-neutral-900 dark:text-dark-1000">
{t`Are you sure you want to delete this ${isTemplate ? "template" : "board"}?`} {t`Are you sure you want to delete this ${boardTypeLabel}?`}
</h2> </h2>
<p className="text-sm font-medium text-light-900 dark:text-dark-900"> <p className="text-sm font-medium text-light-900 dark:text-dark-900">
{t`This action can't be undone.`} {t`This action can't be undone.`}

View File

@@ -31,7 +31,7 @@ export function MoveBoardForm({
closeModal(); closeModal();
showPopup({ showPopup({
header: t`Board moved`, header: t`Board moved`,
message: t`The board has been moved to ${targetWorkspace?.name ?? "the workspace"}.`, message: t`The board has been moved to ${targetWorkspace?.name ?? t`the workspace`}.`,
icon: "success", icon: "success",
}); });
if (targetWorkspace) { if (targetWorkspace) {

View File

@@ -42,12 +42,13 @@ const VisibilityButton = ({
}, [visibility]); }, [visibility]);
const isPublic = stateVisibility === "public"; const isPublic = stateVisibility === "public";
const visibilityLabel = isPublic ? t`public` : t`private`;
const updateBoardVisibility = api.board.update.useMutation({ const updateBoardVisibility = api.board.update.useMutation({
onSuccess: () => { onSuccess: () => {
showPopup({ showPopup({
header: t`Board visibility updated`, header: t`Board visibility updated`,
message: t`The visibility of your board has been set to ${isPublic ? "public" : "private"}.`, message: t`The visibility of your board has been set to ${visibilityLabel}.`,
icon: "success", icon: "success",
}); });
}, },

View File

@@ -540,7 +540,7 @@ export default function BoardPage({ isTemplate }: { isTemplate?: boolean }) {
return ( return (
<> <>
<PageHead <PageHead
title={`${boardData?.name ?? (isTemplate ? t`Board` : t`Template`)} | ${workspace.name ?? t`Workspace`}`} title={`${boardData?.name ?? (isTemplate ? t`Template` : t`Board`)} | ${workspace.name ?? t`Workspace`}`}
/> />
<div className="relative flex h-full flex-col"> <div className="relative flex h-full flex-col">
<PatternedBackground /> <PatternedBackground />
@@ -567,7 +567,7 @@ export default function BoardPage({ isTemplate }: { isTemplate?: boolean }) {
)} )}
{!boardData && !isLoading && ( {!boardData && !isLoading && (
<p className="order-2 block p-0 py-0 font-bold leading-[2.3rem] tracking-tight text-neutral-900 dark:text-dark-1000 sm:text-[1.2rem] md:order-1"> <p className="order-2 block p-0 py-0 font-bold leading-[2.3rem] tracking-tight text-neutral-900 dark:text-dark-1000 sm:text-[1.2rem] md:order-1">
{t`${isTemplate ? "Template" : "Board"} not found`} {isTemplate ? t`Template not found` : t`Board not found`}
</p> </p>
)} )}
<div className="order-1 mb-4 flex items-center justify-end space-x-2 md:order-2 md:mb-0"> <div className="order-1 mb-4 flex items-center justify-end space-x-2 md:order-2 md:mb-0">

View File

@@ -14,6 +14,8 @@ export function BoardsList({ isTemplate, archived = false }: { isTemplate?: bool
const { workspace } = useWorkspace(); const { workspace } = useWorkspace();
const { openModal } = useModal(); const { openModal } = useModal();
const { canCreateBoard } = usePermissions(); const { canCreateBoard } = usePermissions();
const boardTypeLabel = isTemplate ? t`template` : t`board`;
const boardLabel = isTemplate ? t`templates` : t`boards`;
const utils = api.useUtils(); const utils = api.useUtils();
const updateBoard = api.board.update.useMutation({ const updateBoard = api.board.update.useMutation({
@@ -60,10 +62,10 @@ export function BoardsList({ isTemplate, archived = false }: { isTemplate?: bool
<div className="flex flex-col items-center"> <div className="flex flex-col items-center">
<HiOutlineRectangleStack className="h-10 w-10 text-light-800 dark:text-dark-800" /> <HiOutlineRectangleStack className="h-10 w-10 text-light-800 dark:text-dark-800" />
<p className="mb-2 mt-4 text-[14px] font-bold text-light-1000 dark:text-dark-950"> <p className="mb-2 mt-4 text-[14px] font-bold text-light-1000 dark:text-dark-950">
{archived ? t`No archived boards` : t`No ${isTemplate ? "templates" : "boards"}`} {archived ? t`No archived boards` : t`No ${boardLabel}`}
</p> </p>
<p className="text-[14px] text-light-900 dark:text-dark-900"> <p className="text-[14px] text-light-900 dark:text-dark-900">
{archived ? t`Boards you archive will appear here.` : t`Get started by creating a new ${isTemplate ? "template" : "board"}`} {archived ? t`Boards you archive will appear here.` : t`Get started by creating a new ${boardTypeLabel}`}
</p> </p>
</div> </div>
<Tooltip <Tooltip
@@ -77,7 +79,7 @@ export function BoardsList({ isTemplate, archived = false }: { isTemplate?: bool
}} }}
disabled={!canCreateBoard} disabled={!canCreateBoard}
> >
{t`Create new ${isTemplate ? "template" : "board"}`} {t`Create new ${boardTypeLabel}`}
</Button> </Button>
</Tooltip> </Tooltip>
</div> </div>

View File

@@ -32,6 +32,7 @@ interface NewBoardInputWithTemplate {
} }
export function NewBoardForm({ isTemplate }: { isTemplate?: boolean }) { export function NewBoardForm({ isTemplate }: { isTemplate?: boolean }) {
const boardTypeLabel = isTemplate ? t`template` : t`board`;
const utils = api.useUtils(); const utils = api.useUtils();
const { closeModal } = useModal(); const { closeModal } = useModal();
const router = useRouter(); const router = useRouter();
@@ -117,7 +118,7 @@ export function NewBoardForm({ isTemplate }: { isTemplate?: boolean }) {
<form onSubmit={handleSubmit(onSubmit)}> <form onSubmit={handleSubmit(onSubmit)}>
<div className="px-5 pt-5"> <div className="px-5 pt-5">
<div className="text-neutral-9000 flex w-full items-center justify-between pb-4 dark:text-dark-1000"> <div className="text-neutral-9000 flex w-full items-center justify-between pb-4 dark:text-dark-1000">
<h2 className="text-sm font-bold">{t`New ${isTemplate ? "template" : "board"}`}</h2> <h2 className="text-sm font-bold">{t`New ${boardTypeLabel}`}</h2>
<button <button
type="button" type="button"
className="hover:bg-li ght-300 rounded p-1 focus:outline-none dark:hover:bg-dark-300" className="hover:bg-li ght-300 rounded p-1 focus:outline-none dark:hover:bg-dark-300"
@@ -163,7 +164,7 @@ export function NewBoardForm({ isTemplate }: { isTemplate?: boolean }) {
)} )}
<div> <div>
<Button type="submit" isLoading={createBoard.isPending}> <Button type="submit" isLoading={createBoard.isPending}>
{t`Create ${isTemplate ? "template" : "board"}`} {t`Create ${boardTypeLabel}`}
</Button> </Button>
</div> </div>
</div> </div>

View File

@@ -26,26 +26,27 @@ import { BoardsList } from "./components/BoardsList";
import { ImportBoardsForm } from "./components/ImportBoardsForm"; import { ImportBoardsForm } from "./components/ImportBoardsForm";
import { NewBoardForm } from "./components/NewBoardForm"; import { NewBoardForm } from "./components/NewBoardForm";
const boardsTabs = [
{ key: "boards" as const, label: t`Active` },
{ key: "archived" as const, label: t`Archived` },
];
export default function BoardsPage({ isTemplate }: { isTemplate?: boolean }) { export default function BoardsPage({ isTemplate }: { isTemplate?: boolean }) {
const { openModal, modalContentType, isOpen } = useModal(); const { openModal, modalContentType, isOpen } = useModal();
const { workspace } = useWorkspace(); const { workspace } = useWorkspace();
const [activeTab, setActiveTab] = useState<"boards" | "archived">("boards"); const [activeTab, setActiveTab] = useState<"boards" | "archived">("boards");
const { canCreateBoard } = usePermissions(); const { canCreateBoard } = usePermissions();
const boardLabel = isTemplate ? t`Templates` : t`Boards`;
const boardTypeLabel = isTemplate ? t`template` : t`board`;
const boardsTabs = [
{ key: "boards" as const, label: t`Active` },
{ key: "archived" as const, label: t`Archived` },
];
const createBoardShortcut = useMemo( const createBoardShortcut = useMemo(
() => ({ () => ({
type: "PRESS" as const, type: "PRESS" as const,
stroke: { key: "C" }, stroke: { key: "C" },
action: () => canCreateBoard && openModal("NEW_BOARD"), action: () => canCreateBoard && openModal("NEW_BOARD"),
description: t`Create new ${isTemplate ? "template" : "board"}`, description: t`Create new ${boardTypeLabel}`,
group: "ACTIONS" as const, group: "ACTIONS" as const,
}), }),
[canCreateBoard, isTemplate, openModal], [boardTypeLabel, canCreateBoard, isTemplate, openModal],
); );
const { tooltipContent: createModalShortcutTooltipContent } = const { tooltipContent: createModalShortcutTooltipContent } =
@@ -54,12 +55,12 @@ export default function BoardsPage({ isTemplate }: { isTemplate?: boolean }) {
return ( return (
<> <>
<PageHead <PageHead
title={t`${isTemplate ? "Templates" : "Boards"} | ${workspace.name ?? t`Workspace`}`} title={t`${boardLabel} | ${workspace.name ?? t`Workspace`}`}
/> />
<div className="m-auto h-full max-w-[1100px] p-8 px-5 md:px-28 md:py-12"> <div className="m-auto h-full max-w-[1100px] p-8 px-5 md:px-28 md:py-12">
<div className="relative z-10 mb-8 flex w-full items-center justify-between"> <div className="relative z-10 mb-8 flex w-full items-center justify-between">
<h1 className="font-bold tracking-tight text-neutral-900 dark:text-dark-1000 sm:text-[1.2rem]"> <h1 className="font-bold tracking-tight text-neutral-900 dark:text-dark-1000 sm:text-[1.2rem]">
{t`${isTemplate ? "Templates" : "Boards"}`} {boardLabel}
</h1> </h1>
<div className="flex gap-2"> <div className="flex gap-2">
{!isTemplate && ( {!isTemplate && (