File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -478,10 +478,7 @@ export const translateCommand = new Command('translate')
478478
479479 targetFrontmatter = matter ( targetContent ) . data as I18nFrontmatter
480480
481- if (
482- sourceFrontmatter . i18n ?. disableAutoTranslation ||
483- ( ! force && targetFrontmatter . sourceSHA === sourceSHA )
484- ) {
481+ if ( ! force && targetFrontmatter . sourceSHA === sourceSHA ) {
485482 allSourceFilePaths . delete ( sourceFilePath )
486483 return
487484 }
@@ -577,13 +574,18 @@ export const translateCommand = new Command('translate')
577574 }
578575 }
579576
580- if ( typeof newFrontmatter . title !== 'string' ) {
581- delete newFrontmatter . title
582- }
577+ const finalFrontmatter =
578+ typeof newFrontmatter . title === 'string'
579+ ? newFrontmatter
580+ : ( ( ) => {
581+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
582+ const { title : _ , ...rest } = newFrontmatter
583+ return rest
584+ } ) ( )
583585
584586 targetContent = matter . stringify (
585587 content . startsWith ( '\n' ) ? content : '\n' + content ,
586- newFrontmatter ,
588+ finalFrontmatter ,
587589 )
588590
589591 await fs . mkdir ( targetBase , { recursive : true } )
You can’t perform that action at this time.
0 commit comments