From bac85dd6a6d8f35ce45cfe50e44036a6eaf59f3e Mon Sep 17 00:00:00 2001 From: n4ze3m Date: Wed, 27 Mar 2024 21:01:13 +0530 Subject: [PATCH] Add support for Japanese language --- src/assets/locale/ja-JP/common.json | 52 ++++++ src/assets/locale/ja-JP/option.json | 12 ++ src/assets/locale/ja-JP/playground.json | 27 ++++ src/assets/locale/ja-JP/settings.json | 207 ++++++++++++++++++++++++ src/assets/locale/ja-JP/sidepanel.json | 5 + src/i18n/index.ts | 7 +- src/i18n/lang/ja.ts | 14 ++ src/i18n/support-language.ts | 4 + src/public/_locales/ja/messages.json | 11 ++ 9 files changed, 338 insertions(+), 1 deletion(-) create mode 100644 src/assets/locale/ja-JP/common.json create mode 100644 src/assets/locale/ja-JP/option.json create mode 100644 src/assets/locale/ja-JP/playground.json create mode 100644 src/assets/locale/ja-JP/settings.json create mode 100644 src/assets/locale/ja-JP/sidepanel.json create mode 100644 src/i18n/lang/ja.ts create mode 100644 src/public/_locales/ja/messages.json diff --git a/src/assets/locale/ja-JP/common.json b/src/assets/locale/ja-JP/common.json new file mode 100644 index 0000000..569e669 --- /dev/null +++ b/src/assets/locale/ja-JP/common.json @@ -0,0 +1,52 @@ +{ + "pageAssist": "ページアシスト", + "selectAModel": "モデルを選択", + "save": "保存", + "saved": "保存済み", + "cancel": "キャンセル", + "retry": "再試行", + "share": { + "tooltip": { + "share": "共有" + }, + "modal": { + "title": "チャットリンクを共有" + }, + "form": { + "defaultValue": { + "name": "匿名", + "title": "無題のチャット" + }, + "title": { + "label": "チャットタイトル", + "placeholder": "チャットタイトルを入力", + "required": "チャットタイトルは必須です" + }, + "name": { + "label": "あなたの名前", + "placeholder": "名前を入力", + "required": "名前は必須です" + }, + "btn": { + "save": "リンクを生成", + "saving": "リンクを生成中..." + } + }, + "notification": { + "successGenerate": "リンクがクリップボードにコピーされました", + "failGenerate": "リンクの生成に失敗しました" + } + }, + "copyToClipboard": "クリップボードにコピー", + "webSearch": "ウェブを検索中", + "regenerate": "再生成", + "edit": "編集", + "saveAndSubmit": "保存して送信", + "editMessage": { + "placeholder": "メッセージを入力..." + }, + "submit": "送信", + "noData": "データがありません", + "noHistory": "チャット履歴がありません", + "chatWithCurrentPage": "現在のページでチャット" + } \ No newline at end of file diff --git a/src/assets/locale/ja-JP/option.json b/src/assets/locale/ja-JP/option.json new file mode 100644 index 0000000..57b023b --- /dev/null +++ b/src/assets/locale/ja-JP/option.json @@ -0,0 +1,12 @@ +{ + "newChat": "新しいチャット", + "selectAPrompt": "プロンプトを選択", + "githubRepository": "GitHubリポジトリ", + "settings": "設定", + "sidebarTitle": "チャット履歴", + "error": "エラー", + "somethingWentWrong": "何かが間違っています", + "validationSelectModel": "続行するにはモデルを選択してください", + "deleteHistoryConfirmation": "この履歴を削除しますか?", + "editHistoryTitle": "新しいタイトルを入力" + } \ No newline at end of file diff --git a/src/assets/locale/ja-JP/playground.json b/src/assets/locale/ja-JP/playground.json new file mode 100644 index 0000000..d26dd66 --- /dev/null +++ b/src/assets/locale/ja-JP/playground.json @@ -0,0 +1,27 @@ +{ + "ollamaState": { + "searching": "Ollamaを検索中 🦙", + "running": "Ollamaが実行中 🦙", + "notRunning": "Ollamaに接続できません 🦙" + }, + "formError": { + "noModel": "モデルを選択してください", + "noEmbeddingModel": "設定 > Ollamaページでembeddingモデルを設定してください" + }, + "form": { + "textarea": { + "placeholder": "メッセージを入力..." + }, + "webSearch": { + "on": "オン", + "off": "オフ" + } + }, + "tooltip": { + "searchInternet": "インターネットを検索", + "speechToText": "音声入力", + "uploadImage": "画像をアップロード", + "stopStreaming": "ストリーミングを停止" + }, + "sendWhenEnter": "Enterキーを押すと送信" +} \ No newline at end of file diff --git a/src/assets/locale/ja-JP/settings.json b/src/assets/locale/ja-JP/settings.json new file mode 100644 index 0000000..71007ad --- /dev/null +++ b/src/assets/locale/ja-JP/settings.json @@ -0,0 +1,207 @@ +{ + "generalSettings": { + "title": "一般設定", + "heading": "Web UIの設定", + "settings": { + "speechRecognitionLang": { + "label": "音声認識の言語", + "placeholder": "言語を選択" + }, + "language": { + "label": "言語", + "placeholder": "言語を選択" + }, + "darkMode": { + "label": "テーマを変更", + "options": { + "light": "ライト", + "dark": "ダーク" + } + }, + "searchMode": { + "label": "簡易インターネット検索を実行" + }, + "deleteChatHistory": { + "label": "チャット履歴を削除", + "button": "削除", + "confirm": "チャット履歴を削除してもよろしいですか?この操作は元に戻せません。" + } + } + }, + "manageModels": { + "title": "モデルを管理", + "addBtn": "新しいモデルを追加", + "columns": { + "name": "名前", + "digest": "ダイジェスト", + "modifiedAt": "修正日時", + "size": "サイズ", + "actions": "アクション" + }, + "expandedColumns": { + "parentModel": "親モデル", + "format": "フォーマット", + "family": "ファミリー", + "parameterSize": "パラメータサイズ", + "quantizationLevel": "量子化レベル" + }, + "tooltip": { + "delete": "モデルを削除", + "repull": "モデルを再取得" + }, + "confirm": { + "delete": "本当にこのモデルを削除しますか?", + "repull": "本当にこのモデルを再取得しますか?" + }, + "modal": { + "title": "新しいモデルを追加", + "placeholder": "モデル名を入力", + "pull": "モデルを取得" + }, + "notification": { + "pullModel": "モデルを取得中", + "pullModelDescription": "{{modelName}}モデルを取得中。詳細は拡張機能のアイコンをご確認ください。", + "success": "成功", + "error": "エラー", + "successDescription": "モデルの取得が完了しました", + "successDeleteDescription": "モデルの削除が完了しました", + "someError": "問題が発生しました。後ほど再度お試しください。" + } + }, + "managePrompts": { + "title": "プロンプトを管理", + "addBtn": "新しいプロンプトを追加", + "option1": "通常", + "option2": "RAG", + "questionPrompt": "質問プロンプト", + "columns": { + "title": "タイトル", + "prompt": "プロンプト", + "type": "プロンプトタイプ", + "actions": "アクション" + }, + "systemPrompt": "システムプロンプト", + "quickPrompt": "クイックプロンプト", + "tooltip": { + "delete": "プロンプトを削除", + "edit": "プロンプトを編集" + }, + "confirm": { + "delete": "本当にこのプロンプトを削除しますか?この操作は元に戻せません。" + }, + "modal": { + "addTitle": "新しいプロンプトを追加", + "editTitle": "プロンプトを編集" + }, + "form": { + "title": { + "label": "タイトル", + "placeholder": "素晴らしいプロンプト", + "required": "タイトルを入力してください" + }, + "prompt": { + "label": "プロンプト", + "placeholder": "プロンプトを入力", + "required": "プロンプトを入力してください", + "help": "プロンプト内で{key}を変数として使用できます。" + }, + "isSystem": { + "label": "システムプロンプト" + }, + "btnSave": { + "saving": "プロンプトを追加中...", + "save": "プロンプトを追加" + }, + "btnEdit": { + "saving": "プロンプトを更新中...", + "save": "プロンプトを更新" + } + }, + "notification": { + "addSuccess": "プロンプトが追加されました", + "addSuccessDesc": "プロンプトが正常に追加されました", + "error": "エラー", + "someError": "問題が発生しました。後ほど再度お試しください。", + "updatedSuccess": "プロンプトが更新されました", + "updatedSuccessDesc": "プロンプトが正常に更新されました", + "deletedSuccess": "プロンプトが削除されました", + "deletedSuccessDesc": "プロンプトが正常に削除されました" + } + }, + "manageShare": { + "title": "共有を管理", + "heading": "ページ共有URLを設定", + "form": { + "url": { + "label": "ページ共有URL", + "placeholder": "ページ共有URLを入力", + "required": "ページ共有URLを入力してください!", + "help": "プライバシー保護のため、ページ共有を自身でホストし、そのURLをここに入力することができます。詳細" + } + }, + "webshare": { + "heading": "ウェブ共有", + "columns": { + "title": "タイトル", + "url": "URL", + "actions": "アクション" + }, + "tooltip": { + "delete": "共有を削除" + }, + "confirm": { + "delete": "本当にこの共有を削除しますか?この操作は元に戻せません。" + } + }, + "notification": { + "pageShareSuccess": "ページ共有URLが正常に更新されました", + "someError": "問題が発生しました。後ほど再度お試しください。", + "webShareDeleteSuccess": "ウェブ共有が正常に削除されました" + } + }, + "ollamaSettings": { + "title": "Ollamaの設定", + "heading": "Ollamaを設定", + "settings": { + "ollamaUrl": { + "label": "OllamaのURL", + "placeholder": "OllamaのURLを入力" + }, + "ragSettings": { + "label": "RAGの設定", + "model": { + "label": "エンベディングモデル", + "required": "モデルを選択してください", + "help": "`nomic-embed-text`などのエンベディングモデルの使用を強くおすすめします。", + "placeholder": "モデルを選択" + }, + "chunkSize": { + "label": "チャンクサイズ", + "placeholder": "チャンクサイズを入力", + "required": "チャンクサイズを入力してください" + }, + "chunkOverlap": { + "label": "チャンクオーバーラップ", + "placeholder": "チャンクオーバーラップを入力", + "required": "チャンクオーバーラップを入力してください" + } + }, + "prompt": { + "label": "RAGプロンプトを設定", + "option1": "通常", + "option2": "Web", + "alert": "ここでシステムプロンプトを設定することは非推奨となりました。プロンプトの追加や編集には「プロンプトを管理」セクションをご利用ください。このセクションは今後のリリースで削除される予定です。", + "systemPrompt": "システムプロンプト", + "systemPromptPlaceholder": "システムプロンプトを入力", + "webSearchPrompt": "Web検索プロンプト", + "webSearchPromptHelp": "プロンプトから`{search_results}`を削除しないでください。", + "webSearchPromptError": "Web検索プロンプトを入力してください", + "webSearchPromptPlaceholder": "Web検索プロンプトを入力", + "webSearchFollowUpPrompt": "Web検索フォローアッププロンプト", + "webSearchFollowUpPromptHelp": "プロンプトから`{chat_history}`と`{question}`を削除しないでください。", + "webSearchFollowUpPromptError": "Web検索フォローアッププロンプトを入力してください!", + "webSearchFollowUpPromptPlaceholder": "Web検索フォローアッププロンプト" + } + } + } +} \ No newline at end of file diff --git a/src/assets/locale/ja-JP/sidepanel.json b/src/assets/locale/ja-JP/sidepanel.json new file mode 100644 index 0000000..ff20f3f --- /dev/null +++ b/src/assets/locale/ja-JP/sidepanel.json @@ -0,0 +1,5 @@ +{ + "tooltip": { + "embed": "ページを埋め込むのに数分かかる場合があります。しばらくお待ちください..." + } + } \ No newline at end of file diff --git a/src/i18n/index.ts b/src/i18n/index.ts index e85b63b..7c8820c 100644 --- a/src/i18n/index.ts +++ b/src/i18n/index.ts @@ -3,15 +3,20 @@ import { initReactI18next } from "react-i18next"; import { en } from "./lang/en"; import { ml } from "./lang/ml"; import { zh } from "./lang/zh"; +import { ja } from "./lang/ja"; +import LanguageDetector from 'i18next-browser-languagedetector'; i18n + .use(LanguageDetector) .use(initReactI18next) .init({ resources: { en: en, ml: ml, "zh-CN": zh, - zh: zh + zh: zh, + ja: ja, + "ja-JP": ja }, fallbackLng: "en", lng: localStorage.getItem("i18nextLng") || "en", diff --git a/src/i18n/lang/ja.ts b/src/i18n/lang/ja.ts new file mode 100644 index 0000000..2026585 --- /dev/null +++ b/src/i18n/lang/ja.ts @@ -0,0 +1,14 @@ +import option from "@/assets/locale/ja-JP/option.json"; +import playground from "@/assets/locale/ja-JP/playground.json"; +import common from "@/assets/locale/ja-JP/common.json"; +import sidepanel from "@/assets/locale/ja-JP/sidepanel.json"; +import settings from "@/assets/locale/ja-JP/settings.json"; + + +export const ja = { + option, + playground, + common, + sidepanel, + settings +} \ No newline at end of file diff --git a/src/i18n/support-language.ts b/src/i18n/support-language.ts index 04c1867..37a52ce 100644 --- a/src/i18n/support-language.ts +++ b/src/i18n/support-language.ts @@ -11,5 +11,9 @@ export const supportLanguage = [ { label: "简体中文", value: "zh-CN" + }, + { + label: "日本語", + value: "ja-JP" } ] \ No newline at end of file diff --git a/src/public/_locales/ja/messages.json b/src/public/_locales/ja/messages.json new file mode 100644 index 0000000..569ec1a --- /dev/null +++ b/src/public/_locales/ja/messages.json @@ -0,0 +1,11 @@ +{ + "extName": { + "message": "Page Assist - ローカルAIモデル用のWeb UI" + }, + "extDescription": { + "message": "ローカルで実行中のAIモデルを使って、Webブラウジングをアシストします。" + }, + "openSidePanelToChat": { + "message": "サイドパネルを開いてチャット" + } + } \ No newline at end of file