Skip to content

Commit

Permalink
refactor: add translation and model id display
Browse files Browse the repository at this point in the history
  • Loading branch information
OrenZhang committed Feb 5, 2024
1 parent 35b0d9a commit 6a3b9ab
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 8 deletions.
4 changes: 2 additions & 2 deletions apps/chat/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class ModelNameMixin:
def model_name(self, inst: Union[ModelPermission, ChatLog]) -> str:
model_inst: AIModel = AIModel.objects.filter(model=inst.model, is_enabled=True).first()
if model_inst is None:
return ""
return model_inst.name
return f"--({inst.model})"
return f"{model_inst.name}({model_inst.model})"


@admin.register(ChatLog)
Expand Down
Binary file modified locale/zh_Hans/LC_MESSAGES/django.mo
Binary file not shown.
42 changes: 36 additions & 6 deletions locale/zh_Hans/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-10-08 13:22+0800\n"
"POT-Creation-Date: 2024-02-05 11:29+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand All @@ -18,6 +18,9 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"

msgid "Model Name"
msgstr "模型名称"

msgid "Total Price"
msgstr "总价"

Expand All @@ -36,8 +39,20 @@ msgstr "系统"
msgid "Assistant"
msgstr "助理"

msgid "HunYuan Plus"
msgstr "腾讯混元大模型(高级版)"
msgid "Model"
msgstr "模型"

msgid "Open AI"
msgstr "Open AI"

msgid "Google"
msgstr "Google"

msgid "Baidu"
msgstr "Baidu"

msgid "Tencent"
msgstr "Tencent"

msgid "Unauthorized Model"
msgstr "未授权的模型"
Expand All @@ -48,15 +63,15 @@ msgstr "未知异常"
msgid "Pre Check Verify Failed"
msgstr "预检查失败"

msgid "Unexpected Provider"
msgstr "未知的提供商"

msgid "ID"
msgstr "ID"

msgid "Chat ID"
msgstr "对话ID"

msgid "Model"
msgstr "模型"

msgid "Prompt Content"
msgstr "提示内容"

Expand Down Expand Up @@ -87,6 +102,21 @@ msgstr "过期时间"
msgid "Model Permission"
msgstr "模型权限"

msgid "Provider"
msgstr "提供商"

msgid "Enabled"
msgstr "启用"

msgid "Prompt Price"
msgstr "提示令牌价格"

msgid "Completion Price"
msgstr "响应令牌价格"

msgid "AI Model"
msgstr "AI 模型"

msgid "Role"
msgstr "角色"

Expand Down

0 comments on commit 6a3b9ab

Please sign in to comment.