Skip to content

Commit bc970c0

Browse files
committed
fix: remaining type errors
Locales are fully typed now. Keep track of intlify/vue-i18n#1116 for better TS support for them The rest of them are waiting for PRs at Vuetify's side and an SDK upgrade
1 parent 0566790 commit bc970c0

File tree

7 files changed

+20
-17
lines changed

7 files changed

+20
-17
lines changed

frontend/src/components/Item/Metadata/ImageEditor.vue

+2-4
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
xl="1"
88
lg="3"
99
md="4"
10-
sm="6"
11-
xs="12">
10+
sm="6">
1211
<v-card class="ma-2" variant="outlined">
1312
<v-img
1413
:src="imageFormat(item)"
@@ -42,8 +41,7 @@
4241
xl="1"
4342
lg="3"
4443
md="4"
45-
sm="6"
46-
xs="12">
44+
sm="6">
4745
<v-card class="ma-2" variant="outlined">
4846
<v-img
4947
:src="imageFormat(item)"

frontend/src/components/Item/Metadata/ImageSearch.vue

+1-2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@
5656
xl="1"
5757
lg="3"
5858
md="4"
59-
sm="6"
60-
xs="12">
59+
sm="6">
6160
<v-card class="ma-2">
6261
<v-img
6362
v-if="item.Url"

frontend/src/components/Layout/AppBar/Buttons/UserButton.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<template #icon>
44
<user-image :user="auth.currentUser" :size="40" rounded />
55
<v-menu location="bottom">
6-
<v-list class="min-list-width" dense>
6+
<v-list class="min-list-width">
77
<v-list-item>
88
<template #prepend>
99
<v-avatar>

frontend/src/components/Playback/UpNext.vue

+6-7
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,12 @@
1313
xl="3">
1414
<v-card class="pointer-events-all">
1515
<v-card-title class="text-h6">
16-
<i18n path="dialog.upNext.nextItemPlayingIn" tag="span">
17-
<template #time>
18-
<span class="text-primary darken-2">
19-
{{ $tc('units.time.seconds', currentItemTimeLeft) }}
20-
</span>
21-
</template>
22-
</i18n>
16+
<span>
17+
{{ $t('dialog.upNext.nextItemPlayingIn') }}
18+
<span class="text-primary darken-2">
19+
{{ $tc('units.time.seconds', currentItemTimeLeft) }}
20+
</span>
21+
</span>
2322
</v-card-title>
2423
<v-card-subtitle class="text-truncate text-subtitle-1">
2524
<span v-if="playbackManager.currentItem.Type === 'Episode'">

frontend/src/plugins/i18n.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createI18n } from 'vue-i18n';
1+
import { createI18n, I18nOptions } from 'vue-i18n';
22
// eslint-disable-next-line import/no-extraneous-dependencies
33
import messages from '@intlify/unplugin-vue-i18n/messages';
44

@@ -68,7 +68,7 @@ const i18n = createI18n({
6868
fallbackLocale: DEFAULT_LANGUAGE,
6969
globalInjection: true,
7070
legacy: false,
71-
messages
71+
messages: messages as I18nOptions['messages']
7272
});
7373

7474
// `localeNames` is readonly but this is the one place it should actually be set

frontend/src/plugins/remote/index.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ export default function createRemote(): {
3232
} {
3333
return {
3434
install: async (app: App): Promise<void> => {
35-
app.config.globalProperties.$remote = remoteInstance;
35+
// `remote` is readonly but this is the one place it should actually be set
36+
(app.config.globalProperties.$remote as typeof remoteInstance) =
37+
remoteInstance;
3638

3739
const auth = remoteInstance.auth;
3840
const config = await getJSONConfig();

frontend/types/global/plugins.d.ts

+5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import 'vue-router';
33
import { RemotePlugin } from '@/plugins/remote/types';
44
// eslint-disable-next-line no-restricted-imports
55
import { languageMap } from '@/plugins/i18n';
6+
import enUS from '@/../locales/en-US.json';
67
import 'vue-i18n';
78

89
/**
@@ -40,6 +41,10 @@ declare module 'vue-i18n' {
4041
*/
4142
readonly localeNames: typeof languageMap;
4243
}
44+
45+
type messages = typeof enUS;
46+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
47+
export interface DefineLocaleMessage extends messages {}
4348
}
4449

4550
/**

0 commit comments

Comments
 (0)