Skip to content

Commit

Permalink
Revert "feat: dialog i18n"
Browse files Browse the repository at this point in the history
This reverts commit 69533fb.
  • Loading branch information
ZhouhaoJiang committed Jun 21, 2024
1 parent 289c45c commit d10ba40
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const ConfigBtn: FC<Props> = ({
...popupProps
}) => {
const { t } = useTranslation()
const [open, setOpen] = useState(true)
const [open, setOpen] = useState(false)
const handleTrigger = useCallback(() => {
setOpen(v => !v)
}, [setOpen])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const ConfigPopup: FC<PopupProps> = ({
}) => {
const { t } = useTranslation()

const [currentProvider, setCurrentProvider] = useState<TracingProvider | null>(TracingProvider.langfuse)
const [currentProvider, setCurrentProvider] = useState<TracingProvider | null>(TracingProvider.langSmith)
const [isShowConfigModal, {
setTrue: showConfigModal,
setFalse: hideConfigModal,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type Props = {
onSaved: () => void
}

const I18N_PREFIX = 'app.tracing.configProvider'
const I18N_PREFIX = 'app.tracing.config'

const ProviderConfigModal: FC<Props> = ({
type,
Expand Down Expand Up @@ -49,7 +49,7 @@ const ProviderConfigModal: FC<Props> = ({
<div className='mx-2 w-[640px] max-h-[calc(100vh-120px)] bg-white shadow-xl rounded-2xl overflow-y-auto'>
<div className='px-8 pt-8'>
<div className='flex justify-between items-center mb-4'>
<div className='text-xl font-semibold text-gray-900'>{t(`${I18N_PREFIX}.title`)}{t(`app.tracing.${type}.title`)}</div>
<div className='text-xl font-semibold text-gray-900'>{t(`${I18N_PREFIX}.configFirecrawl`)}</div>
</div>

<div className='space-y-4'>
Expand All @@ -61,15 +61,15 @@ const ProviderConfigModal: FC<Props> = ({
isRequired
value={config.api_key}
onChange={handleConfigChange('api_key')}
placeholder={t(`${I18N_PREFIX}.placeholder`, { key: 'API Key' })!}
placeholder={'Enter your API Key'}
/>
<Field
label={t(`${I18N_PREFIX}.project`)!}
label='Project'
labelClassName='!text-sm'
isRequired
value={config.base_url}
onChange={handleConfigChange('project')}
placeholder={t(`${I18N_PREFIX}.placeholder`, { key: t(`${I18N_PREFIX}.project`) })!}
placeholder={'Enter your Project'}
/>
<Field
label='Endpoint'
Expand All @@ -83,20 +83,20 @@ const ProviderConfigModal: FC<Props> = ({
{type === TracingProvider.langfuse && (
<>
<Field
label={t(`${I18N_PREFIX}.publicKey`)!}
label='Public Key'
labelClassName='!text-sm'
isRequired
value={config.api_key}
onChange={handleConfigChange('public_key')}
placeholder={t(`${I18N_PREFIX}.placeholder`, { key: t(`${I18N_PREFIX}.publicKey`) })!}
placeholder={'Enter your Public Key'}
/>
<Field
label={t(`${I18N_PREFIX}.secretKey`)!}
label='Private Key'
labelClassName='!text-sm'
value={config.base_url}
isRequired
onChange={handleConfigChange('base_url')}
placeholder={t(`${I18N_PREFIX}.placeholder`, { key: t(`${I18N_PREFIX}.secretKey`) })!}
placeholder={'Enter your Private Key'}
/>
<Field
label='Host'
Expand All @@ -111,7 +111,7 @@ const ProviderConfigModal: FC<Props> = ({
</div>
<div className='my-8 flex justify-between items-center h-8'>
<a className='flex items-center space-x-1 leading-[18px] text-xs font-normal text-[#155EEF]' target='_blank' href='https://www.firecrawl.dev/account'>
<span>{t(`${I18N_PREFIX}.viewDocsLink`, { key: t(`app.tracing.${type}.title`) })}</span>
<span>{t(`${I18N_PREFIX}.getApiKeyLinkText`)}</span>
<LinkExternal02 className='w-3 h-3' />
</a>
<div className='flex'>
Expand Down
10 changes: 5 additions & 5 deletions web/i18n/en-US/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,20 +97,20 @@ const translation = {
tracingDescription: 'Capture the full context of app execution, including LLM calls, context, prompts, HTTP requests, and more, to a third-party tracing platform.',
configProviderTitle: 'Config provider to enable tracing',
langSmith: {
title: 'LangSmith',
description: 'An all-in-one developer platform for every step of the LLM-powered application lifecycle.',
},
langfuse: {
title: 'Langfuse',
description: 'Traces, evals, prompt management and metrics to debug and improve your LLM application.',
},
configProvider: {
title: 'Config ',
placeholder: 'Enter your {{key}}',
title: 'Config',
placeholder: 'Enter your {key}',
project: 'Project',
endpoint: 'Endpoint',
publicKey: 'Public Key',
secretKey: 'Secret Key',
viewDocsLink: 'View {{key}} docs',
viewDocsLink: 'View LangSmith docs',
saveAndEnable: 'Save and Enable',
},
},
}
Expand Down
10 changes: 0 additions & 10 deletions web/i18n/zh-Hans/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,21 +96,11 @@ const translation = {
tracingDescription: '捕获应用程序执行的完整上下文,包括 LLM 调用、上下文、提示、HTTP 请求等,发送到第三方跟踪平台。',
configProviderTitle: '配置提供商以启用追踪',
langSmith: {
title: 'LangSmith',
description: '一个全方位的开发者平台,适用于 LLM 驱动应用程序生命周期的每个步骤。',
},
langfuse: {
title: 'Langfuse',
description: '跟踪、评估、提示管理和指标,以调试和改进您的 LLM 应用程序。',
},
configProvider: {
title: '配置 ',
placeholder: '输入你的{{key}}',
project: '项目',
publicKey: '公钥',
secretKey: '密钥',
viewDocsLink: '查看 {{key}} 的文档',
},
},
}

Expand Down

0 comments on commit d10ba40

Please sign in to comment.