potools icon indicating copy to clipboard operation
potools copied to clipboard

why is po_update() separate from po_extract()?

Open maelle opened this issue 2 years ago • 2 comments

I might be missing something obvious but why is po_update() separate from po_extract() when we always have to run it after po_extract()?

maelle avatar Oct 31 '23 09:10 maelle

They're definitely closely related... One reason to keep them separate is we might prefer the translator to do po_update() themselves because of the fuzzy/deprecated messages. The package author may have no context on whether a fuzzy message still makes sense after the update.

@hadley I notice now po_update() is not mentioned in either of the new vignettes. Do you have notes handy on the design here / should we add an explanation to the vignette(s)?

MichaelChirico avatar Nov 02 '23 22:11 MichaelChirico

Hmmmm, good question. Maybe po_extract() could automatically run po_update() if there are existing translations?

hadley avatar Nov 03 '23 12:11 hadley

In our current workflow for {data.table}, we:

  1. Open a PR with the po_extract() output to update the .pot files (cf https://github.com/Rdatatable/data.table/pull/6773)
  2. Open a series of PRs with the po_update() output for each available translation; this PR is assigned to the corresponding translation team (a GitHub alias like @Rdatatable/chinese) (cf https://github.com/Rdatatable/data.table/pull/6774)

So I do think it makes sense to keep the two functions separate. This also maps onto the underlying gettext tools: po_extract() generates .pot files, matching xgettext; po_update() generates .po files, matching msgmerge (or msginit).

Closing for now, but may revisit as we iterate on what workflow is most productive.

MichaelChirico avatar Jan 30 '25 07:01 MichaelChirico