From 58304d9ca707666bb81034d54e176c684909a659 Mon Sep 17 00:00:00 2001 From: n4ze3m Date: Sat, 3 Aug 2024 23:51:17 +0530 Subject: [PATCH] feat: Update translations for copilot context menu options --- src/assets/locale/en/common.json | 7 + src/assets/locale/es/common.json | 8 +- src/assets/locale/fr/common.json | 8 +- src/assets/locale/it/common.json | 8 +- src/assets/locale/ja-JP/common.json | 168 ++++++++++--------- src/assets/locale/ml/common.json | 6 + src/assets/locale/pt-BR/common.json | 6 + src/assets/locale/ru/common.json | 8 +- src/assets/locale/zh/common.json | 6 + src/components/Common/Playground/Message.tsx | 14 +- src/entries/background.ts | 10 +- 11 files changed, 157 insertions(+), 92 deletions(-) diff --git a/src/assets/locale/en/common.json b/src/assets/locale/en/common.json index ffa6e81..05ef169 100644 --- a/src/assets/locale/en/common.json +++ b/src/assets/locale/en/common.json @@ -84,5 +84,12 @@ } }, "advanced": "More Model Settings" + }, + "copilot": { + "summary": "Summarize", + "explain": "Explain", + "rephrase": "Rephrase", + "translate": "Translate", + "custom": "Custom" } } \ No newline at end of file diff --git a/src/assets/locale/es/common.json b/src/assets/locale/es/common.json index e316a0b..06d0a00 100644 --- a/src/assets/locale/es/common.json +++ b/src/assets/locale/es/common.json @@ -84,5 +84,11 @@ } }, "advanced": "Más Configuraciones del Modelo" + }, + "copilot": { + "summary": "Resumir", + "explain": "Explicar", + "rephrase": "Reformular", + "translate": "Traducir" } -} +} \ No newline at end of file diff --git a/src/assets/locale/fr/common.json b/src/assets/locale/fr/common.json index 328acae..cf601db 100644 --- a/src/assets/locale/fr/common.json +++ b/src/assets/locale/fr/common.json @@ -51,7 +51,7 @@ "chatWithCurrentPage": "Discuter avec la page actuelle", "beta": "Bêta", "tts": "Synthèse vocale", - "currentChatModelSettings":"Paramètres actuels du modèle de chat", + "currentChatModelSettings": "Paramètres actuels du modèle de chat", "modelSettings": { "label": "Paramètres du modèle", "description": "Définissez les options de modèle globale pour tous les chats", @@ -84,5 +84,11 @@ } }, "advanced": "Plus de paramètres du modèle" + }, + "copilot": { + "summary": "Résumer", + "explain": "Expliquer", + "rephrase": "Reformuler", + "translate": "Traduire" } } \ No newline at end of file diff --git a/src/assets/locale/it/common.json b/src/assets/locale/it/common.json index df4f4c3..0b0708e 100644 --- a/src/assets/locale/it/common.json +++ b/src/assets/locale/it/common.json @@ -84,5 +84,11 @@ } }, "advanced": "Altre Impostazioni del Modello" + }, + "copilot": { + "summary": "Riassumere", + "explain": "Spiegare", + "rephrase": "Riformulare", + "translate": "Tradurre" } -} +} \ No newline at end of file diff --git a/src/assets/locale/ja-JP/common.json b/src/assets/locale/ja-JP/common.json index 7519408..4fcde04 100644 --- a/src/assets/locale/ja-JP/common.json +++ b/src/assets/locale/ja-JP/common.json @@ -1,88 +1,94 @@ { - "pageAssist": "ページアシスト", - "selectAModel": "モデルを選択", - "save": "保存", - "saved": "保存済み", - "cancel": "キャンセル", - "retry": "再試行", - "share": { - "tooltip": { - "share": "共有" + "pageAssist": "ページアシスト", + "selectAModel": "モデルを選択", + "save": "保存", + "saved": "保存済み", + "cancel": "キャンセル", + "retry": "再試行", + "share": { + "tooltip": { + "share": "共有" + }, + "modal": { + "title": "チャットリンクを共有" + }, + "form": { + "defaultValue": { + "name": "匿名", + "title": "無題のチャット" }, - "modal": { - "title": "チャットリンクを共有" + "title": { + "label": "チャットタイトル", + "placeholder": "チャットタイトルを入力", + "required": "チャットタイトルは必須です" }, - "form": { - "defaultValue": { - "name": "匿名", - "title": "無題のチャット" - }, - "title": { - "label": "チャットタイトル", - "placeholder": "チャットタイトルを入力", - "required": "チャットタイトルは必須です" - }, - "name": { - "label": "あなたの名前", - "placeholder": "名前を入力", - "required": "名前は必須です" - }, - "btn": { - "save": "リンクを生成", - "saving": "リンクを生成中..." - } + "name": { + "label": "あなたの名前", + "placeholder": "名前を入力", + "required": "名前は必須です" }, - "notification": { - "successGenerate": "リンクがクリップボードにコピーされました", - "failGenerate": "リンクの生成に失敗しました" + "btn": { + "save": "リンクを生成", + "saving": "リンクを生成中..." } }, - "copyToClipboard": "クリップボードにコピー", - "webSearch": "ウェブを検索中", - "regenerate": "再生成", - "edit": "編集", - "saveAndSubmit": "保存して送信", - "editMessage": { - "placeholder": "メッセージを入力..." - }, - "submit": "送信", - "noData": "データがありません", - "noHistory": "チャット履歴がありません", - "chatWithCurrentPage": "現在のページでチャット", - "beta": "ベータ", - "tts": "読み上げ", - "currentChatModelSettings": "現在のチャットモデル設定", - "modelSettings": { - "label": "モデル設定", - "description": "すべてのチャットに対してモデルオプションをグローバルに設定します", - "form": { - "keepAlive": { - "label": "キープアライブ", - "help": "リクエスト後にモデルがメモリに保持される時間をコントロールします(デフォルト: 5 分)", - "placeholder": "キープアライブの期間を入力してください(例:5分、10分、1時間)" - }, - "temperature": { - "label": "温度", - "placeholder": "温度値を入力してください(例:0.7、1.0)" - }, - "numCtx": { - "label": "コンテキストの数", - "placeholder": "コンテキスト数を入力してください(デフォルト:2048)" - }, - "seed": { - "label": "シード", - "placeholder": "シード値を入力してください(例:1234)", - "help": "モデル出力の再現性" - }, - "topK": { - "label": "Top K", - "placeholder": "Top K値を入力してください(例:40、100)" - }, - "topP": { - "label": "Top P", - "placeholder": "Top P値を入力してください(例:0.9、0.95)" - } - }, - "advanced": "その他のモデル設定" + "notification": { + "successGenerate": "リンクがクリップボードにコピーされました", + "failGenerate": "リンクの生成に失敗しました" } - } \ No newline at end of file + }, + "copyToClipboard": "クリップボードにコピー", + "webSearch": "ウェブを検索中", + "regenerate": "再生成", + "edit": "編集", + "saveAndSubmit": "保存して送信", + "editMessage": { + "placeholder": "メッセージを入力..." + }, + "submit": "送信", + "noData": "データがありません", + "noHistory": "チャット履歴がありません", + "chatWithCurrentPage": "現在のページでチャット", + "beta": "ベータ", + "tts": "読み上げ", + "currentChatModelSettings": "現在のチャットモデル設定", + "modelSettings": { + "label": "モデル設定", + "description": "すべてのチャットに対してモデルオプションをグローバルに設定します", + "form": { + "keepAlive": { + "label": "キープアライブ", + "help": "リクエスト後にモデルがメモリに保持される時間をコントロールします(デフォルト: 5 分)", + "placeholder": "キープアライブの期間を入力してください(例:5分、10分、1時間)" + }, + "temperature": { + "label": "温度", + "placeholder": "温度値を入力してください(例:0.7、1.0)" + }, + "numCtx": { + "label": "コンテキストの数", + "placeholder": "コンテキスト数を入力してください(デフォルト:2048)" + }, + "seed": { + "label": "シード", + "placeholder": "シード値を入力してください(例:1234)", + "help": "モデル出力の再現性" + }, + "topK": { + "label": "Top K", + "placeholder": "Top K値を入力してください(例:40、100)" + }, + "topP": { + "label": "Top P", + "placeholder": "Top P値を入力してください(例:0.9、0.95)" + } + }, + "advanced": "その他のモデル設定" + }, + "copilot": { + "summary": "要約", + "explain": "説明", + "rephrase": "言い換え", + "translate": "翻訳" + } +} \ No newline at end of file diff --git a/src/assets/locale/ml/common.json b/src/assets/locale/ml/common.json index ad3d9cc..4d923c0 100644 --- a/src/assets/locale/ml/common.json +++ b/src/assets/locale/ml/common.json @@ -83,5 +83,11 @@ } }, "advanced": "കൂടുതൽ മോഡൽ ക്രമീകരണങ്ങൾ" + }, + "copilot": { + "summary": "സംഗ്രഹിക്കുക", + "explain": "വിശദീകരിക്കുക", + "rephrase": "പുനഃരൂപീകരിക്കുക", + "translate": "വിവർത്തനം ചെയ്യുക" } } \ No newline at end of file diff --git a/src/assets/locale/pt-BR/common.json b/src/assets/locale/pt-BR/common.json index 6f3b70b..a322b7c 100644 --- a/src/assets/locale/pt-BR/common.json +++ b/src/assets/locale/pt-BR/common.json @@ -84,5 +84,11 @@ } }, "advanced": "Mais Configurações do Modelo" + }, + "copilot": { + "summary": "Resumir", + "explain": "Explicar", + "rephrase": "Reformular", + "translate": "Traduzir" } } \ No newline at end of file diff --git a/src/assets/locale/ru/common.json b/src/assets/locale/ru/common.json index 7deac9a..b14c855 100644 --- a/src/assets/locale/ru/common.json +++ b/src/assets/locale/ru/common.json @@ -84,5 +84,11 @@ } }, "advanced": "Больше настроек модели" + }, + "copilot": { + "summary": "Обобщить", + "explain": "Объяснить", + "rephrase": "Перефразировать", + "translate": "Перевести" } -} +} \ No newline at end of file diff --git a/src/assets/locale/zh/common.json b/src/assets/locale/zh/common.json index dca8241..9145e48 100644 --- a/src/assets/locale/zh/common.json +++ b/src/assets/locale/zh/common.json @@ -84,5 +84,11 @@ } }, "advanced": "更多模型设置" + }, + "copilot": { + "summary": "总结", + "explain": "解释", + "rephrase": "重述", + "translate": "翻译" } } \ No newline at end of file diff --git a/src/components/Common/Playground/Message.tsx b/src/components/Common/Playground/Message.tsx index fed8b4f..bcdbd23 100644 --- a/src/components/Common/Playground/Message.tsx +++ b/src/components/Common/Playground/Message.tsx @@ -37,6 +37,14 @@ type Props = { isTTSEnabled?: boolean } +const tagColors = { + summary: "blue", + explain: "green", + translate: "purple", + custom: "orange", + rephrase: "yellow" +} + export const PlaygroundMessage = (props: Props) => { const [isBtnPressed, setIsBtnPressed] = React.useState(false) const [editMode, setEditMode] = React.useState(false) @@ -79,7 +87,9 @@ export const PlaygroundMessage = (props: Props) => { ) : null}
{props?.message_type && ( - {props?.message_type} + + {t(`copilot.${props?.message_type}`)} + )}
@@ -90,7 +100,7 @@ export const PlaygroundMessage = (props: Props) => {

{props.message}

diff --git a/src/entries/background.ts b/src/entries/background.ts index 8972369..34f6679 100644 --- a/src/entries/background.ts +++ b/src/entries/background.ts @@ -86,11 +86,11 @@ export default defineBackground({ contexts: ["selection"] }) - // browser.contextMenus.create({ - // id: "custom-pg", - // title: "Custom", - // contexts: ["selection"] - // }) + browser.contextMenus.create({ + id: "custom-pg", + title: "Custom", + contexts: ["selection"] + }) if (import.meta.env.BROWSER === "chrome") { browser.contextMenus.onClicked.addListener(async (info, tab) => {