Skip to content

Commit

Permalink
fix: obsolete flag disable when using extract [files] (#967)
Browse files Browse the repository at this point in the history
  • Loading branch information
jack1913 committed Feb 2, 2021
1 parent 14f24f2 commit 0ea63e9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/cli/src/api/catalog.ts
Expand Up @@ -62,6 +62,7 @@ type CollectOptions = MakeOptions | MakeTemplateOptions

export type MergeOptions = {
overwrite: boolean
files?: string[]
}

export type GetTranslationsOptions = {
Expand Down Expand Up @@ -102,6 +103,7 @@ export class Catalog {

const catalogs = this.merge(prevCatalogs, nextCatalog, {
overwrite: options.overwrite,
files: options.files,
})

// Map over all locales and post-process each catalog
Expand Down Expand Up @@ -231,10 +233,11 @@ export class Catalog {
})

// Mark all remaining translations as obsolete
// Only if *options.files* is not provided
const obsoleteMessages = obsoleteKeys.map((key) => ({
[key]: {
...prevCatalog[key],
obsolete: true,
obsolete: options.files ? false : true,
},
}))

Expand Down

1 comment on commit 0ea63e9

@vercel
Copy link

@vercel vercel bot commented on 0ea63e9 Feb 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.