Fix: style and translation issues (#1172)

* Update Chinese Translation

* Update

* Update

* Update Anthropic UI
This commit is contained in:
USAGI 2023-11-15 20:29:11 +08:00 committed by GitHub
parent e383ecba85
commit 037ea8cc0b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 27 deletions

View file

@ -4,6 +4,7 @@ import { useRecoilState } from 'recoil';
import { Button } from '~/components';
import { cn } from '~/utils/';
import store from '~/store';
import { useLocalize } from '~/hooks';
type TPopoverButton = {
label: string;
@ -21,6 +22,7 @@ export default function PopoverButtons({
buttonClass?: string;
iconClass?: string;
}) {
const localize = useLocalize();
const [optionSettings, setOptionSettings] = useRecoilState(store.optionSettings);
const [showAgentSettings, setShowAgentSettings] = useRecoilState(store.showAgentSettings);
const { showExamples, isCodeChat } = optionSettings;
@ -30,7 +32,7 @@ export default function PopoverButtons({
const buttons: { [key: string]: TPopoverButton[] } = {
google: [
{
label: (showExamples ? 'Hide' : 'Show') + ' Examples',
label: (showExamples ? localize('com_endpoint_hide') : localize('com_endpoint_show')) + localize('com_endpoint_examples'),
buttonClass: isCodeChat ? 'disabled' : '',
handler: triggerExamples,
icon: <MessagesSquared className={cn('mr-1 w-[14px]', iconClass)} />,
@ -38,7 +40,7 @@ export default function PopoverButtons({
],
gptPlugins: [
{
label: `Show ${showAgentSettings ? 'Completion' : 'Agent'} Settings`,
label: localize('com_endpoint_show_what_settings', showAgentSettings ? localize('com_endpoint_completion') : localize('com_endpoint_agent')),
buttonClass: '',
handler: () => setShowAgentSettings((prev) => !prev),
icon: <GPTIcon className={cn('mr-1 mt-[2px] w-[14px]', iconClass)} size={14} />,

View file

@ -122,10 +122,12 @@ export default function Settings({ conversation, setOption, models, readonly }:
<HoverCard openDelay={300}>
<HoverCardTrigger className="grid w-full items-center gap-2">
<div className="flex justify-between">
{localize('com_endpoint_top_p')}{' '}
<small className="opacity-40">
({localize('com_endpoint_default_with_num', '0.7')})
</small>
<Label htmlFor="top-p-int" className="text-left text-sm font-medium">
{localize('com_endpoint_top_p')}{' '}
<small className="opacity-40">
({localize('com_endpoint_default_with_num', '0.7')})
</small>
</Label>
<InputNumber
id="top-p-int"
disabled={readonly}
@ -201,10 +203,12 @@ export default function Settings({ conversation, setOption, models, readonly }:
<HoverCard openDelay={300}>
<HoverCardTrigger className="grid w-full items-center gap-2">
<div className="flex justify-between">
{localize('com_endpoint_max_output_tokens')}{' '}
<small className="opacity-40">
({localize('com_endpoint_default_with_num', '4000')})
</small>
<Label htmlFor="max-tokens-int" className="text-left text-sm font-medium">
{localize('com_endpoint_max_output_tokens')}{' '}
<small className="opacity-40">
({localize('com_endpoint_default_with_num', '4000')})
</small>
</Label>
<InputNumber
id="max-tokens-int"
disabled={readonly}

View file

@ -22,6 +22,7 @@ export default {
com_ui_use_prompt: '使用提示词',
com_ui_prev: '上一页',
com_ui_next: '下一页',
com_ui_stop: '停止',
com_ui_prompt_templates: '对话模板',
com_ui_hide_prompt_templates: '隐藏对话模板',
com_ui_showing: '显示',
@ -116,10 +117,10 @@ export default {
com_endpoint_bing_system_message_placeholder:
'警告滥用此功能可能导致你被禁止使用必应点击“系统消息”查看完整的使用指南如果你忽略了默认消息那么将会使用被视为安全的“Sydney”预设。',
com_endpoint_system_message: '系统消息',
com_endpoint_default_blank: '初始值: 空',
com_endpoint_default_false: '初始值: false',
com_endpoint_default_creative: '初始值: creative',
com_endpoint_default_empty: '初始值: empty',
com_endpoint_default_blank: '初始值: 空',
com_endpoint_default_false: '初始值: ',
com_endpoint_default_creative: '初始值: 创意',
com_endpoint_default_empty: '初始值: ',
com_endpoint_default_with_num: '初始值: {0}',
com_endpoint_context: '上下文',
com_endpoint_tone_style: '语气',
@ -134,7 +135,7 @@ export default {
com_endpoint_google_maxoutputtokens:
' 响应生成中可以使用的最大词元数。指定较低的值会得到更短的响应,而指定较高的值则会得到更长的响应。',
com_endpoint_google_custom_name_placeholder: '为PaLM2设置一个名称',
com_endpoint_google_prompt_prefix_placeholder: '自定义指令和上下文,默认为空。',
com_endpoint_prompt_prefix_placeholder: '自定义提示词和上下文,默认为空',
com_endpoint_custom_name: '自定义名称',
com_endpoint_prompt_prefix: '对话前缀',
com_endpoint_temperature: '随机性',
@ -149,9 +150,9 @@ export default {
com_endpoint_openai_topp:
'相较于随机性的另一个取样方法称为核采样模型选取输出词元中大于P值概率密度在整个概率分布中的比例的结果。比如 top_p=0.1 表示只有概率占比为前10%的词元才会被考虑作为输出。建议不要同时改变此值和随机性。',
com_endpoint_openai_freq:
'值介于-2.0到2.0之间。正值表示根据已有词元的频率惩罚重复词元结果, 从而减少模型输出重复词。',
'值介于-2.0到2.0之间。正值将惩罚当前已频繁使用的词元,从而降低重复用词的可能性。',
com_endpoint_openai_pres:
'值介于-2.0到2.0之间。正值表示根据出现词元惩罚重复词元结果, 从而增加模型提出新话题的可能性。',
'值介于-2.0到2.0之间。正值将惩罚当前已经使用的词元,从而增加讨论新话题的可能性。',
com_endpoint_openai_custom_name_placeholder: '为ChatGPT设置一个名称',
com_endpoint_openai_prompt_prefix_placeholder:
'在消息开头添加系统级提示词,默认为空',
@ -184,7 +185,7 @@ export default {
com_endpoint_examples: ' 预设',
com_endpoint_completion: '补全',
com_endpoint_agent: '代理',
com_endpoint_show_what_settings: '显示{0}设置',
com_endpoint_show_what_settings: '显示{0}设置',
com_endpoint_save: '保存',
com_endpoint_export: '导出',
com_endpoint_save_as_preset: '保存为预设',