mirror of
https://github.com/jellyfin/jellyfin-vue.git
synced 2024-11-30 09:40:46 +00:00
refactor(i18n): remove variants from en-US and fr-FR
We don't have other variants for those languages, so it makes sense to not make assumptions and use them generically Signed-off-by: Fernando Fernández <ferferga@hotmail.com>
This commit is contained in:
parent
7cde0c85c8
commit
cc6b6eb4b4
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
@ -16,7 +16,7 @@
|
||||
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
|
||||
"i18n-ally.keystyle": "flat",
|
||||
"i18n-ally.sortKeys": true,
|
||||
"i18n-ally.sourceLanguage": "en-US",
|
||||
"i18n-ally.sourceLanguage": "en",
|
||||
"i18n-ally.localesPaths": [
|
||||
"frontend/locales"
|
||||
],
|
||||
|
@ -296,12 +296,12 @@ module.exports = {
|
||||
},
|
||||
'vue-i18n': {
|
||||
/**
|
||||
* We just want to do linting for en-US, weblate already handles removing unused and duplicated keys
|
||||
* in other locales based on en-US translations!
|
||||
* We just want to do linting for en, weblate already handles removing unused and duplicated keys
|
||||
* in other locales based on en translations!
|
||||
*
|
||||
* This also allows us to speed up linting
|
||||
*/
|
||||
localeDir: 'locales/en-US.json',
|
||||
localeDir: 'locales/en.json',
|
||||
messageSyntaxVersion: '^9.0.0'
|
||||
}
|
||||
}
|
||||
|
@ -72,6 +72,11 @@ for (const e of vuetifyExports) {
|
||||
const commit_available = !Number(process.env.IS_STABLE) && Boolean(process.env.COMMIT_HASH);
|
||||
const commit_hash = commit_available && `'${process.env.COMMIT_HASH}'` || undefined;
|
||||
|
||||
/**
|
||||
* Date-fns exports all english locales with variants, so we need to add the match manually
|
||||
*/
|
||||
dfnsExports.unshift('enUS as en');
|
||||
|
||||
export default {
|
||||
'virtual:locales/date-fns': `export { ${dfnsExports.join(
|
||||
', '
|
||||
|
@ -6,7 +6,7 @@ import messages from '@intlify/unplugin-vue-i18n/messages';
|
||||
* See @/store/clientSettings to check where the current user language is initialised
|
||||
*/
|
||||
|
||||
const DEFAULT_LANGUAGE = 'en-US';
|
||||
const DEFAULT_LANGUAGE = 'en';
|
||||
|
||||
export const vuePlugin = createI18n({
|
||||
fallbackLocale: DEFAULT_LANGUAGE,
|
||||
|
@ -3,7 +3,7 @@
|
||||
*/
|
||||
export function getLocaleName(
|
||||
fromCode: string,
|
||||
toCode = 'en-US'
|
||||
toCode = 'en'
|
||||
): string | undefined {
|
||||
const r = new Intl.DisplayNames([toCode], { type: 'language' }).of(fromCode);
|
||||
|
||||
|
4
frontend/types/global/plugins.d.ts
vendored
4
frontend/types/global/plugins.d.ts
vendored
@ -1,4 +1,4 @@
|
||||
import type enUS from '@/../locales/en-US.json';
|
||||
import type en from '@/../locales/en.json';
|
||||
import type { RemotePlugin } from '@/plugins/remote/types';
|
||||
|
||||
/**
|
||||
@ -30,7 +30,7 @@ declare module 'vue' {
|
||||
}
|
||||
|
||||
declare module 'vue-i18n' {
|
||||
type messages = typeof enUS;
|
||||
type messages = typeof en;
|
||||
|
||||
export interface DefineLocaleMessage extends messages {}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user