feat: Update translations for copilot context menu options

This commit is contained in:
n4ze3m 2024-08-03 23:51:17 +05:30
parent ac9c9ca887
commit 58304d9ca7
11 changed files with 157 additions and 92 deletions

View File

@ -84,5 +84,12 @@
} }
}, },
"advanced": "More Model Settings" "advanced": "More Model Settings"
},
"copilot": {
"summary": "Summarize",
"explain": "Explain",
"rephrase": "Rephrase",
"translate": "Translate",
"custom": "Custom"
} }
} }

View File

@ -84,5 +84,11 @@
} }
}, },
"advanced": "Más Configuraciones del Modelo" "advanced": "Más Configuraciones del Modelo"
},
"copilot": {
"summary": "Resumir",
"explain": "Explicar",
"rephrase": "Reformular",
"translate": "Traducir"
} }
} }

View File

@ -51,7 +51,7 @@
"chatWithCurrentPage": "Discuter avec la page actuelle", "chatWithCurrentPage": "Discuter avec la page actuelle",
"beta": "Bêta", "beta": "Bêta",
"tts": "Synthèse vocale", "tts": "Synthèse vocale",
"currentChatModelSettings":"Paramètres actuels du modèle de chat", "currentChatModelSettings": "Paramètres actuels du modèle de chat",
"modelSettings": { "modelSettings": {
"label": "Paramètres du modèle", "label": "Paramètres du modèle",
"description": "Définissez les options de modèle globale pour tous les chats", "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" "advanced": "Plus de paramètres du modèle"
},
"copilot": {
"summary": "Résumer",
"explain": "Expliquer",
"rephrase": "Reformuler",
"translate": "Traduire"
} }
} }

View File

@ -84,5 +84,11 @@
} }
}, },
"advanced": "Altre Impostazioni del Modello" "advanced": "Altre Impostazioni del Modello"
},
"copilot": {
"summary": "Riassumere",
"explain": "Spiegare",
"rephrase": "Riformulare",
"translate": "Tradurre"
} }
} }

View File

@ -84,5 +84,11 @@
} }
}, },
"advanced": "その他のモデル設定" "advanced": "その他のモデル設定"
},
"copilot": {
"summary": "要約",
"explain": "説明",
"rephrase": "言い換え",
"translate": "翻訳"
} }
} }

View File

@ -83,5 +83,11 @@
} }
}, },
"advanced": "കൂടുതൽ മോഡൽ ക്രമീകരണങ്ങൾ" "advanced": "കൂടുതൽ മോഡൽ ക്രമീകരണങ്ങൾ"
},
"copilot": {
"summary": "സംഗ്രഹിക്കുക",
"explain": "വിശദീകരിക്കുക",
"rephrase": "പുനഃരൂപീകരിക്കുക",
"translate": "വിവർത്തനം ചെയ്യുക"
} }
} }

View File

@ -84,5 +84,11 @@
} }
}, },
"advanced": "Mais Configurações do Modelo" "advanced": "Mais Configurações do Modelo"
},
"copilot": {
"summary": "Resumir",
"explain": "Explicar",
"rephrase": "Reformular",
"translate": "Traduzir"
} }
} }

View File

@ -84,5 +84,11 @@
} }
}, },
"advanced": "Больше настроек модели" "advanced": "Больше настроек модели"
},
"copilot": {
"summary": "Обобщить",
"explain": "Объяснить",
"rephrase": "Перефразировать",
"translate": "Перевести"
} }
} }

View File

@ -84,5 +84,11 @@
} }
}, },
"advanced": "更多模型设置" "advanced": "更多模型设置"
},
"copilot": {
"summary": "总结",
"explain": "解释",
"rephrase": "重述",
"translate": "翻译"
} }
} }

View File

@ -37,6 +37,14 @@ type Props = {
isTTSEnabled?: boolean isTTSEnabled?: boolean
} }
const tagColors = {
summary: "blue",
explain: "green",
translate: "purple",
custom: "orange",
rephrase: "yellow"
}
export const PlaygroundMessage = (props: Props) => { export const PlaygroundMessage = (props: Props) => {
const [isBtnPressed, setIsBtnPressed] = React.useState(false) const [isBtnPressed, setIsBtnPressed] = React.useState(false)
const [editMode, setEditMode] = React.useState(false) const [editMode, setEditMode] = React.useState(false)
@ -79,7 +87,9 @@ export const PlaygroundMessage = (props: Props) => {
) : null} ) : null}
<div> <div>
{props?.message_type && ( {props?.message_type && (
<Tag color="blue">{props?.message_type}</Tag> <Tag color={tagColors[props?.message_type] || "default"}>
{t(`copilot.${props?.message_type}`)}
</Tag>
)} )}
</div> </div>
<div className="flex flex-grow flex-col"> <div className="flex flex-grow flex-col">
@ -90,7 +100,7 @@ export const PlaygroundMessage = (props: Props) => {
<p <p
className={`prose dark:prose-invert whitespace-pre-line prose-p:leading-relaxed prose-pre:p-0 dark:prose-dark ${ className={`prose dark:prose-invert whitespace-pre-line prose-p:leading-relaxed prose-pre:p-0 dark:prose-dark ${
props.message_type && props.message_type &&
"italic text-gray-500 dark:text-gray-400 text-xs" "italic text-gray-500 dark:text-gray-400 text-sm"
}`}> }`}>
{props.message} {props.message}
</p> </p>

View File

@ -86,11 +86,11 @@ export default defineBackground({
contexts: ["selection"] contexts: ["selection"]
}) })
// browser.contextMenus.create({ browser.contextMenus.create({
// id: "custom-pg", id: "custom-pg",
// title: "Custom", title: "Custom",
// contexts: ["selection"] contexts: ["selection"]
// }) })
if (import.meta.env.BROWSER === "chrome") { if (import.meta.env.BROWSER === "chrome") {
browser.contextMenus.onClicked.addListener(async (info, tab) => { browser.contextMenus.onClicked.addListener(async (info, tab) => {