Skip to content

Commit

Permalink
fix(cli): catalogsMergePath doesn't merge catalogs (#1341)
Browse files Browse the repository at this point in the history
* fix(cli): catalogsMergePath doesn't merge catalogs

* Add namespace and compilerBabelOptions to writeCompiled() call
  • Loading branch information
Martin005 authored Jan 17, 2023
1 parent 9248f9c commit 12ad0df
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion packages/cli/src/lingui-compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as plurals from "make-plural"

import { getConfig, LinguiConfig } from "@lingui/conf"

import { getCatalogs } from "./api/catalog"
import { getCatalogForMerge, getCatalogs } from "./api/catalog"
import { createCompiledCatalog } from "./api/compile"
import { helpRun } from "./api/help"
import { getFormat } from "./api"
Expand Down Expand Up @@ -113,6 +113,23 @@ function command(config: LinguiConfig, options) {
console.error(chalk.green(`${locale}${compiledPath}`))
}
})

if (doMerge) {
const compileCatalog = getCatalogForMerge(config)
const namespace = options.namespace || config.compileNamespace
const compiledCatalog = createCompiledCatalog(locale, mergedCatalogs, {
strict: false,
namespace: namespace,
pseudoLocale: config.pseudoLocale,
compilerBabelOptions: config.compilerBabelOptions
})
const compiledPath = compileCatalog.writeCompiled(
locale,
compiledCatalog,
namespace
)
options.verbose && console.log(chalk.green(`${locale}${compiledPath}`))
}
})
return true
}
Expand Down

1 comment on commit 12ad0df

@vercel
Copy link

@vercel vercel bot commented on 12ad0df Jan 17, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

js-lingui – ./

js-lingui.vercel.app
js-lingui-lingui.vercel.app
js-lingui-git-main-lingui.vercel.app
lingui.js.org

Please sign in to comment.