Skip to content

🎌 feat(i18n): Empowering the app with fluent Japanese translations #5324

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions web-app/src/containers/LanguageSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const LANGUAGES = [
{ value: 'en', label: 'English' },
{ value: 'id', label: 'Bahasa' },
{ value: 'vn', label: 'Tiếng Việt' },
{ value: 'ja', label: '日本語'}
]

export default function LanguageSwitcher() {
Expand Down
8 changes: 8 additions & 0 deletions web-app/src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ import { initReactI18next } from 'react-i18next'
import enCommon from '@/locales/en/common.json'
import idCommon from '@/locales/id/common.json'
import vnCommon from '@/locales/vn/common.json'
import jaCommon from '@/locales/ja/common.json'
import enChat from '@/locales/en/chat.json'
import idChat from '@/locales/id/chat.json'
import vnChat from '@/locales/vn/chat.json'
import jaChat from '@/locales/ja/chat.json'
import enSettings from '@/locales/en/settings.json'
import idSettings from '@/locales/id/settings.json'
import vnSettings from '@/locales/vn/settings.json'
import jaSettings from '@/locales/ja/settings.json'

import { localStorageKey } from '@/constants/localStorage'

Expand All @@ -34,6 +37,11 @@ i18n.use(initReactI18next).init({
common: vnCommon,
settings: vnSettings,
},
jp: {
chat: jaChat,
common: jaCommon,
settings: jaSettings,
},
},
lng: defaultLang,
fallbackLng: 'en',
Expand Down
9 changes: 9 additions & 0 deletions web-app/src/locales/ja/chat.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"chat": {
"welcome": "お元気ですか?",
"description": "どのようにお手伝いできますか?",
"status": {
"empty": "チャット履歴なし"
}
}
}
32 changes: 32 additions & 0 deletions web-app/src/locales/ja/common.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"common": {
"general": "一般",
"settings": "設定",
"modelProviders": "モデルプロバイダー",
"appearance": "外観",
"privacy": "プライバシー",
"keyboardShortcuts": "ショートカット",
"newChat": "新しいチャット",
"favorites": "お気に入り",
"recents": "最近使用したもの",
"hub": "ハブ",
"helpSupport": "ヘルプとサポート",
"unstarAll": "すべてのスターを外す",
"unstar": "スターを外す",
"deleteAll": "すべて削除",
"star": "スターを付ける",
"rename": "名前を変更",
"delete": "削除",
"dataFolder": "データフォルダ",
"others": "その他",
"language": "言語",
"reset": "リセット",
"search": "検索",
"name": "名前",
"cancel": "キャンセル",

"placeholder": {
"chatInput": "なんでも聞いてください..."
}
}
}
19 changes: 19 additions & 0 deletions web-app/src/locales/ja/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"settings": {
"general": {
"autoDownload": "自動で最新アップデートをダウンロード"
},
"dataFolder": {
"appData": "アプリデータ",
"appDataDesc": "メッセージやその他のユーザーデータのデフォルト保存場所",
"appLogs": "アプリログ",
"appLogsDesc": "アプリのログ保存場所(デフォルト)"
},
"others": {
"spellCheck": "スペルチェック",
"spellCheckDesc": "オンにするとチャット入力時にスペルチェックが有効になります。",
"resetFactory": "工場出荷時の設定にリセット",
"resetFactoryDesc": "アプリケーションを初期状態に戻します。すべてのモデルとチャット履歴が消去されます。この操作は元に戻せません。アプリに問題がある場合のみ推奨されます。"
}
}
}