Skip to content

Commit

Permalink
fix: lineNumbers false was removing the entire origin
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergio Moreno committed May 11, 2021
1 parent 26e9df5 commit 253047e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/cli/src/api/formats/lingui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const removeOrigins = (R.map(
const removeLineNumbers = (R.map(
(message: ExtractedMessageType) => {
if (message.origin) {
message.origin.map(originValue => originValue.pop())
message.origin.map(originValue => originValue.slice(0, -1))
}
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

0 comments on commit 253047e

Please sign in to comment.