@@ -23,7 +23,10 @@ const getConf = async () => {
2323 const folderName = await config . getValueOrThrow ( 'inputLanguageFolderName' , { saveOnInput : true } ) ;
2424 const lang = ( await config . getValueOrThrow ( 'inputLanguage' , { saveOnInput : true } ) ) as LangPair [ 'lang' ] ;
2525 const context = await config . getValue ( 'context' , { saveOnInput : true } ) ;
26- return { apiKey, localeDir, folderName, lang, context } ;
26+ const formality = await config . getValue ( 'formality' , { saveOnInput : true } ) ;
27+ const excludePhrases = await config . getValue ( 'excludePhrases' , { saveOnInput : true } ) ;
28+ const excludeRegex = await config . getValue ( 'excludeRegex' , { saveOnInput : true } ) ;
29+ return { apiKey, localeDir, folderName, lang, context, formality, excludePhrases, excludeRegex } ;
2730} ;
2831
2932program
@@ -49,26 +52,26 @@ program
4952 . description ( 'translate i18 json files' )
5053 . option ( '-w --watch' , 'watch mode' , false )
5154 . action ( async ( options ) => {
52- const { apiKey, folderName, lang, localeDir, context } = await getConf ( ) ;
55+ const { apiKey, folderName, lang, localeDir, ... backendProps } = await getConf ( ) ;
5356 console . log ( options ) ;
5457 if ( options . watch ) {
5558 return watch ( {
59+ ...backendProps ,
5660 apiKey,
5761 folderName,
5862 lang,
5963 localeDir,
60- context,
6164 } ) ;
6265 }
6366 const result = await translateLocaleFolder ( {
67+ ...backendProps ,
6468 srcLang : {
6569 folderName,
6670 lang,
6771 } ,
6872 apiKey,
6973 cwd : process . cwd ( ) ,
7074 localeDir,
71- context,
7275 logLevel : LogLevels . debug ,
7376 } ) ;
7477 console . log (
0 commit comments