forked from AceDataCloud/Nexior
-
Notifications
You must be signed in to change notification settings - Fork 0
/
transmart.config.js
39 lines (39 loc) · 1.57 KB
/
transmart.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
module.exports = {
baseLocale: 'zh-CN',
locales: ['en', 'de', 'pt', 'es', 'fr', 'zh-TW', 'it', 'ko', 'ja', 'ru', 'pl', 'fi', 'sv', 'el', 'uk', 'ar', 'sr'],
cacheEnabled: true,
localePath: 'src/i18n',
openAIApiKey: process.env.VITE_OPENAI_API_KEY,
openAIApiModel: 'gpt-4o-mini',
openAIApiUrl: 'https://api.acedata.cloud',
openAIApiUrlPath: '/openai/chat/completions',
modelContextLimit: 3000,
additionalReqBodyParams: {
// response_format: {
// type: 'json_object'
// }
},
systemPromptTemplate: ({ languageName, context }) => {
return (
`Translate the i18n JSON file to ${languageName} according to the BCP 47 standard` +
(context ? `\nHere are some contexts to help with better translation. ---${context}---` : '') +
`\n Keep the keys the same as the original file and make sure the output remains a valid i18n JSON file.` +
`For every key, there will be sub-key named as 'message' and 'description', 'message' is the real value, 'description' is comment for the value. You must translate according to the description.` +
`For example,` +
`'''{
"relax": {
"message": "Relax",
"description": "Text in button, which allows user to set the 'slow speed' mode to relax to generate the image, must translate to 'Slow speed'"
}
}'''` +
` should be translated to ` +
`'''{
"relax": {
"message": "慢速",
"description": "按钮文本,允许用户设置为放松模式生成图像,必须翻译为'慢速'"
}
}'''
`
);
}
};