Skip to content

Commit

Permalink
Add Japanese support (infiniflow#3906)
Browse files Browse the repository at this point in the history
### What problem does this PR solve?

Add native translation in locales for Japanese 🇯🇵 to support new local
language



### Type of change

- [x] New Feature (non-breaking change which adds functionality)

Co-authored-by: Hiroshi Kameya <kameya_h@sunflare.co.jp>
  • Loading branch information
cidrugHug8 and gthbkmy authored Dec 9, 2024
1 parent 1254ecf commit dcedfc5
Show file tree
Hide file tree
Showing 3 changed files with 1,098 additions and 1 deletion.
3 changes: 3 additions & 0 deletions web/src/constants/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export const LanguageList = [
'Indonesia',
'Spanish',
'Vietnamese',
'Japanese',
];

export const LanguageMap = {
Expand All @@ -55,6 +56,7 @@ export const LanguageMap = {
Indonesia: 'Indonesia',
Spanish: 'Español',
Vietnamese: 'Tiếng việt',
Japanese: '日本語',
};

export const LanguageTranslationMap = {
Expand All @@ -64,6 +66,7 @@ export const LanguageTranslationMap = {
Indonesia: 'id',
Spanish: 'es',
Vietnamese: 'vi',
Japanese: 'ja',
};

export enum FileMimeType {
Expand Down
4 changes: 3 additions & 1 deletion web/src/locales/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { initReactI18next } from 'react-i18next';
import translation_en from './en';
import translation_es from './es';
import translation_id from './id';
import translation_ja from './ja';
import translation_vi from './vi';
import translation_zh from './zh';
import translation_zh_traditional from './zh-traditional';
Expand All @@ -14,6 +15,7 @@ const resources = {
zh: translation_zh,
'zh-TRADITIONAL': translation_zh_traditional,
id: translation_id,
ja: translation_ja,
es: translation_es,
vi: translation_vi,
};
Expand All @@ -25,7 +27,7 @@ i18n
detection: {
lookupLocalStorage: 'lng',
},
supportedLngs: ['en', 'zh', 'zh-TRADITIONAL', 'id', 'es', 'vi'],
supportedLngs: ['en', 'zh', 'zh-TRADITIONAL', 'id', 'es', 'vi', 'ja'],
resources,
fallbackLng: 'en',
interpolation: {
Expand Down
Loading

0 comments on commit dcedfc5

Please sign in to comment.