2023-07-15 19:22:16 +08:00
const { defineConfig } = require ( '@lobehub/i18n-cli' ) ;
2026-04-10 10:44:09 +08:00
const fs = require ( 'node:fs' ) ;
const path = require ( 'node:path' ) ;
2023-07-15 18:22:47 +08:00
2023-07-15 19:22:16 +08:00
module . exports = defineConfig ( {
2025-12-26 00:09:21 +08:00
entry : 'locales/en-US' ,
entryLocale : 'en-US' ,
2023-07-18 09:14:13 +08:00
output : 'locales' ,
2023-12-16 14:56:06 +08:00
outputLocales : [
2024-01-15 18:27:24 +02:00
'ar' ,
2024-03-28 19:55:45 +02:00
'bg-BG' ,
2025-12-26 00:09:21 +08:00
'zh-CN' ,
2023-12-22 14:59:19 +08:00
'zh-TW' ,
'ru-RU' ,
'ja-JP' ,
'ko-KR' ,
'fr-FR' ,
'tr-TR' ,
'es-ES' ,
'pt-BR' ,
'de-DE' ,
2023-12-22 16:28:22 +08:00
'it-IT' ,
'nl-NL' ,
'pl-PL' ,
2024-01-03 01:00:57 -08:00
'vi-VN' ,
2024-10-30 23:34:17 +08:00
'fa-IR' ,
2023-12-16 14:56:06 +08:00
] ,
2023-07-15 18:22:47 +08:00
temperature : 0 ,
2025-06-10 13:38:53 +08:00
saveImmediately : true ,
2026-04-29 13:23:26 +07:00
modelName : 'gpt-4o' ,
2023-12-13 17:42:26 +08:00
experimental : {
jsonMode : true ,
} ,
markdown : {
2025-12-19 23:13:22 +08:00
reference :
2026-01-26 15:28:33 +08:00
'You need to maintain the component format of the mdx file; the output text does not need to be wrapped in any code block syntax on the outermost layer.\n' +
2026-04-10 10:44:09 +08:00
fs . readFileSync ( path . join ( _ _dirname , 'docs/glossary.md' ) , 'utf8' ) ,
2026-01-26 15:28:33 +08:00
entry : [ './README.md' , './docs/**/*.md' , './docs/**/*.mdx' ] ,
entryLocale : 'en-US' ,
outputLocales : [ 'zh-CN' ] ,
2024-11-26 14:48:06 +08:00
includeMatter : true ,
2026-01-26 15:28:33 +08:00
exclude : [ './README.zh-CN.md' , './docs/**/*.zh-CN.md' , './docs/**/*.zh-CN.mdx' ] ,
2024-04-11 00:28:48 +08:00
outputExtensions : ( locale , { filePath } ) => {
if ( filePath . includes ( '.mdx' ) ) {
if ( locale === 'en-US' ) return '.mdx' ;
return ` . ${ locale } .mdx ` ;
} else {
if ( locale === 'en-US' ) return '.md' ;
return ` . ${ locale } .md ` ;
}
2023-12-13 17:42:26 +08:00
} ,
} ,
2023-07-15 19:22:16 +08:00
} ) ;