fix(i18n): retain historical checklist text for unknown system keys
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { api } from "./api";
|
||||
import { translations } from "./i18n/translations";
|
||||
|
||||
// Mirrors WorkspaceOverviewDto. Read-only aggregate — the workspace owns no data.
|
||||
export type WorkspaceCv = {
|
||||
@@ -93,7 +94,9 @@ export const WORKSPACE_SECTIONS: { key: WorkspaceSectionKey; label: string }[] =
|
||||
|
||||
export function checklistSystemTranslationToken(systemKey?: string | null): string | null {
|
||||
if (!systemKey || systemKey.startsWith("learning:")) return null;
|
||||
return systemKey.replace(/-([a-z])/g, (_, letter: string) => letter.toUpperCase());
|
||||
const token = systemKey.replace(/-([a-z])/g, (_, letter: string) => letter.toUpperCase());
|
||||
return Object.hasOwn(translations.en, `checklistItem_${token}`)
|
||||
&& Object.hasOwn(translations.en, `checklistItem_${token}Description`) ? token : null;
|
||||
}
|
||||
|
||||
const LEGACY_WORKSPACE_SECTIONS: Record<string, WorkspaceSectionKey> = {
|
||||
|
||||
Reference in New Issue
Block a user