Skip to content

Commit

Permalink
Merge pull request #285 from AnchorI/jp-locale
Browse files Browse the repository at this point in the history
Added Japanese Language Support
  • Loading branch information
cars10 authored Jan 25, 2025
2 parents 25862c2 + 4f61640 commit 89c0e9f
Show file tree
Hide file tree
Showing 10 changed files with 716 additions and 5 deletions.
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default [
'@intlify/vue-i18n/no-duplicate-keys-in-locale': ['error'],
'@intlify/vue-i18n/no-dynamic-keys': 'error',
'@intlify/vue-i18n/no-missing-keys-in-other-locales': 'error',
'@intlify/vue-i18n/no-unknown-locale': ['error', { locales: ['en', 'fr', 'cn', 'ru'] }],
'@intlify/vue-i18n/no-unknown-locale': ['error', { locales: ['en', 'fr', 'cn', 'ru', 'jp'] }],
'@intlify/vue-i18n/no-unused-keys': ['error', {
'src': './src',
'extensions': ['.js', '.vue', '.ts'],
Expand Down
5 changes: 5 additions & 0 deletions src/assets/images/icons/flags/jp.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion src/components/base/LanguageSwitcher.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import cn from '../../assets/images/icons/flags/cn.svg'
import fr from '../../assets/images/icons/flags/fr.svg'
import ru from '../../assets/images/icons/flags/ru.svg'
import jp from '../../assets/images/icons/flags/jp.svg'
import { useI18nStore } from '../../store/i18n'
import { useTranslation } from '../../composables/i18n.ts'
import { ValidLocale } from '../../consts.ts'
Expand All @@ -50,6 +51,7 @@
{ code: 'en', title: t('base.language_switcher.languages.en.title'), icon: en },
{ code: 'cn', title: t('base.language_switcher.languages.cn.title'), icon: cn },
{ code: 'fr', title: t('base.language_switcher.languages.fr.title'), icon: fr },
{ code: 'ru', title: t('base.language_switcher.languages.ru.title'), icon: ru }
{ code: 'ru', title: t('base.language_switcher.languages.ru.title'), icon: ru },
{ code: 'jp', title: t('base.language_switcher.languages.jp.title'), icon: jp }
]
</script>
5 changes: 3 additions & 2 deletions src/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ export const SUPPORTED_COUNTRY_LOCALES: Record<string, ValidLocale> = {
cn: 'cn',
zh: 'cn',
fr: 'fr',
ru: 'ru'
ru: 'ru',
jp: 'jp'
}
export type ValidLocale = 'en' | 'cn' | 'fr' | 'ru'
export type ValidLocale = 'en' | 'cn' | 'fr' | 'ru' | 'jp'
export const DEFAULT_LOCALE: ValidLocale = 'en'

export const DEFAULT_DOCUMENT_FIELD_MAX_LENGTH = 200
Expand Down
3 changes: 3 additions & 0 deletions src/locales/cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
},
"ru": {
"title": "俄语"
},
"jp": {
"title": "日本人"
}
}
},
Expand Down
3 changes: 3 additions & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
},
"ru": {
"title": "Russian"
},
"jp": {
"title": "Japanese"
}
}
},
Expand Down
3 changes: 3 additions & 0 deletions src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
},
"ru": {
"title": "Russe"
},
"jp": {
"title": "Japonais"
}
}
},
Expand Down
Loading

0 comments on commit 89c0e9f

Please sign in to comment.