update some i18n support

This commit is contained in:
锦恢 2025-04-18 20:31:14 +08:00
parent b1a083dcd4
commit b7a4ab8706
13 changed files with 168 additions and 20 deletions

View File

@ -2,28 +2,28 @@
<div class="message-meta" @mouseenter="showTime = true" @mouseleave="showTime = false">
<span v-if="usageStatistic" class="message-usage">
<span>
输入 {{ usageStatistic.input }}
{{ t('input-token') }} {{ usageStatistic.input }}
</span>
<span>
输出 {{ usageStatistic.output }}
{{ t('output-token') }} {{ usageStatistic.output }}
</span>
<span>
消耗的总 token {{ usageStatistic.total }}
{{ t('total') }} {{ usageStatistic.total }}
</span>
<span>
缓存命中率 {{ usageStatistic.cacheHitRatio }}%
{{ t('cache-hit-ratio') }} {{ usageStatistic.cacheHitRatio }}%
</span>
</span>
<span v-else class="message-usage">
<span>你使用的供应商暂时不支持统计信息</span>
<span>{{ t('server-not-support-statistic') }}</span>
</span>
<span v-show="showTime" class="message-time">
{{ props.message.extraInfo.serverName }} 作答于
{{ props.message.extraInfo.serverName }} {{ t('answer-at') }}
{{ new Date(message.extraInfo.created).toLocaleString() }}
</span>
</div>
@ -31,10 +31,13 @@
<script setup lang="ts">
import { defineComponent, defineProps, ref, computed } from 'vue';
import { useI18n } from 'vue-i18n';
import { makeUsageStatistic } from './usage';
defineComponent({ name: 'message-meta' });
const { t } = useI18n();
const props = defineProps({
message: {
type: Object,

View File

@ -117,5 +117,11 @@
"read-prompt": "قراءة المطالبة",
"execute-tool": "تشغيل",
"save": "حفظ",
"send": "إرسال"
"send": "إرسال",
"server-not-support-statistic": "موفر الخدمة الذي تستخدمه لا يدعم الإحصائيات مؤقتًا",
"answer-at": "تم الإجابة في",
"input-token": "إدخال",
"output-token": "إخراج",
"total": "الإجمالي",
"cache-hit-ratio": "معدل ضربات التخزين المؤقت"
}

View File

@ -117,5 +117,11 @@
"read-prompt": "Prompt lesen",
"execute-tool": "Ausführen",
"save": "Speichern",
"send": "Senden"
"send": "Senden",
"server-not-support-statistic": "Der von Ihnen verwendete Anbieter unterstützt vorerst keine Statistiken",
"answer-at": "Beantwortet am",
"input-token": "Eingabe",
"output-token": "Ausgabe",
"total": "Gesamt",
"cache-hit-ratio": "Cache-Trefferquote"
}

View File

@ -117,5 +117,11 @@
"read-prompt": "Read prompt",
"execute-tool": "Run",
"save": "Save",
"send": "Send"
"send": "Send",
"server-not-support-statistic": "The vendor you are using does not support statistics temporarily",
"answer-at": "Answered on",
"input-token": "Input",
"output-token": "Output",
"total": "Total",
"cache-hit-ratio": "Cache hit rate"
}

View File

@ -117,5 +117,11 @@
"read-prompt": "Lire l'invite",
"execute-tool": "Exécuter",
"save": "Enregistrer",
"send": "Envoyer"
"send": "Envoyer",
"server-not-support-statistic": "Le fournisseur que vous utilisez ne prend pas en charge les statistiques temporairement",
"answer-at": "Répondu le",
"input-token": "Entrée",
"output-token": "Sortie",
"total": "Total",
"cache-hit-ratio": "Taux de réussite du cache"
}

View File

@ -117,5 +117,11 @@
"read-prompt": "プロンプトを読み取る",
"execute-tool": "実行",
"save": "保存",
"send": "送信"
"send": "送信",
"server-not-support-statistic": "お使いのベンダーは一時的に統計情報をサポートしていません",
"answer-at": "解答日",
"input-token": "入力",
"output-token": "出力",
"total": "合計",
"cache-hit-ratio": "キャッシュヒット率"
}

View File

@ -117,5 +117,11 @@
"read-prompt": "프롬프트 읽기",
"execute-tool": "실행",
"save": "저장",
"send": "보내기"
"send": "보내기",
"server-not-support-statistic": "사용 중인 공급업체는 일시적으로 통계를 지원하지 않습니다",
"answer-at": "답변일",
"input-token": "입력",
"output-token": "출력",
"total": "총계",
"cache-hit-ratio": "캐시 적중률"
}

View File

@ -117,5 +117,11 @@
"read-prompt": "Чтение подсказки",
"execute-tool": "Запуск",
"save": "Сохранить",
"send": "Отправить"
"send": "Отправить",
"server-not-support-statistic": "Используемый вами поставщик временно не поддерживает статистику",
"answer-at": "Ответ дан",
"input-token": "Ввод",
"output-token": "Вывод",
"total": "Итого",
"cache-hit-ratio": "Коэффициент попаданий в кэш"
}

View File

@ -117,5 +117,11 @@
"read-prompt": "读取 prompt",
"execute-tool": "运行",
"save": "保存",
"send": "发送"
"send": "发送",
"server-not-support-statistic": "你使用的供应商暂时不支持统计信息",
"answer-at": "作答于",
"input-token": "输入",
"output-token": "输出",
"total": "总计",
"cache-hit-ratio": "缓存命中率"
}

View File

@ -117,5 +117,11 @@
"read-prompt": "讀取提示",
"execute-tool": "執行",
"save": "儲存",
"send": "傳送"
"send": "傳送",
"server-not-support-statistic": "你使用的供應商暫時不支持統計信息",
"answer-at": "作答於",
"input-token": "輸入",
"output-token": "輸出",
"total": "總計",
"cache-hit-ratio": "緩存命中率"
}

View File

@ -120,10 +120,6 @@ onMounted(() => {
background-color: var(--background) !important;
}
.el-switch__core .el-switch__action {
background-color: var(--background) !important;
}
.el-slider__stop {
background-color: var(--vscode-foreground) !important;
}

12
service/tabs.untitle.json Normal file
View File

@ -0,0 +1,12 @@
{
"currentIndex": 0,
"tabs": [
{
"name": "Blank test 1",
"icon": "icon-blank",
"type": "blank",
"componentIndex": -1,
"storage": {}
}
]
}

View File

@ -1,5 +1,5 @@
{
"currentIndex": 0,
"currentIndex": 1,
"tabs": [
{
"name": "交互测试",
@ -23,6 +23,80 @@
"created": 1744971604583,
"serverName": "openai"
}
},
{
"role": "user",
"content": "杭州今天的气温",
"extraInfo": {
"created": 1744979181964,
"serverName": "deepseek"
}
},
{
"role": "assistant",
"content": "",
"tool_calls": [
{
"id": "call_0_99f46975-2238-49b0-a4ba-eace2f199a74",
"index": 0,
"type": "function",
"function": {
"name": "get_weather_by_city_code",
"arguments": "{\"city_code\":101210101}"
}
}
],
"extraInfo": {
"created": 1744979187506,
"serverName": "deepseek",
"usage": {
"prompt_tokens": 207,
"completion_tokens": 26,
"total_tokens": 233,
"prompt_tokens_details": {
"cached_tokens": 0
},
"prompt_cache_hit_tokens": 0,
"prompt_cache_miss_tokens": 207
}
}
},
{
"role": "tool",
"tool_call_id": "call_0_99f46975-2238-49b0-a4ba-eace2f199a74",
"content": "[{\"type\":\"text\",\"text\":\"CityWeather(city_name_en='hangzhou', city_name_cn='杭州', city_code='101210101', temp='24.7', wd='', ws='', sd='58%', aqi='69', weather='晴')\"}]",
"extraInfo": {
"created": 1744979187685,
"serverName": "deepseek",
"usage": {
"prompt_tokens": 207,
"completion_tokens": 26,
"total_tokens": 233,
"prompt_tokens_details": {
"cached_tokens": 0
},
"prompt_cache_hit_tokens": 0,
"prompt_cache_miss_tokens": 207
}
}
},
{
"role": "assistant",
"content": "杭州今天的气温是24.7°C天气晴朗空气质量指数为69。",
"extraInfo": {
"created": 1744979192559,
"serverName": "deepseek",
"usage": {
"prompt_tokens": 299,
"completion_tokens": 19,
"total_tokens": 318,
"prompt_tokens_details": {
"cached_tokens": 192
},
"prompt_cache_hit_tokens": 192,
"prompt_cache_miss_tokens": 107
}
}
}
],
"settings": {
@ -60,6 +134,15 @@
"systemPrompt": ""
}
}
},
{
"name": "资源",
"icon": "icon-file",
"type": "blank",
"componentIndex": 0,
"storage": {
"currentResourceName": "greeting"
}
}
]
}