@@ -4,6 +4,7 @@ import { useMagicSequence } from '~/composables/magickeys'
4
4
export default defineNuxtPlugin ( ( { $scrollToTop } ) => {
5
5
const keys = useMagicKeys ( )
6
6
const router = useRouter ( )
7
+ const i18n = useNuxtApp ( ) . $i18n
7
8
8
9
// disable shortcuts when focused on inputs (https://vueuse.org/core/usemagickeys/#conditionally-disable)
9
10
const activeElement = useActiveElement ( )
@@ -41,7 +42,7 @@ export default defineNuxtPlugin(({ $scrollToTop }) => {
41
42
// TODO: find a better solution than clicking buttons...
42
43
document
43
44
. querySelector < HTMLElement > ( '[aria-roledescription=status-details]' )
44
- ?. querySelector < HTMLElement > ( ' button[aria-label=Favourite]' )
45
+ ?. querySelector < HTMLElement > ( ` button[aria-label=${ i18n . t ( 'action.favourite' ) } ]` )
45
46
?. click ( )
46
47
}
47
48
whenever ( logicAnd ( isAuthenticated , notUsingInput , keys . f ) , toggleFavouriteActiveStatus )
@@ -50,7 +51,7 @@ export default defineNuxtPlugin(({ $scrollToTop }) => {
50
51
// TODO: find a better solution than clicking buttons...
51
52
document
52
53
. querySelector < HTMLElement > ( '[aria-roledescription=status-details]' )
53
- ?. querySelector < HTMLElement > ( ' button[aria-label=Boost]' )
54
+ ?. querySelector < HTMLElement > ( ` button[aria-label=${ i18n . t ( 'action.boost' ) } ]` )
54
55
?. click ( )
55
56
}
56
57
whenever ( logicAnd ( isAuthenticated , notUsingInput , keys . b ) , toggleBoostActiveStatus )
0 commit comments