Skip to content

Commit

Permalink
Built site for gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Quarto GHA Workflow Runner committed Sep 9, 2024
1 parent 590716f commit dab8498
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .nojekyll
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ee795c43
5c390c59
7 changes: 4 additions & 3 deletions Weblate-server.html
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,10 @@ <h3 class="anchored" data-anchor-id="to-submit-a-patch-file-on-the-translations-
<ol type="1">
<li><p>Make sure the Weblate repo is fully up-to-date. Check status at https://translate.rx.studio/projects/r-project/#repository – be sure there are no <code>Update</code> or <code>Commit</code> actions needed.</p></li>
<li><p>Get the two repos cloned on any machine. If this is your first time generating a patch on this machine:</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode sh code-with-copy"><code class="sourceCode bash"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="fu">git</span> clone <span class="at">-o</span> weblate https://translate.rx.studio/git/r-project/base-r-gui/ <span class="co"># remote #1: Weblate source</span></span>
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a><span class="fu">git</span> remote add svn git@github.com:r-devel/r-svn.git <span class="co"># remote #2: SVN source</span></span>
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a><span class="fu">git</span> fetch svn main <span class="co"># retrieve the latest from SVN</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="sourceCode" id="cb6"><pre class="sourceCode sh code-with-copy"><code class="sourceCode bash"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="fu">mkdir</span> weblate-diff <span class="kw">&amp;&amp;</span> <span class="bu">cd</span> weblate-diff</span>
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a><span class="fu">git</span> clone <span class="at">-o</span> weblate https://translate.rx.studio/git/r-project/base-r-gui/ . <span class="co"># remote #1: Weblate source</span></span>
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a><span class="fu">git</span> remote add svn git@github.com:r-devel/r-svn.git <span class="co"># remote #2: SVN source</span></span>
<span id="cb6-4"><a href="#cb6-4" aria-hidden="true" tabindex="-1"></a><span class="fu">git</span> fetch svn main <span class="co"># retrieve the latest from SVN</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<p>If you’ve got the repo set up locally already, update:</p>
<div class="sourceCode" id="cb7"><pre class="sourceCode sh code-with-copy"><code class="sourceCode bash"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="fu">git</span> fetch svn main</span>
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a><span class="fu">git</span> fetch weblate master</span>
Expand Down
2 changes: 1 addition & 1 deletion search.json
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@
"href": "Weblate-server.html#quarterly-patch-for-r-core",
"title": "Weblate server",
"section": "Quarterly patch for R Core",
"text": "Quarterly patch for R Core\nNB: Weblate links below assume you’re logged in there, otherwise you’ll be redirected to the home page\n\nTo generate a report on the translation updates in a time period:\n\nVisit https://translate.rx.studio/projects/r-project/#reports\nSelect time period and generate report in rST format\nConvert ~markdown to HTML and share in the R Contributors slack group’s #core-translation channel\n\n\n\nTo submit a patch file on the translations found in Weblate but not in the trunk of the main R subversion repo:\nThe basic idea is to compare the Weblate repo (which copies the R subversion repo, but also adds translations provided via Weblate) to the “official” R sources; any difference in .po files should be submitted as a patch.\n\nMake sure the Weblate repo is fully up-to-date. Check status at https://translate.rx.studio/projects/r-project/#repository – be sure there are no Update or Commit actions needed.\nGet the two repos cloned on any machine. If this is your first time generating a patch on this machine:\ngit clone -o weblate https://translate.rx.studio/git/r-project/base-r-gui/ # remote #1: Weblate source\ngit remote add svn git@github.com:r-devel/r-svn.git # remote #2: SVN source\ngit fetch svn main # retrieve the latest from SVN\nIf you’ve got the repo set up locally already, update:\ngit fetch svn main\ngit fetch weblate master\ngit reset --hard weblate/master # force-reset to match state on Weblate (usual caution with --hard applies)\nMake needed manual changes to reduce noise and ensure quality, e.g. something like:\nlibrary(data.table)\nlibrary(crayon)\nlibrary(logger)\n\npo_files &lt;- \\() list.files(pattern = '\\\\.po$', recursive = TRUE)\n# pocount is available from e.g. 'apt install translate-toolkit'\npo_counts &lt;- function(f) {\n x = fread(cmd = paste('pocount --csv', paste(f, collapse = \" \")), sep = ',', fill = TRUE)\n setnames(x, c(\"Filename\", \"Translated Messages\"), c(\"filename\", \"n_translated\"))\n x\n}\nset_branch &lt;- \\(branch) system2('git', c('checkout', branch))\n\nset_branch('weblate/master')\npo_report &lt;- tools::checkPoFiles(\"\")\nif (length(po_report)) {\n print(po_report)\n stop(\"Fix above issues in .po files identified by tools::checkPoFiles() to proceed.\")\n}\n\nweblate_summary &lt;- po_counts(po_files())\nset_branch('svn/main')\nsvn_summary &lt;- po_counts(po_files())\nset_branch('master')\n\n# SUMMARIZE the changed translations, and delete empty .po files\npo_summary &lt;- merge(weblate_summary, svn_summary, by = \"filename\", all = TRUE, suffixes = c(\"_weblate\", \"_svn\"))\npo_summary[, package := basename(dirname(dirname(filename)))]\n# Drop empty & record files\npo_summary[n_translated_weblate == 0 & is.na(n_translated_svn), { # NB: keep empty files if they're already in SVN, hence is.na() check\n log_info('Dropping {.N} empty files:')\n .SD[, by = package, {\n log_level(INFO, 'From package {blue(.BY$package)}:')\n log_level(INFO, ' {toString(green(basename(filename)))}', .topenv = .SD) # NB: Need .SD since data.table doesn't pick up the variable from the string\n }]\n unlink(filename)\n NULL\n}]\npo_summary &lt;- po_summary[n_translated_weblate &gt; 0]\n\n# (optional) Summarize the update for the rest of the files\nsetnafill(po_summary, fill = 0L, cols = which(sapply(po_summary, is.numeric)))\npo_summary[, n_newly_translated := n_translated_weblate - n_translated_svn]\npo_summary[n_newly_translated &gt; 0, {\n log_info('New translations in {.N} files')\n .SD[, by = package, {\n log_level(INFO, 'From package {blue(.BY$package)}:')\n log_level(INFO, ' {sprintf(\"%s [+%s]\", green(format(basename(filename))), red(format(n_newly_translated)))}', .topenv = .SD)\n }]\n NULL\n}]\n\n# REPLACE 'Report-Msgid-Bugs-To' metadata field pointing to #core-translation-po-bugs\nsystem2(\"sed\", c(\"-i\", \"'s/sourcestringbugs.o40l9j@zapiermail.com/bugs.r-project.org/'\", po_summary$filename))\n\n# CHECK msgfmt works -- 'make update*' commands run by R-core check this as well\ntmp &lt;- tempfile()\n## NB: lapply() over for() to show all failures at once\nres &lt;- suppressWarnings(lapply(\n po_summary$filename,\n \\(po_file) system2(\"msgfmt\", c(\"-c\", \"--statistics\", \"-o\", tmp, po_file), stdout=TRUE, stderr=TRUE)\n))\nfailed &lt;- which(!sapply(res, \\(r) is.null(attr(r, \"status\"))))\nif (length(failed)) {\n cat(\"'msgfmt' failed for some .po files:\\n\")\n for (idx in failed) {\n cat(sprintf(\" %s:\\n\", red(po_summary$filename[idx])))\n writeLines(paste0(\" \", res[[idx]]))\n }\n}\nGenerate a patch file from the diff, going back to the most recent commit with translations merged, e.g.\n# NB: _not_ 'git diff weblate/master svn/main' since we've just deleted the empty .po files locally\ngit diff svn/main --no-prefix -- \"*.po\"\nShare the patch file on the R Contributors Slack group’s #core-translation channel and kindly ping @MichaelLawrence for his assistance on getting the patch file applied on the trunk of R dev to get it merged. We should do this ~once per quarter.",
"text": "Quarterly patch for R Core\nNB: Weblate links below assume you’re logged in there, otherwise you’ll be redirected to the home page\n\nTo generate a report on the translation updates in a time period:\n\nVisit https://translate.rx.studio/projects/r-project/#reports\nSelect time period and generate report in rST format\nConvert ~markdown to HTML and share in the R Contributors slack group’s #core-translation channel\n\n\n\nTo submit a patch file on the translations found in Weblate but not in the trunk of the main R subversion repo:\nThe basic idea is to compare the Weblate repo (which copies the R subversion repo, but also adds translations provided via Weblate) to the “official” R sources; any difference in .po files should be submitted as a patch.\n\nMake sure the Weblate repo is fully up-to-date. Check status at https://translate.rx.studio/projects/r-project/#repository – be sure there are no Update or Commit actions needed.\nGet the two repos cloned on any machine. If this is your first time generating a patch on this machine:\nmkdir weblate-diff && cd weblate-diff\ngit clone -o weblate https://translate.rx.studio/git/r-project/base-r-gui/ . # remote #1: Weblate source\ngit remote add svn git@github.com:r-devel/r-svn.git # remote #2: SVN source\ngit fetch svn main # retrieve the latest from SVN\nIf you’ve got the repo set up locally already, update:\ngit fetch svn main\ngit fetch weblate master\ngit reset --hard weblate/master # force-reset to match state on Weblate (usual caution with --hard applies)\nMake needed manual changes to reduce noise and ensure quality, e.g. something like:\nlibrary(data.table)\nlibrary(crayon)\nlibrary(logger)\n\npo_files &lt;- \\() list.files(pattern = '\\\\.po$', recursive = TRUE)\n# pocount is available from e.g. 'apt install translate-toolkit'\npo_counts &lt;- function(f) {\n x = fread(cmd = paste('pocount --csv', paste(f, collapse = \" \")), sep = ',', fill = TRUE)\n setnames(x, c(\"Filename\", \"Translated Messages\"), c(\"filename\", \"n_translated\"))\n x\n}\nset_branch &lt;- \\(branch) system2('git', c('checkout', branch))\n\nset_branch('weblate/master')\npo_report &lt;- tools::checkPoFiles(\"\")\nif (length(po_report)) {\n print(po_report)\n stop(\"Fix above issues in .po files identified by tools::checkPoFiles() to proceed.\")\n}\n\nweblate_summary &lt;- po_counts(po_files())\nset_branch('svn/main')\nsvn_summary &lt;- po_counts(po_files())\nset_branch('master')\n\n# SUMMARIZE the changed translations, and delete empty .po files\npo_summary &lt;- merge(weblate_summary, svn_summary, by = \"filename\", all = TRUE, suffixes = c(\"_weblate\", \"_svn\"))\npo_summary[, package := basename(dirname(dirname(filename)))]\n# Drop empty & record files\npo_summary[n_translated_weblate == 0 & is.na(n_translated_svn), { # NB: keep empty files if they're already in SVN, hence is.na() check\n log_info('Dropping {.N} empty files:')\n .SD[, by = package, {\n log_level(INFO, 'From package {blue(.BY$package)}:')\n log_level(INFO, ' {toString(green(basename(filename)))}', .topenv = .SD) # NB: Need .SD since data.table doesn't pick up the variable from the string\n }]\n unlink(filename)\n NULL\n}]\npo_summary &lt;- po_summary[n_translated_weblate &gt; 0]\n\n# (optional) Summarize the update for the rest of the files\nsetnafill(po_summary, fill = 0L, cols = which(sapply(po_summary, is.numeric)))\npo_summary[, n_newly_translated := n_translated_weblate - n_translated_svn]\npo_summary[n_newly_translated &gt; 0, {\n log_info('New translations in {.N} files')\n .SD[, by = package, {\n log_level(INFO, 'From package {blue(.BY$package)}:')\n log_level(INFO, ' {sprintf(\"%s [+%s]\", green(format(basename(filename))), red(format(n_newly_translated)))}', .topenv = .SD)\n }]\n NULL\n}]\n\n# REPLACE 'Report-Msgid-Bugs-To' metadata field pointing to #core-translation-po-bugs\nsystem2(\"sed\", c(\"-i\", \"'s/sourcestringbugs.o40l9j@zapiermail.com/bugs.r-project.org/'\", po_summary$filename))\n\n# CHECK msgfmt works -- 'make update*' commands run by R-core check this as well\ntmp &lt;- tempfile()\n## NB: lapply() over for() to show all failures at once\nres &lt;- suppressWarnings(lapply(\n po_summary$filename,\n \\(po_file) system2(\"msgfmt\", c(\"-c\", \"--statistics\", \"-o\", tmp, po_file), stdout=TRUE, stderr=TRUE)\n))\nfailed &lt;- which(!sapply(res, \\(r) is.null(attr(r, \"status\"))))\nif (length(failed)) {\n cat(\"'msgfmt' failed for some .po files:\\n\")\n for (idx in failed) {\n cat(sprintf(\" %s:\\n\", red(po_summary$filename[idx])))\n writeLines(paste0(\" \", res[[idx]]))\n }\n}\nGenerate a patch file from the diff, going back to the most recent commit with translations merged, e.g.\n# NB: _not_ 'git diff weblate/master svn/main' since we've just deleted the empty .po files locally\ngit diff svn/main --no-prefix -- \"*.po\"\nShare the patch file on the R Contributors Slack group’s #core-translation channel and kindly ping @MichaelLawrence for his assistance on getting the patch file applied on the trunk of R dev to get it merged. We should do this ~once per quarter.",
"crumbs": [
"Home",
"Weblate server"
Expand Down
26 changes: 13 additions & 13 deletions sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,54 +2,54 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://contributor.r-project.org/translations/index.html</loc>
<lastmod>2024-09-09T00:08:03.730Z</lastmod>
<lastmod>2024-09-09T16:21:56.220Z</lastmod>
</url>
<url>
<loc>https://contributor.r-project.org/translations/Weblate-FAQ.html</loc>
<lastmod>2024-09-09T00:08:03.730Z</lastmod>
<lastmod>2024-09-09T16:21:56.220Z</lastmod>
</url>
<url>
<loc>https://contributor.r-project.org/translations/Conventions_for_Languages/Spanish-specific-translations.html</loc>
<lastmod>2024-09-09T00:08:03.730Z</lastmod>
<lastmod>2024-09-09T16:21:56.220Z</lastmod>
</url>
<url>
<loc>https://contributor.r-project.org/translations/Conventions_for_Languages/Japanese-specific-translations.html</loc>
<lastmod>2024-09-09T00:08:03.730Z</lastmod>
<lastmod>2024-09-09T16:21:56.220Z</lastmod>
</url>
<url>
<loc>https://contributor.r-project.org/translations/Conventions_for_Languages/Chinese-specific-translations.html</loc>
<lastmod>2024-09-09T00:08:03.730Z</lastmod>
<lastmod>2024-09-09T16:21:56.220Z</lastmod>
</url>
<url>
<loc>https://contributor.r-project.org/translations/Conventions_for_Languages/Brazilian‐Portugese-specific-translations.html</loc>
<lastmod>2024-09-09T00:08:03.730Z</lastmod>
<lastmod>2024-09-09T16:21:56.220Z</lastmod>
</url>
<url>
<loc>https://contributor.r-project.org/translations/Conventions_for_Languages/Arabic-specific-translations.html</loc>
<lastmod>2024-09-09T00:08:03.726Z</lastmod>
<lastmod>2024-09-09T16:21:56.220Z</lastmod>
</url>
<url>
<loc>https://contributor.r-project.org/translations/Conventions_for_Languages/Bengali-specific-translations.html</loc>
<lastmod>2024-09-09T00:08:03.726Z</lastmod>
<lastmod>2024-09-09T16:21:56.220Z</lastmod>
</url>
<url>
<loc>https://contributor.r-project.org/translations/Conventions_for_Languages/Catalan-specific-translations.html</loc>
<lastmod>2024-09-09T00:08:03.730Z</lastmod>
<lastmod>2024-09-09T16:21:56.220Z</lastmod>
</url>
<url>
<loc>https://contributor.r-project.org/translations/Conventions_for_Languages/Hindi-specific-translations.html</loc>
<lastmod>2024-09-09T00:08:03.730Z</lastmod>
<lastmod>2024-09-09T16:21:56.220Z</lastmod>
</url>
<url>
<loc>https://contributor.r-project.org/translations/Conventions_for_Languages/Nepali-specific-translations.html</loc>
<lastmod>2024-09-09T00:08:03.730Z</lastmod>
<lastmod>2024-09-09T16:21:56.220Z</lastmod>
</url>
<url>
<loc>https://contributor.r-project.org/translations/Conventions_for_Languages/index.html</loc>
<lastmod>2024-09-09T00:08:03.730Z</lastmod>
<lastmod>2024-09-09T16:21:56.220Z</lastmod>
</url>
<url>
<loc>https://contributor.r-project.org/translations/Weblate-server.html</loc>
<lastmod>2024-09-09T00:08:03.730Z</lastmod>
<lastmod>2024-09-09T16:21:56.220Z</lastmod>
</url>
</urlset>

0 comments on commit dab8498

Please sign in to comment.