diff --git a/.nojekyll b/.nojekyll index 92a3f74..ae5a372 100644 --- a/.nojekyll +++ b/.nojekyll @@ -1 +1 @@ -92e08c73 \ No newline at end of file +1da0a643 \ No newline at end of file diff --git a/Weblate-server.html b/Weblate-server.html index 0ef1cb1..982db2e 100644 --- a/Weblate-server.html +++ b/Weblate-server.html @@ -425,40 +425,39 @@

# SUMMARIZE the changed translations, and delete empty .po files set_branch('weblate/master') -weblate_po_files <- po_files() -weblate_summary <- po_counts(weblate_po_files) -set_branch('svn/master') -svn_summary <- po_counts(po_files()) -set_branch('master') - -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 -po_summary[n_translated_weblate == 0, { - log_info('Dropping {.N} empty files:') - .SD[, by = package, { - log_level(INFO, 'From package {blue(.BY$package)}:') - log_level(INFO, ' {toString(green(basename(filename)))}', .topenv = .SD) # NB: Need .SD since data.table doesn't pick up the variable from the string - }] - unlink(filename) - NULL -}] -po_summary <- po_summary[n_translated_weblate > 0] - -# (optional) Summarize the update for the rest of the files -setnafill(po_summary, fill = 0L, cols = which(sapply(po_summary, is.numeric))) -po_summary[, n_newly_translated := n_translated_weblate - n_translated_svn] -po_summary[n_newly_translated > 0, { - log_info('New translations in {.N} files') - .SD[, by = package, { - log_level(INFO, 'From package {blue(.BY$package)}:') - log_level(INFO, ' {sprintf("%s [+%s]", green(format(basename(filename))), red(format(n_newly_translated)))}', .topenv = .SD) - }] - NULL -}] - -# REPLACE 'Report-Msgid-Bugs-To' metadata field pointing to #core-translation-po-bugs -system2("sed", c("-i", "'s/sourcestringbugs.o40l9j@zapiermail.com/bugs.r-project.org/'", weblate_po_files)) +weblate_summary <- po_counts(po_files()) +set_branch('svn/master') +svn_summary <- po_counts(po_files()) +set_branch('master') + +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 +po_summary[n_translated_weblate == 0, { + log_info('Dropping {.N} empty files:') + .SD[, by = package, { + log_level(INFO, 'From package {blue(.BY$package)}:') + log_level(INFO, ' {toString(green(basename(filename)))}', .topenv = .SD) # NB: Need .SD since data.table doesn't pick up the variable from the string + }] + unlink(filename) + NULL +}] +po_summary <- po_summary[n_translated_weblate > 0] + +# (optional) Summarize the update for the rest of the files +setnafill(po_summary, fill = 0L, cols = which(sapply(po_summary, is.numeric))) +po_summary[, n_newly_translated := n_translated_weblate - n_translated_svn] +po_summary[n_newly_translated > 0, { + log_info('New translations in {.N} files') + .SD[, by = package, { + log_level(INFO, 'From package {blue(.BY$package)}:') + log_level(INFO, ' {sprintf("%s [+%s]", green(format(basename(filename))), red(format(n_newly_translated)))}', .topenv = .SD) + }] + NULL +}] + +# REPLACE 'Report-Msgid-Bugs-To' metadata field pointing to #core-translation-po-bugs +system2("sed", c("-i", "'s/sourcestringbugs.o40l9j@zapiermail.com/bugs.r-project.org/'", po_summary$filename))
  • Generate a patch file from the diff, going back to the most recent commit with translations merged, e.g.

    # NB: _not_ 'git diff weblate/master svn/master' since we've just deleted the empty .po files locally
     git diff svn/master --no-prefix -- "*.po"
  • diff --git a/search.json b/search.json index 0ceedc5..2f4934e 100644 --- a/search.json +++ b/search.json @@ -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:\ngit clone -o weblate https://translate.rx.studio/git/r-project/base-r-gui/ # remote #1: Weblate source\ngit remote add svn git remote add svn git@github.com:r-devel/r-svn.git # remote #2: SVN source\ngit fetch svn master # retrieve the latest from SVN\nRevert unwanted changes to reduce noise, e.g. something like:\nlibrary(data.table)\nlibrary(crayon)\nlibrary(logger)\n\npo_files <- \\() list.files(pattern = '\\\\.po$', recursive = TRUE)\n# pocount is available from e.g. 'apt install translate-toolkit'\npo_counts <- 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 <- \\(branch) system2('git', c('checkout', branch))\n\n# SUMMARIZE the changed translations, and delete empty .po files\nset_branch('weblate/master')\nweblate_po_files <- po_files()\nweblate_summary <- po_counts(weblate_po_files)\nset_branch('svn/master')\nsvn_summary <- po_counts(po_files())\nset_branch('master')\n\npo_summary <- 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, {\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 <- po_summary[n_translated_weblate > 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 > 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/'\", weblate_po_files))\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/master' since we've just deleted the empty .po files locally\ngit diff svn/master --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:\ngit clone -o weblate https://translate.rx.studio/git/r-project/base-r-gui/ # remote #1: Weblate source\ngit remote add svn git remote add svn git@github.com:r-devel/r-svn.git # remote #2: SVN source\ngit fetch svn master # retrieve the latest from SVN\nRevert unwanted changes to reduce noise, e.g. something like:\nlibrary(data.table)\nlibrary(crayon)\nlibrary(logger)\n\npo_files <- \\() list.files(pattern = '\\\\.po$', recursive = TRUE)\n# pocount is available from e.g. 'apt install translate-toolkit'\npo_counts <- 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 <- \\(branch) system2('git', c('checkout', branch))\n\n# SUMMARIZE the changed translations, and delete empty .po files\nset_branch('weblate/master')\nweblate_summary <- po_counts(po_files())\nset_branch('svn/master')\nsvn_summary <- po_counts(po_files())\nset_branch('master')\n\npo_summary <- 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, {\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 <- po_summary[n_translated_weblate > 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 > 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))\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/master' since we've just deleted the empty .po files locally\ngit diff svn/master --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" diff --git a/sitemap.xml b/sitemap.xml index b351e9a..2c4e0d1 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -2,54 +2,54 @@ https://contributor.r-project.org/translations/index.html - 2024-03-18T16:27:29.586Z + 2024-03-18T16:30:48.353Z https://contributor.r-project.org/translations/Weblate-FAQ.html - 2024-03-18T16:27:29.586Z + 2024-03-18T16:30:48.353Z https://contributor.r-project.org/translations/Conventions_for_Languages/Spanish-specific-translations.html - 2024-03-18T16:27:29.586Z + 2024-03-18T16:30:48.353Z https://contributor.r-project.org/translations/Conventions_for_Languages/Japanese-specific-translations.html - 2024-03-18T16:27:29.586Z + 2024-03-18T16:30:48.353Z https://contributor.r-project.org/translations/Conventions_for_Languages/Chinese-specific-translations.html - 2024-03-18T16:27:29.586Z + 2024-03-18T16:30:48.353Z https://contributor.r-project.org/translations/Conventions_for_Languages/Brazilian‐Portugese-specific-translations.html - 2024-03-18T16:27:29.586Z + 2024-03-18T16:30:48.353Z https://contributor.r-project.org/translations/Conventions_for_Languages/Arabic-specific-translations.html - 2024-03-18T16:27:29.586Z + 2024-03-18T16:30:48.353Z https://contributor.r-project.org/translations/Conventions_for_Languages/Bengali-specific-translations.html - 2024-03-18T16:27:29.586Z + 2024-03-18T16:30:48.353Z https://contributor.r-project.org/translations/Conventions_for_Languages/Catalan-specific-translations.html - 2024-03-18T16:27:29.586Z + 2024-03-18T16:30:48.353Z https://contributor.r-project.org/translations/Conventions_for_Languages/Hindi-specific-translations.html - 2024-03-18T16:27:29.586Z + 2024-03-18T16:30:48.353Z https://contributor.r-project.org/translations/Conventions_for_Languages/Nepali-specific-translations.html - 2024-03-18T16:27:29.586Z + 2024-03-18T16:30:48.353Z https://contributor.r-project.org/translations/Conventions_for_Languages/index.html - 2024-03-18T16:27:29.586Z + 2024-03-18T16:30:48.353Z https://contributor.r-project.org/translations/Weblate-server.html - 2024-03-18T16:27:29.586Z + 2024-03-18T16:30:48.353Z