Skip to content

Commit

Permalink
Get correct message_source for deprecated messages
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelChirico committed Mar 26, 2024
1 parent a069329 commit c093943
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions R/get_po_messages.R
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,11 @@ get_po_messages <- function(po_file) {
msg_j = msg_j + 1L
}

# somewhat hacky approach -- strip the comment markers & recurse
# somewhat hacky approach -- strip the comment markers & recurse;
# retain the same file pattern to ensure 'message_source' is correct
writeLines(
gsub("^#~ ", "", grep("^#~ ", po_lines, value = TRUE)),
tmp <- tempfile()
tmp <- tempfile(pattern = basename(po_file))
)
on.exit(unlink(tmp))
deprecated = get_po_messages(tmp)
Expand Down

0 comments on commit c093943

Please sign in to comment.