fix: i18n after synced

This commit is contained in:
Louis 2025-06-26 22:17:47 +07:00
parent e1b6690763
commit 74fafac5fa
No known key found for this signature in database
GPG Key ID: 44FA9F4D33C37DE2
8 changed files with 467 additions and 388 deletions

View File

@ -10,17 +10,17 @@
* --help Show this help message * --help Show this help message
*/ */
const fs = require("fs") const fs = require('fs')
const path = require("path") const path = require('path')
// Parse command-line arguments // Parse command-line arguments
const args = process.argv.slice(2).reduce((acc, arg) => { const args = process.argv.slice(2).reduce((acc, arg) => {
if (arg === "--help") { if (arg === '--help') {
acc.help = true acc.help = true
} else if (arg.startsWith("--locale=")) { } else if (arg.startsWith('--locale=')) {
acc.locale = arg.split("=")[1] acc.locale = arg.split('=')[1]
} else if (arg.startsWith("--file=")) { } else if (arg.startsWith('--file=')) {
acc.file = arg.split("=")[1] acc.file = arg.split('=')[1]
} }
return acc return acc
}, {}) }, {})
@ -49,16 +49,16 @@ Output:
// Directories to traverse and their corresponding locales // Directories to traverse and their corresponding locales
const DIRS = { const DIRS = {
components: { components: {
path: path.join(__dirname, "../web-app/src/components"), path: path.join(__dirname, '../web-app/src/components'),
localesDir: path.join(__dirname, "../web-app/src/locales"), localesDir: path.join(__dirname, '../web-app/src/locales'),
}, },
containers: { containers: {
path: path.join(__dirname, "../web-app/src/containers"), path: path.join(__dirname, '../web-app/src/containers'),
localesDir: path.join(__dirname, "../web-app/src/locales"), localesDir: path.join(__dirname, '../web-app/src/locales'),
}, },
routes: { routes: {
path: path.join(__dirname, "../web-app/src/routes"), path: path.join(__dirname, '../web-app/src/routes'),
localesDir: path.join(__dirname, "../web-app/src/locales"), localesDir: path.join(__dirname, '../web-app/src/locales'),
}, },
} }
@ -78,9 +78,11 @@ function getLocaleDirs(localesDir) {
}) })
// Filter to a specific language if specified // Filter to a specific language if specified
return args.locale ? allLocales.filter((locale) => locale === args.locale) : allLocales return args.locale
? allLocales.filter((locale) => locale === args.locale)
: allLocales
} catch (error) { } catch (error) {
if (error.code === "ENOENT") { if (error.code === 'ENOENT') {
console.warn(`Warning: Locales directory not found: ${localesDir}`) console.warn(`Warning: Locales directory not found: ${localesDir}`)
return [] return []
} }
@ -90,7 +92,7 @@ function getLocaleDirs(localesDir) {
// Get the value from JSON by path // Get the value from JSON by path
function getValueByPath(obj, path) { function getValueByPath(obj, path) {
const parts = path.split(".") const parts = path.split('.')
let current = obj let current = obj
for (const part of parts) { for (const part of parts) {
@ -108,26 +110,43 @@ function checkKeyInLocales(key, localeDirs, localesDir) {
// Handle namespace:key format (e.g., "common:save" or "settings:general") // Handle namespace:key format (e.g., "common:save" or "settings:general")
let namespace, keyPath let namespace, keyPath
if (key.includes(":")) { if (key.includes(':')) {
[namespace, keyPath] = key.split(":", 2) ;[namespace, keyPath] = key.split(':', 2)
} else if (key.includes(".")) { } else if (key.includes('.')) {
// Handle namespace.key format // Handle namespace.key format
const parts = key.split(".") const parts = key.split('.')
// Check if the first part is a known namespace // Check if the first part is a known namespace
const knownNamespaces = ['common', 'settings', 'systemMonitor', 'chat', 'hub', 'providers', 'assistants', 'mcpServers', 'mcp-servers', 'toolApproval', 'tool-approval', 'updater', 'setup', 'logs', 'provider'] const knownNamespaces = [
'common',
'settings',
'systemMonitor',
'chat',
'hub',
'providers',
'assistants',
'mcpServers',
'mcp-servers',
'toolApproval',
'tool-approval',
'updater',
'setup',
'logs',
'provider',
'model-errors',
]
if (knownNamespaces.includes(parts[0])) { if (knownNamespaces.includes(parts[0])) {
namespace = parts[0] namespace = parts[0]
keyPath = parts.slice(1).join(".") keyPath = parts.slice(1).join('.')
} else { } else {
// Default to common namespace if no known namespace is found // Default to common namespace if no known namespace is found
namespace = "common" namespace = 'common'
keyPath = key keyPath = key
} }
} else { } else {
// No dots, default to common namespace // No dots, default to common namespace
namespace = "common" namespace = 'common'
keyPath = key keyPath = key
} }
@ -139,7 +158,8 @@ function checkKeyInLocales(key, localeDirs, localesDir) {
'mcpServers': 'mcp-servers', 'mcpServers': 'mcp-servers',
'mcp-servers': 'mcp-servers', 'mcp-servers': 'mcp-servers',
'toolApproval': 'tool-approval', 'toolApproval': 'tool-approval',
'tool-approval': 'tool-approval' 'tool-approval': 'tool-approval',
'model-errors': 'model-errors',
} }
const fileName = namespaceToFile[namespace] || namespace const fileName = namespaceToFile[namespace] || namespace
@ -152,7 +172,7 @@ function checkKeyInLocales(key, localeDirs, localesDir) {
} }
try { try {
const json = JSON.parse(fs.readFileSync(filePath, "utf8")) const json = JSON.parse(fs.readFileSync(filePath, 'utf8'))
// Jan's localization files have flat structure // Jan's localization files have flat structure
// e.g., common.json has { "save": "Save", "cancel": "Cancel" } // e.g., common.json has { "save": "Save", "cancel": "Cancel" }
@ -188,17 +208,22 @@ function findMissingI18nKeys() {
const stat = fs.statSync(filePath) const stat = fs.statSync(filePath)
// Exclude test files, __mocks__ directory, and node_modules // Exclude test files, __mocks__ directory, and node_modules
if (filePath.includes(".test.") || if (
filePath.includes("__mocks__") || filePath.includes('.test.') ||
filePath.includes("node_modules") || filePath.includes('__mocks__') ||
filePath.includes(".spec.")) { filePath.includes('node_modules') ||
filePath.includes('.spec.')
) {
continue continue
} }
if (stat.isDirectory()) { if (stat.isDirectory()) {
walk(filePath, baseDir, localeDirs, localesDir) // Recursively traverse subdirectories walk(filePath, baseDir, localeDirs, localesDir) // Recursively traverse subdirectories
} else if (stat.isFile() && [".ts", ".tsx", ".js", ".jsx"].includes(path.extname(filePath))) { } else if (
const content = fs.readFileSync(filePath, "utf8") stat.isFile() &&
['.ts', '.tsx', '.js', '.jsx'].includes(path.extname(filePath))
) {
const content = fs.readFileSync(filePath, 'utf8')
// Match all i18n keys // Match all i18n keys
for (const pattern of i18nPatterns) { for (const pattern of i18nPatterns) {
@ -207,19 +232,25 @@ function findMissingI18nKeys() {
const key = match[1] const key = match[1]
// Skip empty keys or keys that look like variables/invalid // Skip empty keys or keys that look like variables/invalid
if (!key || if (
key.includes("${") || !key ||
key.includes("{{") || key.includes('${') ||
key.startsWith("$") || key.includes('{{') ||
key.startsWith('$') ||
key.length < 2 || key.length < 2 ||
key === "." || key === '.' ||
key === "," || key === ',' ||
key === "-" || key === '-' ||
!/^[a-zA-Z]/.test(key)) { !/^[a-zA-Z]/.test(key)
) {
continue continue
} }
const missingLocales = checkKeyInLocales(key, localeDirs, localesDir) const missingLocales = checkKeyInLocales(
key,
localeDirs,
localesDir
)
if (missingLocales.length > 0) { if (missingLocales.length > 0) {
results.push({ results.push({
key, key,
@ -237,7 +268,11 @@ function findMissingI18nKeys() {
Object.entries(DIRS).forEach(([name, config]) => { Object.entries(DIRS).forEach(([name, config]) => {
const localeDirs = getLocaleDirs(config.localesDir) const localeDirs = getLocaleDirs(config.localesDir)
if (localeDirs.length > 0) { if (localeDirs.length > 0) {
console.log(`\nChecking ${name} directory with ${localeDirs.length} languages: ${localeDirs.join(", ")}`) console.log(
`\nChecking ${name} directory with ${
localeDirs.length
} languages: ${localeDirs.join(', ')}`
)
walk(config.path, config.path, localeDirs, config.localesDir) walk(config.path, config.path, localeDirs, config.localesDir)
} }
}) })
@ -250,11 +285,13 @@ function main() {
try { try {
if (args.locale) { if (args.locale) {
// Check if the specified locale exists in the locales directory // Check if the specified locale exists in the locales directory
const localesDir = path.join(__dirname, "../web-app/src/locales") const localesDir = path.join(__dirname, '../web-app/src/locales')
const localeDirs = getLocaleDirs(localesDir) const localeDirs = getLocaleDirs(localesDir)
if (!localeDirs.includes(args.locale)) { if (!localeDirs.includes(args.locale)) {
console.error(`Error: Language '${args.locale}' not found in ${localesDir}`) console.error(
`Error: Language '${args.locale}' not found in ${localesDir}`
)
process.exit(1) process.exit(1)
} }
} }
@ -262,11 +299,11 @@ function main() {
const missingKeys = findMissingI18nKeys() const missingKeys = findMissingI18nKeys()
if (missingKeys.length === 0) { if (missingKeys.length === 0) {
console.log("\n✅ All i18n keys are present!") console.log('\n✅ All i18n keys are present!')
return return
} }
console.log("\nMissing i18n keys:\n") console.log('\nMissing i18n keys:\n')
// Group by file for better readability // Group by file for better readability
const groupedByFile = {} const groupedByFile = {}
@ -281,23 +318,25 @@ function main() {
console.log(`📁 File: ${file}`) console.log(`📁 File: ${file}`)
keys.forEach(({ key, missingLocales }) => { keys.forEach(({ key, missingLocales }) => {
console.log(` 🔑 Key: ${key}`) console.log(` 🔑 Key: ${key}`)
console.log(" ❌ Missing in:") console.log(' ❌ Missing in:')
missingLocales.forEach((locale) => console.log(` - ${locale}`)) missingLocales.forEach((locale) => console.log(` - ${locale}`))
console.log("") console.log('')
}) })
console.log("-------------------") console.log('-------------------')
}) })
console.log("\n💡 To fix missing translations:") console.log('\n💡 To fix missing translations:')
console.log("1. Add the missing keys to the appropriate locale files") console.log('1. Add the missing keys to the appropriate locale files')
console.log("2. Use yq commands for efficient updates:") console.log('2. Use yq commands for efficient updates:')
console.log(" yq -i '.namespace.key = \"Translation\"' web-app/src/locales/<locale>/<file>.json") console.log(
console.log("3. Run this script again to verify all keys are present") ' yq -i \'.namespace.key = "Translation"\' web-app/src/locales/<locale>/<file>.json'
)
console.log('3. Run this script again to verify all keys are present')
// Exit code 1 indicates missing keys // Exit code 1 indicates missing keys
process.exit(1) process.exit(1)
} catch (error) { } catch (error) {
console.error("Error:", error.message) console.error('Error:', error.message)
console.error(error.stack) console.error(error.stack)
process.exit(1) process.exit(1)
} }

View File

@ -10,23 +10,20 @@
* --help Show this help message * --help Show this help message
*/ */
const fs = require("fs") const fs = require('fs')
const path = require("path") const path = require('path')
// Process command line arguments // Process command line arguments
const args = process.argv.slice(2).reduce( const args = process.argv.slice(2).reduce((acc, arg) => {
(acc, arg) => { if (arg === '--help') {
if (arg === "--help") {
acc.help = true acc.help = true
} else if (arg.startsWith("--locale=")) { } else if (arg.startsWith('--locale=')) {
acc.locale = arg.split("=")[1] acc.locale = arg.split('=')[1]
} else if (arg.startsWith("--file=")) { } else if (arg.startsWith('--file=')) {
acc.file = arg.split("=")[1] acc.file = arg.split('=')[1]
} }
return acc return acc
}, }, {})
{}
)
// Show help if requested // Show help if requested
if (args.help) { if (args.help) {
@ -51,16 +48,16 @@ Output:
} }
// Path to the locales directory // Path to the locales directory
const LOCALES_DIR = path.join(__dirname, "../web-app/src/locales") const LOCALES_DIR = path.join(__dirname, '../web-app/src/locales')
// Recursively find all keys in an object // Recursively find all keys in an object
function findKeys(obj, parentKey = "") { function findKeys(obj, parentKey = '') {
let keys = [] let keys = []
for (const [key, value] of Object.entries(obj)) { for (const [key, value] of Object.entries(obj)) {
const currentKey = parentKey ? `${parentKey}.${key}` : key const currentKey = parentKey ? `${parentKey}.${key}` : key
if (typeof value === "object" && value !== null) { if (typeof value === 'object' && value !== null) {
// If value is an object, recurse // If value is an object, recurse
keys = [...keys, ...findKeys(value, currentKey)] keys = [...keys, ...findKeys(value, currentKey)]
} else { } else {
@ -74,7 +71,7 @@ function findKeys(obj, parentKey = "") {
// Get value at a dotted path in an object // Get value at a dotted path in an object
function getValueAtPath(obj, path) { function getValueAtPath(obj, path) {
const parts = path.split(".") const parts = path.split('.')
let current = obj let current = obj
for (const part of parts) { for (const part of parts) {
@ -92,22 +89,28 @@ function checkTranslations() {
// Get all locale directories (or filter to the specified locale) // Get all locale directories (or filter to the specified locale)
const allLocales = fs.readdirSync(LOCALES_DIR).filter((item) => { const allLocales = fs.readdirSync(LOCALES_DIR).filter((item) => {
const stats = fs.statSync(path.join(LOCALES_DIR, item)) const stats = fs.statSync(path.join(LOCALES_DIR, item))
return stats.isDirectory() && item !== "en" // Exclude English as it's our source return stats.isDirectory() && item !== 'en' // Exclude English as it's our source
}) })
// Filter to the specified locale if provided // Filter to the specified locale if provided
const locales = args.locale ? allLocales.filter((locale) => locale === args.locale) : allLocales const locales = args.locale
? allLocales.filter((locale) => locale === args.locale)
: allLocales
if (args.locale && locales.length === 0) { if (args.locale && locales.length === 0) {
console.error(`Error: Locale '${args.locale}' not found in ${LOCALES_DIR}`) console.error(`Error: Locale '${args.locale}' not found in ${LOCALES_DIR}`)
process.exit(1) process.exit(1)
} }
console.log(`Checking ${locales.length} non-English locale(s): ${locales.join(", ")}`) console.log(
`Checking ${locales.length} non-English locale(s): ${locales.join(', ')}`
)
// Get all English JSON files // Get all English JSON files
const englishDir = path.join(LOCALES_DIR, "en") const englishDir = path.join(LOCALES_DIR, 'en')
let englishFiles = fs.readdirSync(englishDir).filter((file) => file.endsWith(".json") && !file.startsWith(".")) let englishFiles = fs
.readdirSync(englishDir)
.filter((file) => file.endsWith('.json') && !file.startsWith('.'))
// Filter to the specified file if provided // Filter to the specified file if provided
if (args.file) { if (args.file) {
@ -124,7 +127,7 @@ function checkTranslations() {
try { try {
englishFileContents = englishFiles.map((file) => ({ englishFileContents = englishFiles.map((file) => ({
name: file, name: file,
content: JSON.parse(fs.readFileSync(path.join(englishDir, file), "utf8")), content: JSON.parse(fs.readFileSync(path.join(englishDir, file), 'utf8')),
})) }))
} catch (e) { } catch (e) {
console.error(`Error: File '${englishDir}' is not a valid JSON file`) console.error(`Error: File '${englishDir}' is not a valid JSON file`)
@ -132,7 +135,9 @@ function checkTranslations() {
} }
console.log( console.log(
`Checking ${englishFileContents.length} translation file(s): ${englishFileContents.map((f) => f.name).join(", ")}` `Checking ${
englishFileContents.length
} translation file(s): ${englishFileContents.map((f) => f.name).join(', ')}`
) )
// Results object to store missing translations // Results object to store missing translations
@ -147,7 +152,7 @@ function checkTranslations() {
// Check if the file exists in the locale // Check if the file exists in the locale
if (!fs.existsSync(localeFilePath)) { if (!fs.existsSync(localeFilePath)) {
missingTranslations[locale][name] = { file: "File is missing entirely" } missingTranslations[locale][name] = { file: 'File is missing entirely' }
continue continue
} }
@ -155,9 +160,11 @@ function checkTranslations() {
let localeContent let localeContent
try { try {
localeContent = JSON.parse(fs.readFileSync(localeFilePath, "utf8")) localeContent = JSON.parse(fs.readFileSync(localeFilePath, 'utf8'))
} catch (e) { } catch (e) {
console.error(`Error: File '${localeFilePath}' is not a valid JSON file`) console.error(
`Error: File '${localeFilePath}' is not a valid JSON file`
)
process.exit(1) process.exit(1)
} }
@ -209,14 +216,16 @@ function outputResults(missingTranslations) {
continue continue
} }
console.log(` - ${fileName}: ${missingItems.length} missing translations`) console.log(
` - ${fileName}: ${missingItems.length} missing translations`
)
for (const { key, englishValue } of missingItems) { for (const { key, englishValue } of missingItems) {
console.log(` ${key}: "${englishValue}"`) console.log(` ${key}: "${englishValue}"`)
} }
} }
console.log("") console.log('')
} }
return hasMissingTranslations return hasMissingTranslations
@ -225,25 +234,31 @@ function outputResults(missingTranslations) {
// Main function to find missing translations // Main function to find missing translations
function findMissingTranslations() { function findMissingTranslations() {
try { try {
console.log("Starting translation check for Jan web-app...") console.log('Starting translation check for Jan web-app...')
const hasMissingTranslations = checkTranslations() const hasMissingTranslations = checkTranslations()
// Summary // Summary
if (!hasMissingTranslations) { if (!hasMissingTranslations) {
console.log("\n✅ All translations are complete!") console.log('\n✅ All translations are complete!')
} else { } else {
console.log("\n✏ To add missing translations:") console.log('\n✏ To add missing translations:')
console.log("1. Add the missing keys to the corresponding locale files") console.log('1. Add the missing keys to the corresponding locale files')
console.log("2. Translate the English values to the appropriate language") console.log('2. Translate the English values to the appropriate language')
console.log("3. You can use yq commands to update JSON files efficiently:") console.log(
console.log(" yq -i '.namespace.key = \"Translation\"' web-app/src/locales/<locale>/<file>.json") '3. You can use yq commands to update JSON files efficiently:'
console.log("4. Run this script again to verify all translations are complete") )
console.log(
' yq -i \'.namespace.key = "Translation"\' web-app/src/locales/<locale>/<file>.json'
)
console.log(
'4. Run this script again to verify all translations are complete'
)
// Exit with error code to fail CI checks // Exit with error code to fail CI checks
process.exit(1) process.exit(1)
} }
} catch (error) { } catch (error) {
console.error("Error:", error.message) console.error('Error:', error.message)
console.error(error.stack) console.error(error.stack)
process.exit(1) process.exit(1)
} }

View File

@ -1,4 +1,3 @@
import { t } from 'i18next'
import { import {
Dialog, Dialog,
DialogContent, DialogContent,
@ -10,8 +9,10 @@ import {
import { Button } from '@/components/ui/button' import { Button } from '@/components/ui/button'
import { useContextSizeApproval } from '@/hooks/useModelContextApproval' import { useContextSizeApproval } from '@/hooks/useModelContextApproval'
import { useTranslation } from '@/i18n'
export default function OutOfContextPromiseModal() { export default function OutOfContextPromiseModal() {
const { t } = useTranslation()
const { isModalOpen, modalProps, setModalOpen } = useContextSizeApproval() const { isModalOpen, modalProps, setModalOpen } = useContextSizeApproval()
if (!modalProps) { if (!modalProps) {
return null return null
@ -37,21 +38,13 @@ export default function OutOfContextPromiseModal() {
<Dialog open={isModalOpen} onOpenChange={handleDialogOpen}> <Dialog open={isModalOpen} onOpenChange={handleDialogOpen}>
<DialogContent> <DialogContent>
<DialogHeader> <DialogHeader>
<DialogTitle> <DialogTitle>{t('model-errors:title')}</DialogTitle>
{t('outOfContextError.title', 'Out of context error')}
</DialogTitle>
</DialogHeader> </DialogHeader>
<DialogDescription> <DialogDescription>
{t( {t('model-errors:description')}
'outOfContextError.description',
'This chat is reaching the AIs memory limit, like a whiteboard filling up. We can expand the memory window (called context size) so it remembers more, but it may use more of your computers memory. We can also truncate the input, which means it will forget some of the chat history to make room for new messages.'
)}
<br /> <br />
<br /> <br />
{t( {t('model-errors:increaseContextSizeDescription')}
'outOfContextError.increaseContextSizeDescription',
'Do you want to increase the context size?'
)}
</DialogDescription> </DialogDescription>
<DialogFooter className="flex gap-2"> <DialogFooter className="flex gap-2">
<Button <Button
@ -61,7 +54,7 @@ export default function OutOfContextPromiseModal() {
handleContextShift() handleContextShift()
}} }}
> >
{t('outOfContextError.truncateInput', 'Truncate Input')} {t('model-errors:truncateInput')}
</Button> </Button>
<Button <Button
asChild asChild
@ -70,10 +63,7 @@ export default function OutOfContextPromiseModal() {
}} }}
> >
<span className="text-main-view-fg/70"> <span className="text-main-view-fg/70">
{t( {t('model-errors:increaseContextSize')}
'outOfContextError.increaseContextSize',
'Increase Context Size'
)}
</span> </span>
</Button> </Button>
</DialogFooter> </DialogFooter>

View File

@ -0,0 +1,7 @@
{
"title": "Out of context error",
"description": "This chat is reaching the AIs memory limit, like a whiteboard filling up. We can expand the memory window (called context size) so it remembers more, but it may use more of your computers memory. We can also truncate the input, which means it will forget some of the chat history to make room for new messages.",
"increaseContextSizeDescription": "Do you want to increase the context size?",
"truncateInput": "Truncate Input",
"increaseContextSize": "Increase Context Size"
}

View File

@ -0,0 +1,7 @@
{
"title": "Kesalahan kehabisan konteks",
"description": "Obrolan ini hampir mencapai batas memori AI, seperti papan tulis yang mulai penuh. Kita bisa memperluas jendela memori (disebut ukuran konteks) agar AI dapat mengingat lebih banyak, tetapi ini mungkin akan menggunakan lebih banyak memori komputer Anda. Kita juga bisa memotong input, artinya sebagian riwayat obrolan akan dilupakan untuk memberi ruang pada pesan baru.",
"increaseContextSizeDescription": "Apakah Anda ingin memperbesar ukuran konteks?",
"truncateInput": "Potong Input",
"increaseContextSize": "Perbesar Ukuran Konteks"
}

View File

@ -0,0 +1,7 @@
{
"title": "Lỗi vượt quá ngữ cảnh",
"description": "Cuộc trò chuyện này đang đạt đến giới hạn bộ nhớ của AI, giống như một bảng trắng sắp đầy. Chúng ta có thể mở rộng cửa sổ bộ nhớ (gọi là kích thước ngữ cảnh) để AI nhớ được nhiều hơn, nhưng điều này có thể sử dụng nhiều bộ nhớ máy tính của bạn hơn. Chúng ta cũng có thể cắt bớt đầu vào, nghĩa là AI sẽ quên một phần lịch sử trò chuyện để dành chỗ cho các tin nhắn mới.",
"increaseContextSizeDescription": "Bạn có muốn tăng kích thước ngữ cảnh không?",
"truncateInput": "Cắt bớt đầu vào",
"increaseContextSize": "Tăng kích thước ngữ cảnh"
}

View File

@ -0,0 +1,7 @@
{
"title": "超出上下文错误",
"description": "此对话已接近 AI 的记忆上限,就像白板快被填满一样。我们可以扩展记忆窗口(称为上下文大小),这样它能记住更多内容,但可能会占用你电脑更多内存。我们也可以截断输入,这意味着它会遗忘部分聊天记录,为新消息腾出空间。",
"increaseContextSizeDescription": "你想要增加上下文大小吗?",
"truncateInput": "截断输入",
"increaseContextSize": "增加上下文大小"
}

View File

@ -0,0 +1,7 @@
{
"title": "超出上下文錯誤",
"description": "此對話已接近 AI 的記憶上限,就像白板快被填滿一樣。我們可以擴大記憶視窗(稱為上下文大小),讓它能記住更多內容,但這可能會佔用你電腦更多記憶體。我們也可以截斷輸入,這表示它會忘記部分對話歷史,以便為新訊息騰出空間。",
"increaseContextSizeDescription": "你想要增加上下文大小嗎?",
"truncateInput": "截斷輸入",
"increaseContextSize": "增加上下文大小"
}