Skip to content

Commit

Permalink
fix: set translation to default only in minimal format
Browse files Browse the repository at this point in the history
  • Loading branch information
tricoder42 committed Jun 24, 2018
1 parent f95f838 commit f33ad9c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/cli/src/api/formats/lingui.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default (config: LinguiConfig): CatalogFormat => ({
const newMessages = R.mapObjIndexed(
(message, key) => ({
translation:
message.defaults || (config.sourceLocale === locale ? key : ""),
config.sourceLocale === locale && !message.defaults ? key : "",
...message
}),
R.pick(newKeys, nextCatalog)
Expand Down
5 changes: 4 additions & 1 deletion packages/cli/src/api/formats/minimal.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ function deserialize(catalog) {
}

function serialize(catalog) {
return R.map(message => message.translation || "", catalog)
return R.map(
message => message.translation || message.defaults || "",
catalog
)
}

export default (config: LinguiConfig): CatalogFormat => {
Expand Down

0 comments on commit f33ad9c

Please sign in to comment.