mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
feat(modality)!: SnapOtter 2.0 phase 3 modality framework: media/doc engines, pool routing, display modes (#218)
This commit is contained in:
@@ -13,3 +13,13 @@ export function getToolDescription(t: TranslationKeys, toolId: string, fallback:
|
||||
export function getCategoryName(t: TranslationKeys, categoryId: string, fallback: string): string {
|
||||
return (t.categories as Record<string, string>)[categoryId] ?? fallback;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the i18n display name for a modality group header.
|
||||
* The "document" key maps to the merged "documentsAndFiles" i18n entry;
|
||||
* "file" is never rendered as a top-level header (merged into document).
|
||||
*/
|
||||
export function getModalityName(t: TranslationKeys, modalityId: string, fallback: string): string {
|
||||
const key = modalityId === "document" ? "documentsAndFiles" : modalityId;
|
||||
return (t.modalities as Record<string, string>)[key] ?? fallback;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user