Files
tkmind_go/ui/desktop/src/utils/keyboardShortcuts.ts
T
Tai An 8c36ba86c6 feat(i18n): add Simplified Chinese (zh-CN) translation (#8765)
Signed-off-by: Douwe Osinga <douwe@squareup.com>
Co-authored-by: antai <antai12232931@anaiguo.com>
Co-authored-by: Douwe Osinga <douwe@squareup.com>
Co-authored-by: Lifei Zhou <lifei@squareup.com>
2026-05-13 01:34:08 +00:00

29 lines
859 B
TypeScript

import type { IntlShape } from 'react-intl';
function isMac(): boolean {
return window.electron?.platform === 'darwin';
}
/**
* Localised message for the "navigate messages with arrow keys" chat input placeholder.
* Returns the legacy English string if no intl instance is supplied, so call sites that
* run before the intl provider is available still get a sensible default.
*/
export function getNavigationShortcutText(intl?: IntlShape): string {
const prefix = isMac() ? '⌘' : 'Ctrl+';
if (intl) {
return intl.formatMessage(
{
id: 'chatInput.navigationShortcut',
defaultMessage: '{prefix}↑/{prefix}↓ to navigate messages',
},
{ prefix }
);
}
return `${prefix}↑/${prefix}↓ to navigate messages`;
}
export function getSearchShortcutText(): string {
return isMac() ? '⌘F' : 'Ctrl+F';
}