Skip to content

Commit

Permalink
Merge pull request #32 from r-devel/checkpofiles
Browse files Browse the repository at this point in the history
Add a step to run `checkPoFiles()`
  • Loading branch information
MichaelChirico authored Mar 19, 2024
2 parents ccf7631 + e1cf5b4 commit 7ef30b9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions web/Weblate-server.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ The basic idea is to compare the Weblate repo (which copies the R subversion rep
git reset --hard weblate/master # force-reset to match state on Weblate (usual caution with --hard applies)
```

1. Revert unwanted changes to reduce noise, e.g. something like:
1. Make needed manual changes to reduce noise and ensure quality, e.g. something like:

```r
library(data.table)
Expand All @@ -174,13 +174,19 @@ The basic idea is to compare the Weblate repo (which copies the R subversion rep
}
set_branch <- \(branch) system2('git', c('checkout', branch))
# SUMMARIZE the changed translations, and delete empty .po files
set_branch('weblate/master')
po_report <- tools::checkPoFiles("")
if (length(po_report)) {
print(po_report)
stop("Fix above issues in .po files identified by tools::checkPoFiles() to proceed.")
}
weblate_summary <- po_counts(po_files())
set_branch('svn/master')
svn_summary <- po_counts(po_files())
set_branch('master')
# SUMMARIZE the changed translations, and delete empty .po files
po_summary <- merge(weblate_summary, svn_summary, by = "filename", all = TRUE, suffixes = c("_weblate", "_svn"))
po_summary[, package := basename(dirname(dirname(filename)))]
# Drop empty & record files
Expand Down

0 comments on commit 7ef30b9

Please sign in to comment.