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

View File

@ -117,5 +117,11 @@
"read-prompt": "قراءة المطالبة", "read-prompt": "قراءة المطالبة",
"execute-tool": "تشغيل", "execute-tool": "تشغيل",
"save": "حفظ", "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", "read-prompt": "Prompt lesen",
"execute-tool": "Ausführen", "execute-tool": "Ausführen",
"save": "Speichern", "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", "read-prompt": "Read prompt",
"execute-tool": "Run", "execute-tool": "Run",
"save": "Save", "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", "read-prompt": "Lire l'invite",
"execute-tool": "Exécuter", "execute-tool": "Exécuter",
"save": "Enregistrer", "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": "プロンプトを読み取る", "read-prompt": "プロンプトを読み取る",
"execute-tool": "実行", "execute-tool": "実行",
"save": "保存", "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": "프롬프트 읽기", "read-prompt": "프롬프트 읽기",
"execute-tool": "실행", "execute-tool": "실행",
"save": "저장", "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": "Чтение подсказки", "read-prompt": "Чтение подсказки",
"execute-tool": "Запуск", "execute-tool": "Запуск",
"save": "Сохранить", "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", "read-prompt": "读取 prompt",
"execute-tool": "运行", "execute-tool": "运行",
"save": "保存", "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": "讀取提示", "read-prompt": "讀取提示",
"execute-tool": "執行", "execute-tool": "執行",
"save": "儲存", "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; background-color: var(--background) !important;
} }
.el-switch__core .el-switch__action {
background-color: var(--background) !important;
}
.el-slider__stop { .el-slider__stop {
background-color: var(--vscode-foreground) !important; 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": [ "tabs": [
{ {
"name": "交互测试", "name": "交互测试",
@ -23,6 +23,80 @@
"created": 1744971604583, "created": 1744971604583,
"serverName": "openai" "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": { "settings": {
@ -60,6 +134,15 @@
"systemPrompt": "" "systemPrompt": ""
} }
} }
},
{
"name": "资源",
"icon": "icon-file",
"type": "blank",
"componentIndex": 0,
"storage": {
"currentResourceName": "greeting"
}
} }
] ]
} }