Skip to content

Commit 287a3ae

Browse files
authored
fix(i18n): actually use i18n ctrl_key consistently (#2457)
1 parent 51bc902 commit 287a3ae

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

app/composables/usePlatformModifierKey.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ function detectApplePlatform() {
1616
}
1717

1818
export function usePlatformModifierKey() {
19+
const { t } = useI18n()
1920
const isApplePlatform = useState('platform:is-apple', detectApplePlatform)
21+
const ctrlKeyLabel = computed(() => t('shortcuts.ctrl_key'))
2022

2123
if (import.meta.client) {
2224
onMounted(() => {
@@ -26,7 +28,9 @@ export function usePlatformModifierKey() {
2628

2729
return {
2830
isApplePlatform: computed(() => isApplePlatform.value),
29-
primaryModifierKeyLabel: computed(() => (isApplePlatform.value ? '⌘' : 'Ctrl')),
30-
commandPaletteShortcutLabel: computed(() => (isApplePlatform.value ? '⌘ K' : 'Ctrl+K')),
31+
primaryModifierKeyLabel: computed(() => (isApplePlatform.value ? '⌘' : ctrlKeyLabel.value)),
32+
commandPaletteShortcutLabel: computed(() =>
33+
isApplePlatform.value ? '⌘ K' : `${ctrlKeyLabel.value}+K`,
34+
),
3135
}
3236
}

0 commit comments

Comments
 (0)