Skip to content

Commit

Permalink
fix: lineNumbers false was removing the entire origin (#1060)
Browse files Browse the repository at this point in the history
  • Loading branch information
semoal committed May 18, 2021
1 parent 2b8d70b commit 2d25f2c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 4 additions & 1 deletion packages/cli/src/api/formats/lingui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ const removeOrigins = (R.map(
const removeLineNumbers = (R.map(
(message: ExtractedMessageType) => {
if (message.origin) {
message.origin.map(originValue => originValue.pop())
message.origin.map(originValue => {
originValue.pop()
return originValue
})
}
return message
}
Expand Down
5 changes: 1 addition & 4 deletions packages/cli/src/api/formats/po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@ const serialize = (items: CatalogType, options) =>
item.extractedComments = message.extractedComments || []
if (options.origins !== false) {
if (message.origin && options.lineNumbers === false) {
item.references = message.origin.map(msg => {
msg.pop()
return msg
}).map(joinOrigin)
item.references = message.origin.map(msg => msg.slice(0, -1)).map(joinOrigin)
} else {
item.references = message.origin ? message.origin.map(joinOrigin) : []
}
Expand Down

1 comment on commit 2d25f2c

@vercel
Copy link

@vercel vercel bot commented on 2d25f2c May 18, 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.