i18n(common): add i18n translation

This commit is contained in:
orenzhang
2025-03-06 20:16:34 +08:00
parent 1173459eee
commit 92fb1109b6
56 changed files with 315 additions and 16 deletions

View File

@@ -179,7 +179,7 @@
</div>
</div>
<Tooltip content="Verify Connection" className="self-end -mb-1">
<Tooltip content={$i18n.t('Verify Connection')} className="self-end -mb-1">
<button
class="self-center p-1 bg-transparent hover:bg-gray-100 dark:bg-gray-900 dark:hover:bg-gray-850 rounded-lg transition"
on:click={() => {

View File

@@ -387,8 +387,8 @@
<div class="flex items-center relative">
<Tooltip
content={BYPASS_EMBEDDING_AND_RETRIEVAL
? 'Inject the entire content as context for comprehensive processing, this is recommended for complex queries.'
: 'Default to segmented retrieval for focused and relevant content extraction, this is recommended for most cases.'}
? $i18n.t('Inject the entire content as context for comprehensive processing, this is recommended for complex queries.')
: $i18n.t('Default to segmented retrieval for focused and relevant content extraction, this is recommended for most cases.')}
>
<Switch bind:state={BYPASS_EMBEDDING_AND_RETRIEVAL} />
</Tooltip>
@@ -625,8 +625,8 @@
<div class="flex items-center relative">
<Tooltip
content={RAG_FULL_CONTEXT
? 'Inject entire contents as context for comprehensive processing, this is recommended for complex queries.'
: 'Default to segmented retrieval for focused and relevant content extraction, this is recommended for most cases.'}
? $i18n.t('Inject the entire content as context for comprehensive processing, this is recommended for complex queries.')
: $i18n.t('Default to segmented retrieval for focused and relevant content extraction, this is recommended for most cases.')}
>
<Switch bind:state={RAG_FULL_CONTEXT} />
</Tooltip>

View File

@@ -462,8 +462,8 @@
<div class="flex items-center relative">
<Tooltip
content={webConfig.BYPASS_WEB_SEARCH_EMBEDDING_AND_RETRIEVAL
? 'Inject the entire content as context for comprehensive processing, this is recommended for complex queries.'
: 'Default to segmented retrieval for focused and relevant content extraction, this is recommended for most cases.'}
? $i18n.t('Inject the entire content as context for comprehensive processing, this is recommended for complex queries.')
: $i18n.t('Default to segmented retrieval for focused and relevant content extraction, this is recommended for most cases.')}
>
<Switch bind:state={webConfig.BYPASS_WEB_SEARCH_EMBEDDING_AND_RETRIEVAL} />
</Tooltip>

View File

@@ -73,10 +73,15 @@
<div class="text-2xl font-medium capitalize">{channel.name}</div>
<div class=" text-gray-500">
This channel was created on {dayjs(channel.created_at / 1000000).format(
'MMMM D, YYYY'
)}. This is the very beginning of the {channel.name}
channel.
{
$i18n.t(
'This channel was created on {{createdAt}}. This is the very beginning of the {{channelName}} channel.',
{
createdAt: dayjs(channel.created_at / 1000000).format('MMMM D, YYYY'),
channelName: channel.name,
}
)
}
</div>
</div>
{:else}

View File

@@ -441,7 +441,7 @@
{#if ($config?.features?.enable_code_execution ?? true) && (lang.toLowerCase() === 'python' || lang.toLowerCase() === 'py' || (lang === '' && checkPythonCode(code)))}
{#if executing}
<div class="run-code-button bg-none border-none p-1 cursor-not-allowed">Running</div>
<div class="run-code-button bg-none border-none p-1 cursor-not-allowed">{$i18n.t('Running')}</div>
{:else if run}
<button
class="flex gap-1 items-center run-code-button bg-none border-none bg-gray-50 hover:bg-gray-100 dark:bg-gray-850 dark:hover:bg-gray-800 transition rounded-md px-1.5 py-0.5"

View File

@@ -87,8 +87,8 @@
<div>
<Tooltip
content={enableFullContent
? 'Inject the entire content as context for comprehensive processing, this is recommended for complex queries.'
: 'Default to segmented retrieval for focused and relevant content extraction, this is recommended for most cases.'}
? $i18n.t('Inject the entire content as context for comprehensive processing, this is recommended for complex queries.')
: $i18n.t('Default to segmented retrieval for focused and relevant content extraction, this is recommended for most cases.')}
>
<div class="flex items-center gap-1.5 text-xs">
{#if enableFullContent}

View File

@@ -113,8 +113,8 @@
}
}}
>
<option class=" text-gray-700" value="private" selected>Private</option>
<option class=" text-gray-700" value="public" selected>Public</option>
<option class=" text-gray-700" value="private" selected>{$i18n.t('Private')}</option>
<option class=" text-gray-700" value="public" selected>{$i18n.t('Public')}</option>
</select>
<div class=" text-xs text-gray-400 font-medium">