From eec0386ba633b78c4b8d7c6b75e58fc9b15da57a Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Sun, 7 Nov 2021 20:42:56 -0800 Subject: [PATCH 01/22] WIP on snapshots --- tests/testthat/helpers.R | 28 +- tests/testthat/test-translate-package.R | 908 ++++++++++-------------- 2 files changed, 406 insertions(+), 530 deletions(-) diff --git a/tests/testthat/helpers.R b/tests/testthat/helpers.R index acd9ed1b..4f7ca876 100644 --- a/tests/testthat/helpers.R +++ b/tests/testthat/helpers.R @@ -1,22 +1,20 @@ -# copy a package to tmp, then overwrite any changes on exit -restore_package <- function(dir, expr, tmp_conn) { - # this is way uglier than it should be. i'm missing something. - tdir <- tempdir() - +# copy a package to tmp, deleting on exit +with_package <- function(dir, expr, msg_conn = NULL) { + tdir <- withr::local_tempdir() file.copy(dir, tdir, recursive = TRUE) - on.exit({ - unlink(dir, recursive = TRUE) - dir.create(dir) - file.copy(file.path(tdir, basename(dir)), dirname(dir), recursive = TRUE) - unlink(file.path(tdir, basename(dir)), recursive = TRUE) - }) + withr::local_dir(file.path(tdir, basename(dir))) - if (!missing(tmp_conn)) { - old = options("__potools_testing_prompt_connection__" = tmp_conn) - on.exit(options(old), add = TRUE) + if (!is.null(msg_conn)) { + withr::local_options("__potools_testing_prompt_connection__" = msg_conn) } - invisible(capture.output(expr)) + expr +} + +with_restoration_test_that <- function(pkg, desc, code, conn = NULL) { + pkg <- test_package(pkg) + conn <- mock_translation(conn) + with_package(pkg, code, conn) } # TODO: I think this can just be replaced by expect_match and expect_no_match in current testthat dev diff --git a/tests/testthat/test-translate-package.R b/tests/testthat/test-translate-package.R index 4cf60a20..3aae88d3 100644 --- a/tests/testthat/test-translate-package.R +++ b/tests/testthat/test-translate-package.R @@ -19,543 +19,421 @@ test_that("translate_package arg checking errors work", { expect_error(translate_package(tempdir(), diagnostics = list(1L)), "'diagnostics' should be", fixed=TRUE) }) -test_that("translate_package handles empty packages", { - restore_package( - pkg <- test_package("no_msg"), - { - expect_invisible(translate_package(pkg)) - - expect_message(translate_package(pkg, verbose=TRUE), "No messages to translate", fixed=TRUE) - } - ) - - # a package with no R directory (e.g. a data package) - restore_package( - pkg <- test_package("r_data_pkg"), - expect_message(translate_package(pkg, verbose=TRUE), "No messages to translate", fixed=TRUE) - ) +with_restoration_test_that("translate_package handles empty packages", "no_msg", { + expect_snapshot(translate_package()) + expect_snapshot(translate_package(verbose=TRUE)) }) -test_that("translate_package works on a simple package", { - # simple run-through without doing translations - restore_package( - pkg <- test_package("r_msg"), - { - expect_messages( - translate_package(pkg, verbose=TRUE), - c("Generating .pot files", "No languages provided"), - fixed = TRUE - ) - - pkg_files <- list.files(pkg, recursive=TRUE) - - pot_file <- "po/R-rMsg.pot" - expect_true(pot_file %in% pkg_files) - # testing gettextf's ... arguments are skipped - expect_all_match(readLines(file.path(pkg, pot_file)), "don't translate me", invert=TRUE, fixed=TRUE) - - # Non-UTF-8 machines don't run en@quot translations by default. - # Mostly applies to Windows, but can also apply to Unix - # (e.g. r-devel-linux-x86_64-debian-clang on CRAN), #191 - if (l10n_info()[["UTF-8"]]) { - expect_match(pkg_files, "inst/po/en@quot/LC_MESSAGES/R-rMsg.mo", all = FALSE) - } - } - ) - # do translations with mocked input - prompts <- restore_package( - pkg, - tmp_conn = mock_translation("test-translate-package-r_msg-1.input"), - { - expect_messages( - translate_package(pkg, "zh_CN", verbose=TRUE), - c("Beginning new translations", "BEGINNING TRANSLATION", '"Installing" translations with msgfmt'), - fixed = TRUE - ) - - pkg_files <- list.files(pkg, recursive = TRUE) - - expect_true("po/R-zh_CN.po" %in% pkg_files) - expect_match(pkg_files, "inst/po/zh_CN/LC_MESSAGES/R-rMsg.mo", all = FALSE, fixed = TRUE) - - zh_translations <- readLines(file.path(pkg, "po/R-zh_CN.po"), encoding='UTF-8') - - expect_match(zh_translations, "Last-Translator.*test-user.*test-user@github.com", all = FALSE) - expect_match(zh_translations, "早上好", all = FALSE) - # plural message - expect_match(zh_translations, "该起床了", all = FALSE) - } - ) - expect_all_match(prompts, c("^---^", "^^"), fixed=TRUE) - - # all translations already done - restore_package( - pkg, - { - expect_messages( - translate_package(pkg, "fa", verbose=TRUE), - "Translations for fa are up to date! Skipping", - fixed = TRUE - ) - } - ) +with_restoration_test_that("translate_package handles a data package (no R dir)", "r_data_package", { + expect_snapshot(translate_package(verbose=TRUE)) }) -test_that("translate_package works on package with outdated (fuzzy) translations", { - # simple run-through without doing translations - prompts = restore_package( - pkg <- test_package("r_fuzzy"), - tmp_conn = mock_translation("test-translate-package-r_fuzzy-1.input"), - { - expect_messages( - translate_package(pkg, "zh_CN", verbose=TRUE), - c("translations marked as deprecated", "SINGULAR MESSAGES", "PLURAL MESSAGES"), - fixed = TRUE - ) - } - ) - expect_match(prompts, "a similar message was previously translated as", all=FALSE) -}) +with_restoration_test_that("translate_package works on a simple package w/o translating", "r_msg", { + expect_snapshot({ + expect_snapshot(translate_package(verbose = TRUE)) -# NB: keep this test here (not in test-diagnostics) to keep coverage of the diagnostic flow in translate_package() -test_that("translate_package identifies potential translations in cat() calls", { - prompts = restore_package( - pkg <- test_package("r_cat_msg"), - tmp_conn = mock_translation("test-translate-package-r_cat_message-1.input"), - { - expect_messages( - translate_package(pkg, "zh_CN"), - "Found 4 untranslated messaging calls passed through cat()", - fixed = TRUE - ) - } - ) - expect_all_match( - prompts, - c( - 'cat(gettext("I warned you!"), fill=TRUE)', - 'cat(gettext("Oh no you\\ndon\'t!"))', - "Hixxboss" - ), - fixed=TRUE - ) - expect_all_match( - prompts, - c("shouldn't be translated", "Miss me"), - fixed=TRUE, invert=TRUE - ) -}) - -test_that('Unknown language flow works correctly', { - prompts = restore_package( - pkg <- test_package('r_msg'), - tmp_conn = mock_translation('test-translate-package-r_msg-2.input'), - { - expect_messages( - # earlier, did Arabic, but now that's a chosen language. switched two Welsh on the - # (perhaps naive) judgment that it's unlikely to enter our scope anytime soon - # and because there are still several (4) plural forms - translate_package(pkg, 'cy'), - c( - 'not a known language', 'Please file an issue', - # NB: this test will fail if test_that is re-run on the same R session since potools' - # internal state is altered for the remainder of the session... not sure it's worth changing... - "Did not match any known 'plural's" - ), - fixed=TRUE - ) - } - ) - # also include coverage tests of incorrect templating in supplied translations - expect_all_match( - prompts, - c( - 'How would you refer to this language in English?', - 'received the same set of templates', - 'received 2 unique templated arguments', - 'received 4 unique templated arguments', - 'received 5 unique templated arguments' - ), - fixed=TRUE - ) - - # whitespace matching for plural is lenient, #183 - prompts = restore_package( - pkg <- test_package('r_msg'), - tmp_conn = mock_translation('test-translate-package-r_msg-5.input'), - { - expect_messages( - # Catalan -- romance language with >1 plural - translate_package(pkg, 'ca', diagnostics=NULL), - c("Did not match any known 'plural's"), - fixed=TRUE, invert=TRUE - ) - } - ) - expect_all_match( - prompts, - c("when n = 1", "when n is not 1"), - fixed = TRUE - ) -}) - -test_that('Erroneous messages stop get_specials_metadata', { - restore_package( - pkg <- test_package('r_msg'), - tmp_conn = mock_translation('test-translate-package-r_msg-3.input'), - { - expect_error( - translate_package(pkg, 'zh_CN', diagnostics = NULL), - 'Invalid templated message. If any %N$', fixed = TRUE - ) - } - ) - - restore_package( - pkg <- test_package('r_msg'), - tmp_conn = mock_translation('test-translate-package-r_msg-4.input'), - { - expect_error( - translate_package(pkg, 'zh_CN', diagnostics = NULL), - 'all messages pointing to the same input', fixed = TRUE - ) - } - ) -}) - -test_that("Packages with src code work correctly", { - prompts = restore_package( - pkg <- test_package('r_src_c'), - tmp_conn = mock_translation('test-translate-package-r_src_c-1.input'), - { - translate_package(pkg, "zh_CN", diagnostics = check_untranslated_src) - - pkg_files <- list.files(pkg, recursive = TRUE) - expect_true("po/R-zh_CN.po" %in% pkg_files) - expect_true("po/zh_CN.po" %in% pkg_files) - expect_true("po/rSrcMsg.pot" %in% pkg_files) - expect( - any(grepl("inst/po/zh_CN/LC_MESSAGES/rSrcMsg.mo", pkg_files, fixed = TRUE)), - sprintf( - "Didn't find rSrcMsg.mo; found %s.\n**Sysreq paths: %s.\n**po/zh_CN contents:\n%s\n**Direct msgfmt output:\n%s**Session info:\n%s", - toString(pkg_files), toString(Sys.which(potools:::SYSTEM_REQUIREMENTS)), - paste(readLines(file.path(pkg, 'po/zh_CN.po')), collapse='\n'), - { - out <- tempfile() - system2( - "msgfmt", - c("-o", tempfile(fileext = '.mo'), file.path(pkg, "po/zh_CN.po")), - stdout = out, stdin = out, stderr = out - ) - paste(readLines(out), collapse='\n') - }, - paste(capture.output(print(sessionInfo())), collapse = '\n') - ) - ) + pkg_files <- list.files(recursive=TRUE) - # NB: paste(readLines(), collapse="\n") instead of readChar() for platform robustness - pot_lines <- paste(readLines(file.path(pkg, 'po', 'rSrcMsg.pot')), collapse = "\n") - # (1) test N_-marked messages are included for translation - # (2) test untemplated snprintf() calls get c-format tagged (#137) - # (3)-(4) ngettext() arrays are extracted - expect_all_match( - pot_lines, - c( - '"Don\'t translate me now."', - '#, c-format\nmsgid "a simple message"', - 'msgid "singular"\nmsgid_plural "plural"', - 'msgid "singular %d"\nmsgid_plural "plural %d"' - ) - ) - } - ) - - expect_all_match( - prompts, - c("Rprintf(_(", "warning(_("), - fixed = TRUE - ) - - # error(ngettext(...)) doesn't show error() in check_untranslated_src - expect_all_match( - prompts, - "Problematic call", - invert = TRUE, fixed = TRUE - ) -}) + pot_file <- "po/R-rMsg.pot" + expect_true(pot_file %in% pkg_files) + # testing gettextf's ... arguments are skipped + expect_all_match(readLines(file.path(pot_file)), "don't translate me", invert=TRUE, fixed=TRUE) -test_that("Packages with src code & fuzzy messages work", { - prompts = restore_package( - pkg <- test_package("r_src_fuzzy"), - tmp_conn = mock_translation('test-translate-package-r_src_fuzzy-1.input'), - { - expect_messages( - translate_package(pkg, "zh_CN", verbose = TRUE), - "Found existing src translations", - fixed = TRUE - ) + # Non-UTF-8 machines don't run en@quot translations by default. + # Mostly applies to Windows, but can also apply to Unix + # (e.g. r-devel-linux-x86_64-debian-clang on CRAN), #191 + if (l10n_info()[["UTF-8"]]) { + expect_match(pkg_files, "inst/po/en@quot/LC_MESSAGES/R-rMsg.mo", all = FALSE) } - ) - expect_all_match( - prompts, - "Note: a similar message was previously translated as", - fixed = TRUE - ) + }) }) -# TODO: separate get_message_data() tests from write_po_files() tests here -test_that("Various edge cases in retrieving/outputting messages in R files are handled", { - restore_package( - pkg <- test_package("unusual_msg"), - { - translate_package(pkg, diagnostics = NULL) - - r_pot_file <- readLines(file.path(pkg, "po", "R-rMsgUnusual.pot")) - src_pot_file <- readLines(file.path(pkg, "po", "rMsgUnusual.pot")) - - # (1)-(4) raw strings edge cases - # (5)-(6) whitespace trimming behavior (trim for R singular, don't for R plural) - # (7) repeated escapables (#130) - # (8)-(9) gettextf(paste()) gets nested strings (#163) - expect_all_match( - r_pot_file, - c( - 'msgid "\'abc\'"', 'msgid "\\"def\\""', 'msgid "R(\'abc\')"', 'msgid "r(\\"def\\")"', - 'msgid "ghi"', 'good %s', 'msgid "singular "', '"I warned you!"', - 'msgid "part 1 %s"', 'msgid "part 2"' - ), - fixed = TRUE - ) +with_restoration_test_that( + "translate_package works on a simple package w/ translating", + pkg = "r_msg", + conn = "test-translate-package-r_msg-1.input", + { + expect_snapshot(translate_package(languages="zh_CN", verbose=TRUE)) - # skip empty strings - expect_all_match(paste(r_pot_file, collapse = "\n"), 'msgid ""\nmsgstr ""\n\n', fixed = TRUE, invert = TRUE) + pkg_files <- list.files(recursive = TRUE) - # don't collapse strings in similar node positions across files - expect_all_match(r_pot_file, c('msgid "copy one"', 'msgid "copy two"')) + expect_true("po/R-zh_CN.po" %in% pkg_files) + expect_match(pkg_files, "inst/po/zh_CN/LC_MESSAGES/R-rMsg.mo", all = FALSE, fixed = TRUE) - # ordering within the file - # "\\"first\\"" also tests escaping of " on msgid border, #128 - expect_true(which(r_pot_file == 'msgid "\\"first\\""') < which(r_pot_file == 'msgid "second"')) - expect_true(which(r_pot_file == 'msgid "second"') < which(r_pot_file == 'msgid "third"')) - expect_true(which(r_pot_file == 'msgid "third"') < which(r_pot_file == 'msgid "fourth"')) + zh_translations <- readLines(file.path("po/R-zh_CN.po"), encoding='UTF-8') - # escaping/unescaping - expect_all_match( - r_pot_file, - c('"\\\\n vs \\n', 'msgid "\\\\t vs \\t is OK"', - 'msgid "strings with \\"quotes\\" are OK"', 'msgid "strings with escaped \\"quotes\\" are OK"'), - fixed = TRUE - ) + expect_match(zh_translations, "Last-Translator.*test-user.*test-user@github.com", all = FALSE) + expect_match(zh_translations, "早上好", all = FALSE) + # plural message + expect_match(zh_translations, "该起床了", all = FALSE) + } +) - # (1)-(2) whitespace trimming in C - # (3) always split at newlines - # (4) exotic formatters like %lld - # (5) ordering of files within the .pot (#104), and line # when call & array lines differ (#148) - # (6) correct message after removing line continuation (#91) - # (7) a message outside a call (e.g. in a macro) gets a source marker (#133) - # (8) ternary operators return first array; only arrays through first interrupting macro are included (#154) - # (9) initial macro is ignored; arrays through first interrupting macro are included; dgettext() included (#153) - # (10) when a msgid is repeated and is_templated differs, c-format is assumed - expect_all_match( - paste(src_pot_file, collapse = "\n"), # NB: this is a get-out-of-\r\n-jail-free card on Windows, too - c( - 'looks like [*]/ "', 'looks like %s "', '"This message[\\]n"', - '#, c-format\nmsgid "Exotic formatters', '#: msg[.]c.*#: cairo/bedfellows[.]c:13', - '"any old message"', '#: msg[.]c:[0-9]+\n#, c-format\nmsgid "a message in a macro %s"', - '#: msg[.]c:[0-9]+ msg[.]c:[0-9]+\nmsgid "abc"', - '#:( msg[.]c:[0-9]+){3}\nmsgid "abcdef"', - '#: msg[.]c:[0-9]+ msg[.]c:[0-9]+\n#, c-format\nmsgid "This one does not[\\]n"' - ), - ) - } - ) -}) +with_restoration_test_that( + "translate package works for up-to-date translations", + pkg = "r_msg", + code = expect_snapshot(translate_package(languages="fa", verbose=TRUE)) +) -test_that("use_base_rules=FALSE produces our preferred behavior", { - restore_package( - pkg <- test_package("unusual_msg"), - tmp_conn = mock_translation("test-translate-package-unusual_msg-1.input"), - { - translate_package(pkg, "es", copyright = "Mata Hari", diagnostics = NULL) - r_pot_lines <- readLines(file.path(pkg, "po", "R-rMsgUnusual.pot")) - src_pot_lines <- readLines(file.path(pkg, "po", "rMsgUnusual.pot")) - - # (1) default copyright comment in metadata - # (2) default blank Language field in metadata - # (3) testing plural string padding - # (4) source tagging - # (5) splitting at newlines - # (6) msgid quote escaping - # (7) copyright - expect_all_match( - r_pot_lines, - c( - "SOME DESCRIPTIVE TITLE", "Language: \\n", "nplurals=INTEGER", - 'msgid "singular "', '#: foo.R', '"\\\\n vs \\n"', - '"strings with escaped \\"quotes\\"', - 'Copyright (C) YEAR Mata Hari' - ), - fixed = TRUE - ) - - # (1) lack of strwrap despite >79 width - # (2) inclusion of file in "unrecognized" cairo folder - expect_all_match( - src_pot_lines, - c( - "#: [A-Z]{26}[.]c:[0-9] [a-z0-5]{32}[.]c:[0-9] msg[.]c:[0-9]{2} msg[.]c:[0-9]{2}", - '^#: cairo/bedfellows\\.c:' - ) - ) - } - ) -}) +with_restoration_test_that( + "translate_package works on package with outdated (fuzzy) translations", + pkg = "r_fuzzy", + conn = "test-translate-package-r_fuzzy-1.input", + code = expect_snapshot(translate_package(languages="zh_CN", verbose=TRUE)) +) -test_that("use_base_rules=TRUE produces base-aligned behavior", { - restore_package( - pkg <- test_package("unusual_msg"), - tmp_conn = mock_translation("test-translate-package-unusual_msg-1.input"), - { - translate_package(pkg, "es", use_base_rules = TRUE, diagnostics = NULL) - r_pot_lines <- readLines(file.path(pkg, "po", "R-rMsgUnusual.pot")) - src_pot_lines <- readLines(file.path(pkg, "po", "rMsgUnusual.pot")) - - # (1)-(5) invert the corresponding number in the previous test_that - expect_all_match( - r_pot_lines, - c("SOME DESCRIPTIVE TITLE", "Language: [\\]n", "nplurals=INTEGER", '#: ', '"\\\\n vs \\n is OK"'), - fixed = TRUE, invert = TRUE +# NB: keep this test here (not in test-diagnostics) to keep coverage of the diagnostic flow in translate_package() +with_restoration_test_that( + "translate_package identifies potential translations in cat() calls", + pkg = "r_cat_msg", + conn = "test-translate-package-r_cat_message-1.input", + code = expect_snapshot(translate_package(languages = "zh_CN")) +) + +# NB: this test will fail if test_that is re-run on the same R session since potools' +# internal state is altered for the remainder of the session... not sure it's worth changing... +with_restoration_test_that( + 'Unknown language flow works correctly', + pkg = "r_msg", + conn = 'test-translate-package-r_msg-2.input', + # earlier, did Arabic, but now that's an included language. switched two Welsh on the + # (perhaps naive) judgment that it's unlikely to enter our scope anytime soon + # and because there are still several (4) plural forms + code = expect_snapshot(translate_package(languages = 'cy')) +) + +# #183 +with_restoration_test_that( + "whitespace matching for plural is lenient", + pkg = "r_msg", + conn = "test-translate-package-r_msg-5.input", + # Catalan -- romance language with >1 plural + code = expect_snapshot(translate_package('ca', diagnostics=NULL)) +) + +with_restoration_test_that( + 'Erroneous messages stop get_specials_metadata (mixed use of template redirects)', + pkg = "r_msg", + conn = 'test-translate-package-r_msg-3.input', + code = expect_snapshot(translate_package(languages='zh_CN', diagnostics=NULL), error=TRUE) +) + +with_restoration_test_that( + 'Erroneous messages stop get_specials_metadata (duplicate redirects with different formatters)', + pkg = "r_msg", + conn = 'test-translate-package-r_msg-4.input', + code = expect_snapshot(translate_package(languages='zh_CN', diagnostics=NULL), error=TRUE) +) + +with_restoration_test_that( + "Packages with src code work correctly", + pkg = "r_src_c", + conn = 'test-translate-package-r_src_c-1.input', + { + expect_snapshot(translate_package(languages="zh_CN", diagnostics = check_untranslated_src)) + + pkg_files <- list.files(recursive = TRUE) + expect_true("po/R-zh_CN.po" %in% pkg_files) + expect_true("po/zh_CN.po" %in% pkg_files) + expect_true("po/rSrcMsg.pot" %in% pkg_files) + # extended tracing here for hard-to-reproduce issue. + # TODO: refactor this into a custom expectation helper so as not to take up so much space here. + expect( + any(grepl("inst/po/zh_CN/LC_MESSAGES/rSrcMsg.mo", pkg_files, fixed = TRUE)), + sprintf( + "Didn't find rSrcMsg.mo; found %s.\n**Sysreq paths: %s.\n**po/zh_CN contents:\n%s\n**Direct msgfmt output:\n%s**Session info:\n%s", + toString(pkg_files), toString(Sys.which(potools:::SYSTEM_REQUIREMENTS)), + paste(readLines(file.path('po/zh_CN.po')), collapse='\n'), + { + out <- tempfile() + system2( + "msgfmt", + c("-o", tempfile(fileext = '.mo'), file.path("po/zh_CN.po")), + stdout = out, stdin = out, stderr = out + ) + paste(readLines(out), collapse='\n') + }, + paste(capture.output(print(sessionInfo())), collapse = '\n') ) - expect_all_match(r_pot_lines, 'msgid "small fail "', fixed = TRUE) - - # (1) MSG.c comes before msg.c (sort/collate order) - # (2) c-format tags are produced - # (3) msgid with many duplicates wraps the source markers _exactly_ at width=79 - # (4)-(11) template-adjacent wrapping/non-wrapping (#90, #150) - expect_all_match( - paste(src_pot_lines, collapse='\n'), - c( - 'MSGs\\.c.*msg\\.c', '#, c-format', - '#: [A-Z]{26}[.]c:[0-9] [a-z0-5]{32}[.]c:[0-9] msg[.]c:[0-9]{2}\n#: msg[.]c', - ' [.]"\n"%s[.]"', ' [?]"\n"%s[?]"', ' ;"\n"%s;"', ' /"\n"%s/"', - '"\'%s\'"', '"[[]%s[]]"', '"[|]%s[|]"', '"-%s-"' - ) + ) + + # TODO: is there any snapshotting equivalent for .pot/.po files? is writeLines() enough to overcome Windows issues? + # NB: paste(readLines(), collapse="\n") instead of readChar() for platform robustness + pot_lines <- paste(readLines(file.path('po', 'rSrcMsg.pot')), collapse = "\n") + # (1) test N_-marked messages are included for translation + # (2) test untemplated snprintf() calls get c-format tagged (#137) + # (3)-(4) ngettext() arrays are extracted + expect_all_match( + pot_lines, + c( + '"Don\'t translate me now."', + '#, c-format\nmsgid "a simple message"', + 'msgid "singular"\nmsgid_plural "plural"', + 'msgid "singular %d"\nmsgid_plural "plural %d"' ) + ) + } +) - # (1) only src/*.c and src/windows/*.c are included (no other subdirectories), #114 - # (2)-(8) wrapping surrounding \" matches xgettex, #91 - expect_all_match( - src_pot_lines, - c( - '#: bedfellows.c:', - '56\\"890"', '5(\\"890"', '5\'\\"890"', - '345a"', '345A"', '345#"', '345@"' - ), - fixed = TRUE, invert = TRUE - ) - } - ) -}) +with_restoration_test_that( + "Packages with src code & fuzzy messages work", + pkg = "r_src_fuzzy", + conn = 'test-translate-package-r_src_fuzzy-1.input', + code = expect_snapshot(translate_package(langauges="zh_CN", verbose=TRUE)) +) -test_that("use_base_rules is auto-detected", { - restore_package( - pkg <- test_package("r-devel/src/library/grDevices"), - { - translate_package(pkg, diagnostics = NULL) - - r_pot_lines <- readLines(file.path(pkg, 'po', 'R-grDevices.pot')) - src_pot_lines <- readLines(file.path(pkg, 'po', 'grDevices.pot')) - - expect_all_match( - r_pot_lines, - c('"Project-Id-Version: R', '"Report-Msgid-Bugs-To: bugs.r-project.org\\n"'), - fixed = TRUE - ) - - # copyright isn't written in the R file, but is in src? A bit strange but done for consistency w base - expect_all_match( - r_pot_lines, - '# Copyright (C) YEAR The R Core Team', - fixed = TRUE, invert = TRUE - ) - - expect_all_match( - src_pot_lines, - '# Copyright (C) YEAR The R Core Team', - fixed = TRUE +# TODO: separate get_message_data() tests from write_po_files() tests here +with_restoration_test_that( + "Various edge cases in retrieving/outputting messages in R files are handled", + pkg = "unusual_msg", + { + translate_package(diagnostics = NULL) + + r_pot_file <- readLines(file.path("po", "R-rMsgUnusual.pot")) + src_pot_file <- readLines(file.path("po", "rMsgUnusual.pot")) + + # (1)-(4) raw strings edge cases + # (5)-(6) whitespace trimming behavior (trim for R singular, don't for R plural) + # (7) repeated escapables (#130) + # (8)-(9) gettextf(paste()) gets nested strings (#163) + expect_all_match( + r_pot_file, + c( + 'msgid "\'abc\'"', 'msgid "\\"def\\""', 'msgid "R(\'abc\')"', 'msgid "r(\\"def\\")"', + 'msgid "ghi"', 'good %s', + 'msgid "singular "', '"I warned you!"', + 'msgid "part 1 %s"', 'msgid "part 2"' + ), + fixed = TRUE + ) + + # skip empty strings + expect_all_match(paste(r_pot_file, collapse = "\n"), 'msgid ""\nmsgstr ""\n\n', fixed = TRUE, invert = TRUE) + + # don't collapse strings in similar node positions across files + expect_all_match(r_pot_file, c('msgid "copy one"', 'msgid "copy two"')) + + # ordering within the file + # "\\"first\\"" also tests escaping of " on msgid border, #128 + expect_true(which(r_pot_file == 'msgid "\\"first\\""') < which(r_pot_file == 'msgid "second"')) + expect_true(which(r_pot_file == 'msgid "second"') < which(r_pot_file == 'msgid "third"')) + expect_true(which(r_pot_file == 'msgid "third"') < which(r_pot_file == 'msgid "fourth"')) + + # escaping/unescaping + expect_all_match( + r_pot_file, + c('"\\\\n vs \\n', + 'msgid "\\\\t vs \\t is OK"', + 'msgid "strings with \\"quotes\\" are OK"', + 'msgid "strings with escaped \\"quotes\\" are OK"'), + fixed = TRUE + ) + + # (1)-(2) whitespace trimming in C + # (3) always split at newlines + # (4) exotic formatters like %lld + # (5) ordering of files within the .pot (#104), and line # when call & array lines differ (#148) + # (6) correct message after removing line continuation (#91) + # (7) a message outside a call (e.g. in a macro) gets a source marker (#133) + # (8) ternary operators return first array; only arrays through first interrupting macro are included (#154) + # (9) initial macro is ignored; arrays through first interrupting macro are included; dgettext() included (#153) + # (10) when a msgid is repeated and is_templated differs, c-format is assumed + expect_all_match( + paste(src_pot_file, collapse = "\n"), # NB: this is a get-out-of-\r\n-jail-free card on Windows, too + c( + 'looks like [*]/ "', 'looks like %s "', + '"This message[\\]n"', + '#, c-format\nmsgid "Exotic formatters', + '#: msg[.]c.*#: cairo/bedfellows[.]c:13', + '"any old message"', + '#: msg[.]c:[0-9]+\n#, c-format\nmsgid "a message in a macro %s"', + '#: msg[.]c:[0-9]+ msg[.]c:[0-9]+\nmsgid "abc"', + '#:( msg[.]c:[0-9]+){3}\nmsgid "abcdef"', + '#: msg[.]c:[0-9]+ msg[.]c:[0-9]+\n#, c-format\nmsgid "This one does not[\\]n"' + ), + ) + } +) + +with_restoration_test_that( + "use_base_rules=FALSE produces our preferred behavior", + pkg = "unusual_msg", + conn = "test-translate-package-unusual_msg-1.input", + { + translate_package(languages="es", copyright="Mata Hari", diagnostics=NULL) + + r_pot_lines <- readLines(file.path("po", "R-rMsgUnusual.pot")) + src_pot_lines <- readLines(file.path("po", "rMsgUnusual.pot")) + + # (1) default copyright comment in metadata + # (2) default blank Language field in metadata + # (3) testing plural string padding + # (4) source tagging + # (5) splitting at newlines + # (6) msgid quote escaping + # (7) copyright + expect_all_match( + r_pot_lines, + c( + "SOME DESCRIPTIVE TITLE", "Language: \\n", "nplurals=INTEGER", + 'msgid "singular "', '#: foo.R', '"\\\\n vs \\n"', + '"strings with escaped \\"quotes\\"', + 'Copyright (C) YEAR Mata Hari' + ), + fixed = TRUE + ) + + # (1) lack of strwrap despite >79 width + # (2) inclusion of file in "unrecognized" cairo folder + expect_all_match( + src_pot_lines, + c( + "#: [A-Z]{26}[.]c:[0-9] [a-z0-5]{32}[.]c:[0-9] msg[.]c:[0-9]{2} msg[.]c:[0-9]{2}", + '^#: cairo/bedfellows\\.c:' ) - - # first argument to dgettext() should be ignored, #184 - expect_all_match( - src_pot_lines, - 'msgid "grDevices"', - fixed = TRUE, invert = TRUE + ) + } +) + +with_restoration_test_that( + "use_base_rules=TRUE produces base-aligned behavior", + pkg = "unusual_msg", + conn = "test-translate-package-unusual_msg-1.input", + { + translate_package(languages = "es", use_base_rules = TRUE, diagnostics = NULL) + r_pot_lines <- readLines(file.path("po", "R-rMsgUnusual.pot")) + src_pot_lines <- readLines(file.path("po", "rMsgUnusual.pot")) + + # (1)-(5) invert the corresponding number in the previous test_that + expect_all_match( + r_pot_lines, + c("SOME DESCRIPTIVE TITLE", "Language: [\\]n", "nplurals=INTEGER", '#: ', '"\\\\n vs \\n is OK"'), + fixed = TRUE, invert = TRUE + ) + expect_all_match(r_pot_lines, 'msgid "small fail "', fixed = TRUE) + + # (1) MSG.c comes before msg.c (sort/collate order) + # (2) c-format tags are produced + # (3) msgid with many duplicates wraps the source markers _exactly_ at width=79 + # (4)-(11) template-adjacent wrapping/non-wrapping (#90, #150) + expect_all_match( + paste(src_pot_lines, collapse='\n'), + c( + 'MSGs\\.c.*msg\\.c', '#, c-format', + '#: [A-Z]{26}[.]c:[0-9] [a-z0-5]{32}[.]c:[0-9] msg[.]c:[0-9]{2}\n#: msg[.]c', + ' [.]"\n"%s[.]"', ' [?]"\n"%s[?]"', ' ;"\n"%s;"', ' /"\n"%s/"', + '"\'%s\'"', '"[[]%s[]]"', '"[|]%s[|]"', '"-%s-"' ) - } - ) -}) + ) + + # (1) only src/*.c and src/windows/*.c are included (no other subdirectories), #114 + # (2)-(8) wrapping surrounding \" matches xgettex, #91 + expect_all_match( + src_pot_lines, + c( + '#: bedfellows.c:', + '56\\"890"', '5(\\"890"', '5\'\\"890"', + '345a"', '345A"', '345#"', '345@"' + ), + fixed = TRUE, invert = TRUE + ) + } +) + +# TODO: extend with_restoration_test_that to handle +# copying a top directory (here, r-devel) but setting to a sub-directory (here, r-devel/src/library/grDevices) +with_restoration_test_that( + "use_base_rules is auto-detected", + pkg = "r-devel", + { + withr::local_dir("src/library/grDevices") + translate_package(diagnostics = NULL) + + r_pot_lines <- readLines(file.path('po', 'R-grDevices.pot')) + src_pot_lines <- readLines(file.path('po', 'grDevices.pot')) + + expect_all_match( + r_pot_lines, + c('"Project-Id-Version: R', '"Report-Msgid-Bugs-To: bugs.r-project.org\\n"'), + fixed = TRUE + ) + + # copyright isn't written in the R file, but is in src? A bit strange but done for consistency w base + expect_all_match( + r_pot_lines, + '# Copyright (C) YEAR The R Core Team', + fixed = TRUE, invert = TRUE + ) + + expect_all_match( + src_pot_lines, + '# Copyright (C) YEAR The R Core Team', + fixed = TRUE + ) + + # first argument to dgettext() should be ignored, #184 + expect_all_match( + src_pot_lines, + 'msgid "grDevices"', + fixed = TRUE, invert = TRUE + ) + } +) # NB: this is _mostly_ about get_message_data(), but we also test the correct R.pot file is created -test_that("translation of 'base' works correctly", { - restore_package( - pkg <- test_package("r-devel/src/library/base"), - { - # NB: it seems file.rename doesn't work for directories on Windows, so we have the - # more cumbersome file.copy() approach here - correct_share <- file.path(pkg, '../../../share') - tmp_share <- file.path(tempdir(), 'share') - dir.create(tmp_share) - on.exit(unlink(tmp_share, recursive=TRUE)) - file.copy(dirname(correct_share), tmp_share, recursive = TRUE) - unlink(correct_share, recursive = TRUE) - expect_error(translate_package(pkg, diagnostics = NULL), "Translation of the 'base' package", fixed = TRUE) - dir.create(correct_share) - file.copy(tmp_share, dirname(correct_share), recursive = TRUE) - - correct_potfiles <- normalizePath(file.path(pkg, '../../../po/POTFILES')) - # tried file.rename, but it fails on some systems (e.g. Debian) as an "Invalid cross-device link" - expect_true(file.copy(correct_potfiles, tmp_potfiles <- tempfile())) - unlink(correct_potfiles) - expect_error(translate_package(pkg, diagnostics = NULL), "Translation of the 'base' package", fixed = TRUE) - file.copy(tmp_potfiles, correct_potfiles) - on.exit(unlink(tmp_potfiles), add = TRUE) - - translate_package(pkg, diagnostics = NULL) - - expect_true(file.exists(file.path(pkg, 'po', 'R-base.pot'))) - expect_true(file.exists(file.path(pkg, 'po', 'R.pot'))) - - r_pot_lines <- readLines(file.path(pkg, 'po', 'R-base.pot')) - src_pot_lines <- readLines(file.path(pkg, 'po', 'R.pot')) - - # confirm share/R messages are included - expect_all_match( - r_pot_lines, - 'msgid "Go clean your room!"', - fixed = TRUE - ) - - # check relative path is recorded correctly - expect_all_match( - src_pot_lines, - "#: src/main/msg.c:", - fixed = TRUE - ) - } - ) -}) - -test_that("max_translations works as expected", { - prompts <- restore_package( - pkg <- test_package("r_msg"), - tmp_conn = mock_translation('test-translate-package-r_msg-1.input'), - { - translate_package(pkg, 'es', max_translations = 1L, diagnostics = NULL) - } - ) - expect_all_match( - prompts, - "Oh no you don't!", - fixed = TRUE, invert = TRUE - ) -}) +test_that( + "translation of 'base' works correctly", + pkg = "r-devel", + { + withr::local_dir("src/library/base") + + # NB: it seems file.rename doesn't work for directories on Windows, so we have the + # more cumbersome file.copy() approach here + correct_share <- file.path('../../../share') + tmp_share <- file.path(tempdir(), 'share') + dir.create(tmp_share) + on.exit(unlink(tmp_share, recursive=TRUE)) + file.copy(dirname(correct_share), tmp_share, recursive = TRUE) + unlink(correct_share, recursive = TRUE) + expect_error(translate_package(diagnostics = NULL), "Translation of the 'base' package", fixed = TRUE) + dir.create(correct_share) + file.copy(tmp_share, dirname(correct_share), recursive = TRUE) + + correct_potfiles <- normalizePath(file.path('../../../po/POTFILES')) + # tried file.rename, but it fails on some systems (e.g. Debian) as an "Invalid cross-device link" + expect_true(file.copy(correct_potfiles, tmp_potfiles <- tempfile())) + unlink(correct_potfiles) + expect_error(translate_package(diagnostics = NULL), "Translation of the 'base' package", fixed = TRUE) + file.copy(tmp_potfiles, correct_potfiles) + on.exit(unlink(tmp_potfiles), add = TRUE) + + translate_package(diagnostics = NULL) + + expect_true(file.exists(file.path('po', 'R-base.pot'))) + expect_true(file.exists(file.path('po', 'R.pot'))) + + r_pot_lines <- readLines(file.path('po', 'R-base.pot')) + src_pot_lines <- readLines(file.path('po', 'R.pot')) + + # confirm share/R messages are included + expect_all_match( + r_pot_lines, + 'msgid "Go clean your room!"', + fixed = TRUE + ) + + # check relative path is recorded correctly + expect_all_match( + src_pot_lines, + "#: src/main/msg.c:", + fixed = TRUE + ) + } +) + +with_restoration_test_that( + "max_translations works as expected", + pkg = "r_msg", + conn = 'test-translate-package-r_msg-1.input', + code = expect_snapshot(translate_package(languages='es', max_translations = 1L, diagnostics = NULL)) +) From c9df0a648d0f1e9f60e245609ceec452f8b514d2 Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Sun, 7 Nov 2021 23:57:25 -0800 Subject: [PATCH 02/22] snapshot tests ~working --- tests/testthat/_snaps/translate-package.md | 1389 +++++++++++++++++ .../testthat/_snaps/translate-package.new.md | 1389 +++++++++++++++++ tests/testthat/helpers.R | 6 +- tests/testthat/test-translate-package.R | 44 +- 4 files changed, 2802 insertions(+), 26 deletions(-) create mode 100644 tests/testthat/_snaps/translate-package.md create mode 100644 tests/testthat/_snaps/translate-package.new.md diff --git a/tests/testthat/_snaps/translate-package.md b/tests/testthat/_snaps/translate-package.md new file mode 100644 index 00000000..e3c35683 --- /dev/null +++ b/tests/testthat/_snaps/translate-package.md @@ -0,0 +1,1389 @@ +# translate_package arg checking errors work + + Code + translate_package() + +--- + + Code + translate_package(verbose = TRUE) + Message + Starting translations for package 'noMsg' + Message + Getting R-level messages... + Message + Getting src-level messages... + Message + No messages to translate; finishing + +--- + + Code + translate_package(verbose = TRUE) + Message + Starting translations for package 'rDataPkg' + Message + Getting R-level messages... + Message + Getting src-level messages... + Message + No messages to translate; finishing + +--- + + Code + translate_package(verbose = TRUE) + Message + Updating translation template for package 'rMsg' (last updated 2021-11-07 23:42:57) + Message + Getting R-level messages... + Message + Getting src-level messages... + Message + Running message diagnostics... + Message + Generating .pot files... + Message + Generating en@quot translations + Message + No languages provided; finishing + +--- + + Code + translate_package(languages = "zh_CN", verbose = TRUE) + Message + Updating translation template for package 'rMsg' (last updated 2021-11-07 23:42:58) + Message + Getting R-level messages... + Message + Getting src-level messages... + Message + Running message diagnostics... + Message + Generating .pot files... + Message + Generating en@quot translations + Message + Beginning new translations for zh_CN (Mainland Chinese/普通话); found 6 untranslated messages + Message + (To quit translating, press 'Esc'; progress will be saved) + Output + Thanks! Who should be credited with these translations? + And what is their email? + Message + *************************** + ** BEGINNING TRANSLATION ** + *************************** + + Some helpful reminders: + * You can skip a translation by entering nothing (just press RETURN) + * Special characters (like newlines, \n, or tabs, \t) should be written just like that (with an escape) + * Be sure to match message templates. The count of templates (%s, %d, etc.) must match in all languages, as must initial and terminal newlines (\n) + * While the count of templates must match, the _order_ can be changed by using e.g. %2$s to mean 'use the second input as a string here' + * Whenever templates or escaping is happening in a string, these will be 'highlighted' by carets (^) in the line below + Output + + File: foo.R + Call: base::warning("I warned you!") + Message: I warned you! + + How would you translate this message into Mainland Chinese? + + File: foo.R + Call: stop("Oh no you don't!") + Message: Oh no you don't! + + How would you translate this message into Mainland Chinese? + + File: foo.R + Call: gettext("Hi there") + Message: Hi there + + How would you translate this message into Mainland Chinese? + + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + ^---^ ^^ ^^ + How would you translate this message into Mainland Chinese? + + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") + Plural message: small fail + + How would you translate this message into Mainland Chinese independently of n? + Message + "Installing" translations with msgfmt + +--- + + Code + translate_package(languages = "fa", verbose = TRUE) + Message + Updating translation template for package 'rMsg' (last updated 2021-11-07 23:42:58) + Message + Getting R-level messages... + Message + Getting src-level messages... + Message + Running message diagnostics... + Message + Generating .pot files... + Message + Generating en@quot translations + Message + Found existing R translations for fa (Farsi/فارسی) in /tmp/RtmpoWfRHo/file775e716e91bb/r_msg/po/R-fa.po. Running msgmerge... + Message + Translations for fa are up to date! Skipping. + Message + "Installing" translations with msgfmt + +--- + + Code + translate_package(languages = "zh_CN", verbose = TRUE) + Message + Updating translation template for package 'rFuzzyMsg' (last updated 2021-11-07 23:42:59) + Message + Getting R-level messages... + Message + Getting src-level messages... + Message + Running message diagnostics... + Message + Generating .pot files... + Message + Generating en@quot translations + Message + Found existing R translations for zh_CN (Mainland Chinese/普通话) in /tmp/RtmpoWfRHo/file775e707d4657/r_fuzzy/po/R-zh_CN.po. Running msgmerge... + Message + Found 2 translations marked as deprecated in /tmp/RtmpoWfRHo/file775e707d4657/r_fuzzy/po/R-zh_CN.po. + Message + Typically, this means the corresponding error messages have been refactored. + Message + Reproducing these messages here for your reference since they might still provide some utility. + Message + ** SINGULAR MESSAGES ** + Output + ---------------------------------------------------------------------------------- + Oh no you don't! + 当然不会! + Message + ** PLURAL MESSAGES ** + Output + ---------------------------------------------------------------------------------- + small fail\n + 失败了\n + ---------------------------------------------------------------------------------- + big fail\n + 失败了\n + Message + Beginning new translations for zh_CN (Mainland Chinese/普通话); found 3 untranslated messages + Message + (To quit translating, press 'Esc'; progress will be saved) + Output + Thanks! Who should be credited with these translations? + And what is their email? + Message + *************************** + ** BEGINNING TRANSLATION ** + *************************** + + Some helpful reminders: + * You can skip a translation by entering nothing (just press RETURN) + * Special characters (like newlines, \n, or tabs, \t) should be written just like that (with an escape) + * Be sure to match message templates. The count of templates (%s, %d, etc.) must match in all languages, as must initial and terminal newlines (\n) + * While the count of templates must match, the _order_ can be changed by using e.g. %2$s to mean 'use the second input as a string here' + * Whenever templates or escaping is happening in a string, these will be 'highlighted' by carets (^) in the line below + Output + + File: foo.R + Call: warning("I warned you!!") + Message: I warned you!! + + How would you translate this message into Mainland Chinese? + **Note: a similar message was previously translated as: ** + 已经告诉你! + + File: foo.R + Call: stop("I really wish you'd reconsider") + Message: I really wish you'd reconsider + + How would you translate this message into Mainland Chinese? + + File: foo.R + Call: ngettext(length(x), "SOMEWHAT EPIC FAIL", "MAJORLY EPIC FAIL") + Plural message: SOMEWHAT EPIC FAIL + + How would you translate this message into Mainland Chinese independently of n? + Message + "Installing" translations with msgfmt + +--- + + Code + translate_package(languages = "zh_CN") + Message + Found 4 untranslated messaging calls passed through cat(): + Output + + Problematic call: + base::cat("I warned you!", fill=TRUE, append=TRUE) + < File:foo.R, Line:2 > + Potential replacement: + cat(gettext("I warned you!"), fill=TRUE) + + Problematic call: + cat("Oh no", "you\ndon't!") + < File:foo.R, Line:8 > + Potential replacement: + cat(gettext("Oh no you\ndon't!")) + + Problematic call: + cat("Hi", "boss", sep="xx") + < File:foo.R, Line:15 > + Potential replacement: + cat(gettext("Hixxboss")) + + Problematic call: + cat("This costs", x, "dollars") + < File:foo.R, Line:22 > + Potential replacement: + cat(gettextf("This costs %s dollars", x)) + Exit now to repair any of these? [y/N] + +--- + + Code + translate_package(languages = "cy") + Message + Generating en@quot translations + Output + Thanks! Who should be credited with these translations? + And what is their email? + + File: foo.R + Call: base::warning("I warned you!") + Message: I warned you! + + How would you translate this message into Welsh? + + File: foo.R + Call: stop("Oh no you don't!") + Message: Oh no you don't! + + How would you translate this message into Welsh? + + File: foo.R + Call: gettext("Hi there") + Message: Hi there + + How would you translate this message into Welsh? + + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + ^---^ ^^ ^^ + How would you translate this message into Welsh? + + + ** Oops! Invalid translation -- received 0 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** + + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + ^---^ ^^ ^^ + How would you translate this message into Welsh? + + + ** Oops! Invalid translation -- received 0 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** + + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + ^---^ ^^ ^^ + How would you translate this message into Welsh? + + + ** Oops! Invalid translation -- received 0 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** + + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + ^---^ ^^ ^^ + How would you translate this message into Welsh? + + + ** Oops! Invalid translation -- received 0 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** + + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + ^---^ ^^ ^^ + How would you translate this message into Welsh? + + + ** Oops! Invalid translation -- received 0 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** + + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + ^---^ ^^ ^^ + How would you translate this message into Welsh? + + + ** Oops! Invalid translation -- received the same set of templates + bordering newlines, but in incorrect order ([%.02f, %d, %s] vs [%.02f, %s, %d]). Recall that you can use %$N to do redirect, e.g. to swap the order of '%d %s' to be translated more naturally, your translation can use '%1$s %2$d'. Retrying... ** + + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + ^---^ ^^ ^^ + How would you translate this message into Welsh? + + + ** Oops! Invalid translation -- received templates + bordering newlines not present in the original: %s. Retrying... ** + + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + ^---^ ^^ ^^ + How would you translate this message into Welsh? + + + ** Oops! Invalid translation -- received the same set of templates + bordering newlines, but in incorrect order ([%.02f, %d, %s] vs [%1$.02f, %2$s, %3$d]). Recall that you can use %$N to do redirect, e.g. to swap the order of '%d %s' to be translated more naturally, your translation can use '%1$s %2$d'. Retrying... ** + + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + ^---^ ^^ ^^ + How would you translate this message into Welsh? + + + ** Oops! Invalid translation -- received 2 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** + + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + ^---^ ^^ ^^ + How would you translate this message into Welsh? + + + ** Oops! Invalid translation -- received 4 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** + + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + ^---^ ^^ ^^ + How would you translate this message into Welsh? + + + ** Oops! Invalid translation -- received 5 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** + + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + ^---^ ^^ ^^ + How would you translate this message into Welsh? + + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") + Plural message: small fail + + How would you translate this message into Welsh for n where 'plural' resolves to 0? + + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") + Plural message: small fail + + How would you translate this message into Welsh for n where 'plural' resolves to 1? + + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") + Plural message: small fail + + How would you translate this message into Welsh for n where 'plural' resolves to 2? + + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") + Plural message: small fail + + How would you translate this message into Welsh for n where 'plural' resolves to 3? + +--- + + Code + translate_package(languages = "ca", diagnostics = NULL) + Message + Generating en@quot translations + Output + Thanks! Who should be credited with these translations? + And what is their email? + + File: foo.R + Call: base::warning("I warned you!") + Message: I warned you! + + How would you translate this message into Catalan? + + File: foo.R + Call: stop("Oh no you don't!") + Message: Oh no you don't! + + How would you translate this message into Catalan? + + File: foo.R + Call: gettext("Hi there") + Message: Hi there + + How would you translate this message into Catalan? + + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + ^---^ ^^ ^^ + How would you translate this message into Catalan? + + + ** Oops! Invalid translation -- received 0 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** + + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + ^---^ ^^ ^^ + How would you translate this message into Catalan? + + + ** Oops! Invalid translation -- received 0 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** + + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + ^---^ ^^ ^^ + How would you translate this message into Catalan? + + + ** Oops! Invalid translation -- received 0 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** + + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + ^---^ ^^ ^^ + How would you translate this message into Catalan? + + + ** Oops! Invalid translation -- received 0 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** + + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + ^---^ ^^ ^^ + How would you translate this message into Catalan? + + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") + Plural message: small fail + + How would you translate this message into Catalan when n = 1? + + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") + Plural message: small fail + + How would you translate this message into Catalan when n is not 1? + +--- + + Code + translate_package(languages = "zh_CN", diagnostics = NULL) + Message + Generating en@quot translations + Output + Thanks! Who should be credited with these translations? + And what is their email? + + File: foo.R + Call: base::warning("I warned you!") + Message: I warned you! + + How would you translate this message into Mainland Chinese? + + File: foo.R + Call: stop("Oh no you don't!") + Message: Oh no you don't! + + How would you translate this message into Mainland Chinese? + + File: foo.R + Call: gettext("Hi there") + Message: Hi there + + How would you translate this message into Mainland Chinese? + + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + ^---^ ^^ ^^ + How would you translate this message into Mainland Chinese? + Error + Invalid templated message. If any %N$ redirects are used, all templates must be redirected. + Redirected tempates: %1$d + Un-redirected templates: %d + +--- + + Code + translate_package(languages = "zh_CN", diagnostics = NULL) + Message + Generating en@quot translations + Output + Thanks! Who should be credited with these translations? + And what is their email? + + File: foo.R + Call: base::warning("I warned you!") + Message: I warned you! + + How would you translate this message into Mainland Chinese? + + File: foo.R + Call: stop("Oh no you don't!") + Message: Oh no you don't! + + How would you translate this message into Mainland Chinese? + + File: foo.R + Call: gettext("Hi there") + Message: Hi there + + How would you translate this message into Mainland Chinese? + + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + ^---^ ^^ ^^ + How would you translate this message into Mainland Chinese? + Error + Invalid templated message string with redirects -- all messages pointing to the same input must have identical formats, but received [%1$s, %1$d] + +--- + + Code + translate_package(languages = "zh_CN", diagnostics = check_untranslated_src) + Message + Generating en@quot translations + Output + Thanks! Who should be credited with these translations? + And what is their email? + + File: foo.R + Call: message("a string") + Message: a string + + How would you translate this message into Mainland Chinese? + + File: bar.c + Call: N_("Don't translate me now.") + Message: Don't translate me now. + + How would you translate this message into Mainland Chinese? + + File: bar.c + Call: Rprintf(_("an translated templated string: %" "" "\n"), 10000LL) + Message: an translated templated string: %\n + ^-------^^^ + How would you translate this message into Mainland Chinese? + + File: bar.c + Call: warning(_("a translated "\ + "warning: %s\n"), stardust(z)) + Message: a translated warning: %s\n + ^^^^ + How would you translate this message into Mainland Chinese? + + File: bar.c + Call: snprintf(BUF, 100, _("a simple message")) + Message: a simple message + + How would you translate this message into Mainland Chinese? + + File: bar.c + Call: ngettext("singular", "plural", z) + Plural message: singular + + How would you translate this message into Mainland Chinese independently of n? + + File: bar.c + Call: ngettext("singular %d", "plural %d", z) + Plural message: singular %d + ^^ + How would you translate this message into Mainland Chinese independently of n? + +--- + + Code + translate_package(languages = "zh_CN", verbose = TRUE) + Message + Updating translation template for package 'rSrcFuzzyMsg' (last updated 2021-11-07 23:43:01) + Message + Getting R-level messages... + Message + Getting src-level messages... + Message + Running message diagnostics... + Message + Generating .pot files... + Message + Generating en@quot translations + Message + Found existing R translations for zh_CN (Mainland Chinese/普通话) in /tmp/RtmpoWfRHo/file775e4758b448/r_src_fuzzy/po/R-zh_CN.po. Running msgmerge... + Message + Found existing src translations for zh_CN (Mainland Chinese/普通话) in /tmp/RtmpoWfRHo/file775e4758b448/r_src_fuzzy/po/zh_CN.po. Running msgmerge... + Message + Beginning new translations for zh_CN (Mainland Chinese/普通话); found 2 untranslated messages + Message + (To quit translating, press 'Esc'; progress will be saved) + Output + Thanks! Who should be credited with these translations? + And what is their email? + Message + *************************** + ** BEGINNING TRANSLATION ** + *************************** + + Some helpful reminders: + * You can skip a translation by entering nothing (just press RETURN) + * Special characters (like newlines, \n, or tabs, \t) should be written just like that (with an escape) + * Be sure to match message templates. The count of templates (%s, %d, etc.) must match in all languages, as must initial and terminal newlines (\n) + * While the count of templates must match, the _order_ can be changed by using e.g. %2$s to mean 'use the second input as a string here' + * Whenever templates or escaping is happening in a string, these will be 'highlighted' by carets (^) in the line below + Output + + File: src.c + Call: error(_("I really wish you'd do something else")) + Message: I really wish you'd do something else + + How would you translate this message into Mainland Chinese? + **Note: a similar message was previously translated as: ** + 失败了 + + File: src.c + Call: Rprintf(_("Here's what is wrong: %s %s\n"), "a", "b") + Message: Here's what is wrong: %s %s\n + ^^ ^^^^ + How would you translate this message into Mainland Chinese? + **Note: a similar message was previously translated as: ** + 当然%s %s\n + Message + "Installing" translations with msgfmt + +--- + + Code + translate_package(languages = "es", copyright = "Mata Hari", diagnostics = NULL) + Message + Generating en@quot translations + Output + Thanks! Who should be credited with these translations? + And what is their email? + + File: copy1.R + Call: stop("copy one") + Message: copy one + + How would you translate this message into Spanish? + + File: copy2.R + Call: stop("copy two") + Message: copy two + + How would you translate this message into Spanish? + + File: foo.R + Call: base::warning(" I warned you!\n\n") + Message: I warned you! + + How would you translate this message into Spanish? + + File: foo.R + Call: message(r"('abc')") + Message: 'abc' + + How would you translate this message into Spanish? + + File: foo.R + Call: message(R'("def")') + Message: "def" + + How would you translate this message into Spanish? + + File: foo.R + Call: message("R('abc')") + Message: R('abc') + + How would you translate this message into Spanish? + + File: foo.R + Call: message('r("def")') + Message: r("def") + + How would you translate this message into Spanish? + + File: foo.R + Call: message(R'---[ghi]---') + Message: ghi + + How would you translate this message into Spanish? + + File: foo.R + Call: gettext("Hi there") + Message: Hi there + + How would you translate this message into Spanish? + + File: foo.R + Call: gettextf(fmt = "good %s ", "grief") + Message: good %s + ^^ + How would you translate this message into Spanish? + + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: "first" + + How would you translate this message into Spanish? + + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: second + + How would you translate this message into Spanish? + + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: third + + How would you translate this message into Spanish? + + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: fourth + + How would you translate this message into Spanish? + + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: fifth + + How would you translate this message into Spanish? + + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: sixth + + How would you translate this message into Spanish? + + File: foo.R + Call: message("\\n vs \n is OK") + Message: \\n vs \n is OK + + How would you translate this message into Spanish? + + File: foo.R + Call: message("\\t vs \t is OK") + Message: \\t vs \t is OK + + How would you translate this message into Spanish? + + File: foo.R + Call: message('strings with "quotes" are OK') + Message: strings with "quotes" are OK + + How would you translate this message into Spanish? + + File: foo.R + Call: message("strings with escaped \"quotes\" are OK") + Message: strings with escaped "quotes" are OK + + How would you translate this message into Spanish? + + File: foo.R + Call: gettextf( paste("part 1 %s", "part 2"), "input" ) + Message: part 1 %s + ^^ + How would you translate this message into Spanish? + + File: foo.R + Call: gettextf( paste("part 1 %s", "part 2"), "input" ) + Message: part 2 + + How would you translate this message into Spanish? + + File: foo.R + Call: ngettext( 10, "singular ", "plural " ) + Plural message: singular  + + How would you translate this message into Spanish when n = 1? + + File: foo.R + Call: ngettext( 10, "singular ", "plural " ) + Plural message: singular  + + How would you translate this message into Spanish when n is not 1? + + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail ", msg2 = "big fail ") + Plural message: small fail  + + How would you translate this message into Spanish when n = 1? + + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail ", msg2 = "big fail ") + Plural message: small fail  + + How would you translate this message into Spanish when n is not 1? + + File: ABCDEFGHIJKLMNOPQRSTUVWXYZ.c + Call: _("an translated templated string: %" "" "\n") + Message: an translated templated string: %\n + ^-------^^^ + How would you translate this message into Spanish? + + File: MSGs.c + Call: _("any old \ + message") + Message: any old message + + How would you translate this message into Spanish? + + File: msg.c + Call: _("a message in a macro %s") + Message: a message in a macro %s + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: Rprintf(_("that's a mighty big %" """-sized wall over %"""), 100LL, 10L) + Message: that's a mighty big %-sized wall over % + ^-------^ ^-------^ + How would you translate this message into Spanish? + + File: msg.c + Call: Rprintf(_("/* this is what a C comment looks like */ ")) + Message: /* this is what a C comment looks like */  + + How would you translate this message into Spanish? + + File: msg.c + Call: Rprintf(_("// this is what a C comment looks like %s "), "abc") + Message: // this is what a C comment looks like %s  + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: Rprintf(_( + "01234567890123456789.01234567890123456789" + "01234567890123456789.01234567890123456789" + "01234567890123456789.01234567890123456789" + "01234567890123456789.01234567890123456789" + )) + Message: 01234567890123456789.0123456789012345678901234567890123456789.0123456789012345678901234567890123456789.0123456789012345678901234567890123456789.01234567890123456789 + + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("This message\nSpans two lines")) + Message: This message\nSpans two lines + + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("This one does not\n")) + Message: This one does not\n + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("Exotic formatters like %I32u, %llx, %li, %ls, %lc")) + Message: Exotic formatters like %I32u, %llx, %li, %ls, %lc + ^---^ ^--^ ^-^ ^-^ ^-^ + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456\"890")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456"890 + + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345(\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345("890 + + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345'\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345'"890 + + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345a\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345a"890 + + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345A\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345A"890 + + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345#\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345#"890 + + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345@\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345@"890 + + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 .%s.")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 .%s. + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 ?%s?")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 ?%s? + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 ;%s;")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 ;%s; + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 /%s/")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 /%s/ + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 '%s'")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 '%s' + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 [%s]")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 [%s] + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 |%s|")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 |%s| + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 -%s-")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 -%s- + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: error(_(test ? "abc" : "def")) + Message: abc + + How would you translate this message into Spanish? + + File: msg.c + Call: error(_(xxx "abc" "def")) + Message: abcdef + + How would you translate this message into Spanish? + + File: z.c + Call: error(_("You found me!")) + Message: You found me! + + How would you translate this message into Spanish? + + File: cairo/bedfellows.c + Call: _( + "any new message") + Message: any new message + + How would you translate this message into Spanish? + +--- + + Code + translate_package(languages = "es", use_base_rules = TRUE, diagnostics = NULL) + Message + Generating en@quot translations + Output + Thanks! Who should be credited with these translations? + And what is their email? + + File: copy1.R + Call: stop("copy one") + Message: copy one + + How would you translate this message into Spanish? + + File: copy2.R + Call: stop("copy two") + Message: copy two + + How would you translate this message into Spanish? + + File: foo.R + Call: base::warning(" I warned you!\n\n") + Message: I warned you! + + How would you translate this message into Spanish? + + File: foo.R + Call: message(r"('abc')") + Message: 'abc' + + How would you translate this message into Spanish? + + File: foo.R + Call: message(R'("def")') + Message: "def" + + How would you translate this message into Spanish? + + File: foo.R + Call: message("R('abc')") + Message: R('abc') + + How would you translate this message into Spanish? + + File: foo.R + Call: message('r("def")') + Message: r("def") + + How would you translate this message into Spanish? + + File: foo.R + Call: message(R'---[ghi]---') + Message: ghi + + How would you translate this message into Spanish? + + File: foo.R + Call: gettext("Hi there") + Message: Hi there + + How would you translate this message into Spanish? + + File: foo.R + Call: gettextf(fmt = "good %s ", "grief") + Message: good %s + ^^ + How would you translate this message into Spanish? + + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: "first" + + How would you translate this message into Spanish? + + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: second + + How would you translate this message into Spanish? + + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: third + + How would you translate this message into Spanish? + + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: fourth + + How would you translate this message into Spanish? + + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: fifth + + How would you translate this message into Spanish? + + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: sixth + + How would you translate this message into Spanish? + + File: foo.R + Call: message("\\n vs \n is OK") + Message: \\n vs \n is OK + + How would you translate this message into Spanish? + + File: foo.R + Call: message("\\t vs \t is OK") + Message: \\t vs \t is OK + + How would you translate this message into Spanish? + + File: foo.R + Call: message('strings with "quotes" are OK') + Message: strings with "quotes" are OK + + How would you translate this message into Spanish? + + File: foo.R + Call: message("strings with escaped \"quotes\" are OK") + Message: strings with escaped "quotes" are OK + + How would you translate this message into Spanish? + + File: foo.R + Call: gettextf( paste("part 1 %s", "part 2"), "input" ) + Message: part 1 %s + ^^ + How would you translate this message into Spanish? + + File: foo.R + Call: gettextf( paste("part 1 %s", "part 2"), "input" ) + Message: part 2 + + How would you translate this message into Spanish? + + File: foo.R + Call: ngettext( 10, "singular ", "plural " ) + Plural message: singular  + + How would you translate this message into Spanish when n = 1? + + File: foo.R + Call: ngettext( 10, "singular ", "plural " ) + Plural message: singular  + + How would you translate this message into Spanish when n is not 1? + + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail ", msg2 = "big fail ") + Plural message: small fail  + + How would you translate this message into Spanish when n = 1? + + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail ", msg2 = "big fail ") + Plural message: small fail  + + How would you translate this message into Spanish when n is not 1? + + File: ABCDEFGHIJKLMNOPQRSTUVWXYZ.c + Call: _("an translated templated string: %" "" "\n") + Message: an translated templated string: %\n + ^-------^^^ + How would you translate this message into Spanish? + + File: MSGs.c + Call: _("any old \ + message") + Message: any old message + + How would you translate this message into Spanish? + + File: msg.c + Call: _("a message in a macro %s") + Message: a message in a macro %s + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: Rprintf(_("that's a mighty big %" """-sized wall over %"""), 100LL, 10L) + Message: that's a mighty big %-sized wall over % + ^-------^ ^-------^ + How would you translate this message into Spanish? + + File: msg.c + Call: Rprintf(_("/* this is what a C comment looks like */ ")) + Message: /* this is what a C comment looks like */  + + How would you translate this message into Spanish? + + File: msg.c + Call: Rprintf(_("// this is what a C comment looks like %s "), "abc") + Message: // this is what a C comment looks like %s  + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: Rprintf(_( + "01234567890123456789.01234567890123456789" + "01234567890123456789.01234567890123456789" + "01234567890123456789.01234567890123456789" + "01234567890123456789.01234567890123456789" + )) + Message: 01234567890123456789.0123456789012345678901234567890123456789.0123456789012345678901234567890123456789.0123456789012345678901234567890123456789.01234567890123456789 + + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("This message\nSpans two lines")) + Message: This message\nSpans two lines + + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("This one does not\n")) + Message: This one does not\n + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("Exotic formatters like %I32u, %llx, %li, %ls, %lc")) + Message: Exotic formatters like %I32u, %llx, %li, %ls, %lc + ^---^ ^--^ ^-^ ^-^ ^-^ + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456\"890")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456"890 + + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345(\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345("890 + + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345'\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345'"890 + + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345a\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345a"890 + + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345A\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345A"890 + + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345#\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345#"890 + + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345@\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345@"890 + + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 .%s.")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 .%s. + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 ?%s?")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 ?%s? + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 ;%s;")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 ;%s; + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 /%s/")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 /%s/ + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 '%s'")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 '%s' + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 [%s]")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 [%s] + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 |%s|")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 |%s| + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 -%s-")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 -%s- + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: error(_(test ? "abc" : "def")) + Message: abc + + How would you translate this message into Spanish? + + File: msg.c + Call: error(_(xxx "abc" "def")) + Message: abcdef + + How would you translate this message into Spanish? + + File: z.c + Call: error(_("You found me!")) + Message: You found me! + + How would you translate this message into Spanish? + + File: cairo/bedfellows.c + Call: _( + "any new message") + Message: any new message + + How would you translate this message into Spanish? + +--- + + Code + translate_package(languages = "es", max_translations = 1L, diagnostics = NULL) + Message + Generating en@quot translations + Output + Thanks! Who should be credited with these translations? + And what is their email? + + File: foo.R + Call: base::warning("I warned you!") + Message: I warned you! + + How would you translate this message into Spanish? + diff --git a/tests/testthat/_snaps/translate-package.new.md b/tests/testthat/_snaps/translate-package.new.md new file mode 100644 index 00000000..dfe00a44 --- /dev/null +++ b/tests/testthat/_snaps/translate-package.new.md @@ -0,0 +1,1389 @@ +# translate_package arg checking errors work + + Code + translate_package() + +--- + + Code + translate_package(verbose = TRUE) + Message + Starting translations for package 'noMsg' + Message + Getting R-level messages... + Message + Getting src-level messages... + Message + No messages to translate; finishing + +--- + + Code + translate_package(verbose = TRUE) + Message + Starting translations for package 'rDataPkg' + Message + Getting R-level messages... + Message + Getting src-level messages... + Message + No messages to translate; finishing + +--- + + Code + translate_package(verbose = TRUE) + Message + Updating translation template for package 'rMsg' (last updated 2021-11-07 23:43:58) + Message + Getting R-level messages... + Message + Getting src-level messages... + Message + Running message diagnostics... + Message + Generating .pot files... + Message + Generating en@quot translations + Message + No languages provided; finishing + +--- + + Code + translate_package(languages = "zh_CN", verbose = TRUE) + Message + Updating translation template for package 'rMsg' (last updated 2021-11-07 23:43:58) + Message + Getting R-level messages... + Message + Getting src-level messages... + Message + Running message diagnostics... + Message + Generating .pot files... + Message + Generating en@quot translations + Message + Beginning new translations for zh_CN (Mainland Chinese/普通话); found 6 untranslated messages + Message + (To quit translating, press 'Esc'; progress will be saved) + Output + Thanks! Who should be credited with these translations? + And what is their email? + Message + *************************** + ** BEGINNING TRANSLATION ** + *************************** + + Some helpful reminders: + * You can skip a translation by entering nothing (just press RETURN) + * Special characters (like newlines, \n, or tabs, \t) should be written just like that (with an escape) + * Be sure to match message templates. The count of templates (%s, %d, etc.) must match in all languages, as must initial and terminal newlines (\n) + * While the count of templates must match, the _order_ can be changed by using e.g. %2$s to mean 'use the second input as a string here' + * Whenever templates or escaping is happening in a string, these will be 'highlighted' by carets (^) in the line below + Output + + File: foo.R + Call: base::warning("I warned you!") + Message: I warned you! + + How would you translate this message into Mainland Chinese? + + File: foo.R + Call: stop("Oh no you don't!") + Message: Oh no you don't! + + How would you translate this message into Mainland Chinese? + + File: foo.R + Call: gettext("Hi there") + Message: Hi there + + How would you translate this message into Mainland Chinese? + + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + ^---^ ^^ ^^ + How would you translate this message into Mainland Chinese? + + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") + Plural message: small fail + + How would you translate this message into Mainland Chinese independently of n? + Message + "Installing" translations with msgfmt + +--- + + Code + translate_package(languages = "fa", verbose = TRUE) + Message + Updating translation template for package 'rMsg' (last updated 2021-11-07 23:43:59) + Message + Getting R-level messages... + Message + Getting src-level messages... + Message + Running message diagnostics... + Message + Generating .pot files... + Message + Generating en@quot translations + Message + Found existing R translations for fa (Farsi/فارسی) in /tmp/RtmpoWfRHo/file775e3d8006a0/r_msg/po/R-fa.po. Running msgmerge... + Message + Translations for fa are up to date! Skipping. + Message + "Installing" translations with msgfmt + +--- + + Code + translate_package(languages = "zh_CN", verbose = TRUE) + Message + Updating translation template for package 'rFuzzyMsg' (last updated 2021-11-07 23:43:59) + Message + Getting R-level messages... + Message + Getting src-level messages... + Message + Running message diagnostics... + Message + Generating .pot files... + Message + Generating en@quot translations + Message + Found existing R translations for zh_CN (Mainland Chinese/普通话) in /tmp/RtmpoWfRHo/file775e149d1121/r_fuzzy/po/R-zh_CN.po. Running msgmerge... + Message + Found 2 translations marked as deprecated in /tmp/RtmpoWfRHo/file775e149d1121/r_fuzzy/po/R-zh_CN.po. + Message + Typically, this means the corresponding error messages have been refactored. + Message + Reproducing these messages here for your reference since they might still provide some utility. + Message + ** SINGULAR MESSAGES ** + Output + ---------------------------------------------------------------------------------- + Oh no you don't! + 当然不会! + Message + ** PLURAL MESSAGES ** + Output + ---------------------------------------------------------------------------------- + small fail\n + 失败了\n + ---------------------------------------------------------------------------------- + big fail\n + 失败了\n + Message + Beginning new translations for zh_CN (Mainland Chinese/普通话); found 3 untranslated messages + Message + (To quit translating, press 'Esc'; progress will be saved) + Output + Thanks! Who should be credited with these translations? + And what is their email? + Message + *************************** + ** BEGINNING TRANSLATION ** + *************************** + + Some helpful reminders: + * You can skip a translation by entering nothing (just press RETURN) + * Special characters (like newlines, \n, or tabs, \t) should be written just like that (with an escape) + * Be sure to match message templates. The count of templates (%s, %d, etc.) must match in all languages, as must initial and terminal newlines (\n) + * While the count of templates must match, the _order_ can be changed by using e.g. %2$s to mean 'use the second input as a string here' + * Whenever templates or escaping is happening in a string, these will be 'highlighted' by carets (^) in the line below + Output + + File: foo.R + Call: warning("I warned you!!") + Message: I warned you!! + + How would you translate this message into Mainland Chinese? + **Note: a similar message was previously translated as: ** + 已经告诉你! + + File: foo.R + Call: stop("I really wish you'd reconsider") + Message: I really wish you'd reconsider + + How would you translate this message into Mainland Chinese? + + File: foo.R + Call: ngettext(length(x), "SOMEWHAT EPIC FAIL", "MAJORLY EPIC FAIL") + Plural message: SOMEWHAT EPIC FAIL + + How would you translate this message into Mainland Chinese independently of n? + Message + "Installing" translations with msgfmt + +--- + + Code + translate_package(languages = "zh_CN") + Message + Found 4 untranslated messaging calls passed through cat(): + Output + + Problematic call: + base::cat("I warned you!", fill=TRUE, append=TRUE) + < File:foo.R, Line:2 > + Potential replacement: + cat(gettext("I warned you!"), fill=TRUE) + + Problematic call: + cat("Oh no", "you\ndon't!") + < File:foo.R, Line:8 > + Potential replacement: + cat(gettext("Oh no you\ndon't!")) + + Problematic call: + cat("Hi", "boss", sep="xx") + < File:foo.R, Line:15 > + Potential replacement: + cat(gettext("Hixxboss")) + + Problematic call: + cat("This costs", x, "dollars") + < File:foo.R, Line:22 > + Potential replacement: + cat(gettextf("This costs %s dollars", x)) + Exit now to repair any of these? [y/N] + +--- + + Code + translate_package(languages = "cy") + Message + Generating en@quot translations + Output + Thanks! Who should be credited with these translations? + And what is their email? + + File: foo.R + Call: base::warning("I warned you!") + Message: I warned you! + + How would you translate this message into Welsh? + + File: foo.R + Call: stop("Oh no you don't!") + Message: Oh no you don't! + + How would you translate this message into Welsh? + + File: foo.R + Call: gettext("Hi there") + Message: Hi there + + How would you translate this message into Welsh? + + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + ^---^ ^^ ^^ + How would you translate this message into Welsh? + + + ** Oops! Invalid translation -- received 0 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** + + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + ^---^ ^^ ^^ + How would you translate this message into Welsh? + + + ** Oops! Invalid translation -- received 0 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** + + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + ^---^ ^^ ^^ + How would you translate this message into Welsh? + + + ** Oops! Invalid translation -- received 0 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** + + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + ^---^ ^^ ^^ + How would you translate this message into Welsh? + + + ** Oops! Invalid translation -- received 0 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** + + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + ^---^ ^^ ^^ + How would you translate this message into Welsh? + + + ** Oops! Invalid translation -- received 0 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** + + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + ^---^ ^^ ^^ + How would you translate this message into Welsh? + + + ** Oops! Invalid translation -- received the same set of templates + bordering newlines, but in incorrect order ([%.02f, %d, %s] vs [%.02f, %s, %d]). Recall that you can use %$N to do redirect, e.g. to swap the order of '%d %s' to be translated more naturally, your translation can use '%1$s %2$d'. Retrying... ** + + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + ^---^ ^^ ^^ + How would you translate this message into Welsh? + + + ** Oops! Invalid translation -- received templates + bordering newlines not present in the original: %s. Retrying... ** + + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + ^---^ ^^ ^^ + How would you translate this message into Welsh? + + + ** Oops! Invalid translation -- received the same set of templates + bordering newlines, but in incorrect order ([%.02f, %d, %s] vs [%1$.02f, %2$s, %3$d]). Recall that you can use %$N to do redirect, e.g. to swap the order of '%d %s' to be translated more naturally, your translation can use '%1$s %2$d'. Retrying... ** + + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + ^---^ ^^ ^^ + How would you translate this message into Welsh? + + + ** Oops! Invalid translation -- received 2 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** + + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + ^---^ ^^ ^^ + How would you translate this message into Welsh? + + + ** Oops! Invalid translation -- received 4 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** + + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + ^---^ ^^ ^^ + How would you translate this message into Welsh? + + + ** Oops! Invalid translation -- received 5 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** + + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + ^---^ ^^ ^^ + How would you translate this message into Welsh? + + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") + Plural message: small fail + + How would you translate this message into Welsh for n where 'plural' resolves to 0? + + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") + Plural message: small fail + + How would you translate this message into Welsh for n where 'plural' resolves to 1? + + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") + Plural message: small fail + + How would you translate this message into Welsh for n where 'plural' resolves to 2? + + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") + Plural message: small fail + + How would you translate this message into Welsh for n where 'plural' resolves to 3? + +--- + + Code + translate_package(languages = "ca", diagnostics = NULL) + Message + Generating en@quot translations + Output + Thanks! Who should be credited with these translations? + And what is their email? + + File: foo.R + Call: base::warning("I warned you!") + Message: I warned you! + + How would you translate this message into Catalan? + + File: foo.R + Call: stop("Oh no you don't!") + Message: Oh no you don't! + + How would you translate this message into Catalan? + + File: foo.R + Call: gettext("Hi there") + Message: Hi there + + How would you translate this message into Catalan? + + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + ^---^ ^^ ^^ + How would you translate this message into Catalan? + + + ** Oops! Invalid translation -- received 0 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** + + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + ^---^ ^^ ^^ + How would you translate this message into Catalan? + + + ** Oops! Invalid translation -- received 0 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** + + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + ^---^ ^^ ^^ + How would you translate this message into Catalan? + + + ** Oops! Invalid translation -- received 0 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** + + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + ^---^ ^^ ^^ + How would you translate this message into Catalan? + + + ** Oops! Invalid translation -- received 0 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** + + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + ^---^ ^^ ^^ + How would you translate this message into Catalan? + + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") + Plural message: small fail + + How would you translate this message into Catalan when n = 1? + + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") + Plural message: small fail + + How would you translate this message into Catalan when n is not 1? + +--- + + Code + translate_package(languages = "zh_CN", diagnostics = NULL) + Message + Generating en@quot translations + Output + Thanks! Who should be credited with these translations? + And what is their email? + + File: foo.R + Call: base::warning("I warned you!") + Message: I warned you! + + How would you translate this message into Mainland Chinese? + + File: foo.R + Call: stop("Oh no you don't!") + Message: Oh no you don't! + + How would you translate this message into Mainland Chinese? + + File: foo.R + Call: gettext("Hi there") + Message: Hi there + + How would you translate this message into Mainland Chinese? + + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + ^---^ ^^ ^^ + How would you translate this message into Mainland Chinese? + Error + Invalid templated message. If any %N$ redirects are used, all templates must be redirected. + Redirected tempates: %1$d + Un-redirected templates: %d + +--- + + Code + translate_package(languages = "zh_CN", diagnostics = NULL) + Message + Generating en@quot translations + Output + Thanks! Who should be credited with these translations? + And what is their email? + + File: foo.R + Call: base::warning("I warned you!") + Message: I warned you! + + How would you translate this message into Mainland Chinese? + + File: foo.R + Call: stop("Oh no you don't!") + Message: Oh no you don't! + + How would you translate this message into Mainland Chinese? + + File: foo.R + Call: gettext("Hi there") + Message: Hi there + + How would you translate this message into Mainland Chinese? + + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + ^---^ ^^ ^^ + How would you translate this message into Mainland Chinese? + Error + Invalid templated message string with redirects -- all messages pointing to the same input must have identical formats, but received [%1$s, %1$d] + +--- + + Code + translate_package(languages = "zh_CN", diagnostics = check_untranslated_src) + Message + Generating en@quot translations + Output + Thanks! Who should be credited with these translations? + And what is their email? + + File: foo.R + Call: message("a string") + Message: a string + + How would you translate this message into Mainland Chinese? + + File: bar.c + Call: N_("Don't translate me now.") + Message: Don't translate me now. + + How would you translate this message into Mainland Chinese? + + File: bar.c + Call: Rprintf(_("an translated templated string: %" "" "\n"), 10000LL) + Message: an translated templated string: %\n + ^-------^^^ + How would you translate this message into Mainland Chinese? + + File: bar.c + Call: warning(_("a translated "\ + "warning: %s\n"), stardust(z)) + Message: a translated warning: %s\n + ^^^^ + How would you translate this message into Mainland Chinese? + + File: bar.c + Call: snprintf(BUF, 100, _("a simple message")) + Message: a simple message + + How would you translate this message into Mainland Chinese? + + File: bar.c + Call: ngettext("singular", "plural", z) + Plural message: singular + + How would you translate this message into Mainland Chinese independently of n? + + File: bar.c + Call: ngettext("singular %d", "plural %d", z) + Plural message: singular %d + ^^ + How would you translate this message into Mainland Chinese independently of n? + +--- + + Code + translate_package(languages = "zh_CN", verbose = TRUE) + Message + Updating translation template for package 'rSrcFuzzyMsg' (last updated 2021-11-07 23:44:02) + Message + Getting R-level messages... + Message + Getting src-level messages... + Message + Running message diagnostics... + Message + Generating .pot files... + Message + Generating en@quot translations + Message + Found existing R translations for zh_CN (Mainland Chinese/普通话) in /tmp/RtmpoWfRHo/file775e320132b2/r_src_fuzzy/po/R-zh_CN.po. Running msgmerge... + Message + Found existing src translations for zh_CN (Mainland Chinese/普通话) in /tmp/RtmpoWfRHo/file775e320132b2/r_src_fuzzy/po/zh_CN.po. Running msgmerge... + Message + Beginning new translations for zh_CN (Mainland Chinese/普通话); found 2 untranslated messages + Message + (To quit translating, press 'Esc'; progress will be saved) + Output + Thanks! Who should be credited with these translations? + And what is their email? + Message + *************************** + ** BEGINNING TRANSLATION ** + *************************** + + Some helpful reminders: + * You can skip a translation by entering nothing (just press RETURN) + * Special characters (like newlines, \n, or tabs, \t) should be written just like that (with an escape) + * Be sure to match message templates. The count of templates (%s, %d, etc.) must match in all languages, as must initial and terminal newlines (\n) + * While the count of templates must match, the _order_ can be changed by using e.g. %2$s to mean 'use the second input as a string here' + * Whenever templates or escaping is happening in a string, these will be 'highlighted' by carets (^) in the line below + Output + + File: src.c + Call: error(_("I really wish you'd do something else")) + Message: I really wish you'd do something else + + How would you translate this message into Mainland Chinese? + **Note: a similar message was previously translated as: ** + 失败了 + + File: src.c + Call: Rprintf(_("Here's what is wrong: %s %s\n"), "a", "b") + Message: Here's what is wrong: %s %s\n + ^^ ^^^^ + How would you translate this message into Mainland Chinese? + **Note: a similar message was previously translated as: ** + 当然%s %s\n + Message + "Installing" translations with msgfmt + +--- + + Code + translate_package(languages = "es", copyright = "Mata Hari", diagnostics = NULL) + Message + Generating en@quot translations + Output + Thanks! Who should be credited with these translations? + And what is their email? + + File: copy1.R + Call: stop("copy one") + Message: copy one + + How would you translate this message into Spanish? + + File: copy2.R + Call: stop("copy two") + Message: copy two + + How would you translate this message into Spanish? + + File: foo.R + Call: base::warning(" I warned you!\n\n") + Message: I warned you! + + How would you translate this message into Spanish? + + File: foo.R + Call: message(r"('abc')") + Message: 'abc' + + How would you translate this message into Spanish? + + File: foo.R + Call: message(R'("def")') + Message: "def" + + How would you translate this message into Spanish? + + File: foo.R + Call: message("R('abc')") + Message: R('abc') + + How would you translate this message into Spanish? + + File: foo.R + Call: message('r("def")') + Message: r("def") + + How would you translate this message into Spanish? + + File: foo.R + Call: message(R'---[ghi]---') + Message: ghi + + How would you translate this message into Spanish? + + File: foo.R + Call: gettext("Hi there") + Message: Hi there + + How would you translate this message into Spanish? + + File: foo.R + Call: gettextf(fmt = "good %s ", "grief") + Message: good %s + ^^ + How would you translate this message into Spanish? + + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: "first" + + How would you translate this message into Spanish? + + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: second + + How would you translate this message into Spanish? + + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: third + + How would you translate this message into Spanish? + + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: fourth + + How would you translate this message into Spanish? + + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: fifth + + How would you translate this message into Spanish? + + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: sixth + + How would you translate this message into Spanish? + + File: foo.R + Call: message("\\n vs \n is OK") + Message: \\n vs \n is OK + + How would you translate this message into Spanish? + + File: foo.R + Call: message("\\t vs \t is OK") + Message: \\t vs \t is OK + + How would you translate this message into Spanish? + + File: foo.R + Call: message('strings with "quotes" are OK') + Message: strings with "quotes" are OK + + How would you translate this message into Spanish? + + File: foo.R + Call: message("strings with escaped \"quotes\" are OK") + Message: strings with escaped "quotes" are OK + + How would you translate this message into Spanish? + + File: foo.R + Call: gettextf( paste("part 1 %s", "part 2"), "input" ) + Message: part 1 %s + ^^ + How would you translate this message into Spanish? + + File: foo.R + Call: gettextf( paste("part 1 %s", "part 2"), "input" ) + Message: part 2 + + How would you translate this message into Spanish? + + File: foo.R + Call: ngettext( 10, "singular ", "plural " ) + Plural message: singular  + + How would you translate this message into Spanish when n = 1? + + File: foo.R + Call: ngettext( 10, "singular ", "plural " ) + Plural message: singular  + + How would you translate this message into Spanish when n is not 1? + + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail ", msg2 = "big fail ") + Plural message: small fail  + + How would you translate this message into Spanish when n = 1? + + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail ", msg2 = "big fail ") + Plural message: small fail  + + How would you translate this message into Spanish when n is not 1? + + File: ABCDEFGHIJKLMNOPQRSTUVWXYZ.c + Call: _("an translated templated string: %" "" "\n") + Message: an translated templated string: %\n + ^-------^^^ + How would you translate this message into Spanish? + + File: MSGs.c + Call: _("any old \ + message") + Message: any old message + + How would you translate this message into Spanish? + + File: msg.c + Call: _("a message in a macro %s") + Message: a message in a macro %s + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: Rprintf(_("that's a mighty big %" """-sized wall over %"""), 100LL, 10L) + Message: that's a mighty big %-sized wall over % + ^-------^ ^-------^ + How would you translate this message into Spanish? + + File: msg.c + Call: Rprintf(_("/* this is what a C comment looks like */ ")) + Message: /* this is what a C comment looks like */  + + How would you translate this message into Spanish? + + File: msg.c + Call: Rprintf(_("// this is what a C comment looks like %s "), "abc") + Message: // this is what a C comment looks like %s  + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: Rprintf(_( + "01234567890123456789.01234567890123456789" + "01234567890123456789.01234567890123456789" + "01234567890123456789.01234567890123456789" + "01234567890123456789.01234567890123456789" + )) + Message: 01234567890123456789.0123456789012345678901234567890123456789.0123456789012345678901234567890123456789.0123456789012345678901234567890123456789.01234567890123456789 + + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("This message\nSpans two lines")) + Message: This message\nSpans two lines + + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("This one does not\n")) + Message: This one does not\n + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("Exotic formatters like %I32u, %llx, %li, %ls, %lc")) + Message: Exotic formatters like %I32u, %llx, %li, %ls, %lc + ^---^ ^--^ ^-^ ^-^ ^-^ + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456\"890")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456"890 + + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345(\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345("890 + + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345'\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345'"890 + + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345a\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345a"890 + + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345A\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345A"890 + + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345#\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345#"890 + + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345@\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345@"890 + + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 .%s.")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 .%s. + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 ?%s?")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 ?%s? + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 ;%s;")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 ;%s; + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 /%s/")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 /%s/ + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 '%s'")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 '%s' + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 [%s]")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 [%s] + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 |%s|")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 |%s| + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 -%s-")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 -%s- + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: error(_(test ? "abc" : "def")) + Message: abc + + How would you translate this message into Spanish? + + File: msg.c + Call: error(_(xxx "abc" "def")) + Message: abcdef + + How would you translate this message into Spanish? + + File: z.c + Call: error(_("You found me!")) + Message: You found me! + + How would you translate this message into Spanish? + + File: cairo/bedfellows.c + Call: _( + "any new message") + Message: any new message + + How would you translate this message into Spanish? + +--- + + Code + translate_package(languages = "es", use_base_rules = TRUE, diagnostics = NULL) + Message + Generating en@quot translations + Output + Thanks! Who should be credited with these translations? + And what is their email? + + File: copy1.R + Call: stop("copy one") + Message: copy one + + How would you translate this message into Spanish? + + File: copy2.R + Call: stop("copy two") + Message: copy two + + How would you translate this message into Spanish? + + File: foo.R + Call: base::warning(" I warned you!\n\n") + Message: I warned you! + + How would you translate this message into Spanish? + + File: foo.R + Call: message(r"('abc')") + Message: 'abc' + + How would you translate this message into Spanish? + + File: foo.R + Call: message(R'("def")') + Message: "def" + + How would you translate this message into Spanish? + + File: foo.R + Call: message("R('abc')") + Message: R('abc') + + How would you translate this message into Spanish? + + File: foo.R + Call: message('r("def")') + Message: r("def") + + How would you translate this message into Spanish? + + File: foo.R + Call: message(R'---[ghi]---') + Message: ghi + + How would you translate this message into Spanish? + + File: foo.R + Call: gettext("Hi there") + Message: Hi there + + How would you translate this message into Spanish? + + File: foo.R + Call: gettextf(fmt = "good %s ", "grief") + Message: good %s + ^^ + How would you translate this message into Spanish? + + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: "first" + + How would you translate this message into Spanish? + + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: second + + How would you translate this message into Spanish? + + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: third + + How would you translate this message into Spanish? + + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: fourth + + How would you translate this message into Spanish? + + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: fifth + + How would you translate this message into Spanish? + + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: sixth + + How would you translate this message into Spanish? + + File: foo.R + Call: message("\\n vs \n is OK") + Message: \\n vs \n is OK + + How would you translate this message into Spanish? + + File: foo.R + Call: message("\\t vs \t is OK") + Message: \\t vs \t is OK + + How would you translate this message into Spanish? + + File: foo.R + Call: message('strings with "quotes" are OK') + Message: strings with "quotes" are OK + + How would you translate this message into Spanish? + + File: foo.R + Call: message("strings with escaped \"quotes\" are OK") + Message: strings with escaped "quotes" are OK + + How would you translate this message into Spanish? + + File: foo.R + Call: gettextf( paste("part 1 %s", "part 2"), "input" ) + Message: part 1 %s + ^^ + How would you translate this message into Spanish? + + File: foo.R + Call: gettextf( paste("part 1 %s", "part 2"), "input" ) + Message: part 2 + + How would you translate this message into Spanish? + + File: foo.R + Call: ngettext( 10, "singular ", "plural " ) + Plural message: singular  + + How would you translate this message into Spanish when n = 1? + + File: foo.R + Call: ngettext( 10, "singular ", "plural " ) + Plural message: singular  + + How would you translate this message into Spanish when n is not 1? + + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail ", msg2 = "big fail ") + Plural message: small fail  + + How would you translate this message into Spanish when n = 1? + + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail ", msg2 = "big fail ") + Plural message: small fail  + + How would you translate this message into Spanish when n is not 1? + + File: ABCDEFGHIJKLMNOPQRSTUVWXYZ.c + Call: _("an translated templated string: %" "" "\n") + Message: an translated templated string: %\n + ^-------^^^ + How would you translate this message into Spanish? + + File: MSGs.c + Call: _("any old \ + message") + Message: any old message + + How would you translate this message into Spanish? + + File: msg.c + Call: _("a message in a macro %s") + Message: a message in a macro %s + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: Rprintf(_("that's a mighty big %" """-sized wall over %"""), 100LL, 10L) + Message: that's a mighty big %-sized wall over % + ^-------^ ^-------^ + How would you translate this message into Spanish? + + File: msg.c + Call: Rprintf(_("/* this is what a C comment looks like */ ")) + Message: /* this is what a C comment looks like */  + + How would you translate this message into Spanish? + + File: msg.c + Call: Rprintf(_("// this is what a C comment looks like %s "), "abc") + Message: // this is what a C comment looks like %s  + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: Rprintf(_( + "01234567890123456789.01234567890123456789" + "01234567890123456789.01234567890123456789" + "01234567890123456789.01234567890123456789" + "01234567890123456789.01234567890123456789" + )) + Message: 01234567890123456789.0123456789012345678901234567890123456789.0123456789012345678901234567890123456789.0123456789012345678901234567890123456789.01234567890123456789 + + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("This message\nSpans two lines")) + Message: This message\nSpans two lines + + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("This one does not\n")) + Message: This one does not\n + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("Exotic formatters like %I32u, %llx, %li, %ls, %lc")) + Message: Exotic formatters like %I32u, %llx, %li, %ls, %lc + ^---^ ^--^ ^-^ ^-^ ^-^ + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456\"890")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456"890 + + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345(\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345("890 + + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345'\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345'"890 + + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345a\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345a"890 + + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345A\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345A"890 + + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345#\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345#"890 + + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345@\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345@"890 + + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 .%s.")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 .%s. + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 ?%s?")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 ?%s? + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 ;%s;")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 ;%s; + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 /%s/")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 /%s/ + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 '%s'")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 '%s' + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 [%s]")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 [%s] + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 |%s|")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 |%s| + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 -%s-")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 -%s- + ^^ + How would you translate this message into Spanish? + + File: msg.c + Call: error(_(test ? "abc" : "def")) + Message: abc + + How would you translate this message into Spanish? + + File: msg.c + Call: error(_(xxx "abc" "def")) + Message: abcdef + + How would you translate this message into Spanish? + + File: z.c + Call: error(_("You found me!")) + Message: You found me! + + How would you translate this message into Spanish? + + File: cairo/bedfellows.c + Call: _( + "any new message") + Message: any new message + + How would you translate this message into Spanish? + +--- + + Code + translate_package(languages = "es", max_translations = 1L, diagnostics = NULL) + Message + Generating en@quot translations + Output + Thanks! Who should be credited with these translations? + And what is their email? + + File: foo.R + Call: base::warning("I warned you!") + Message: I warned you! + + How would you translate this message into Spanish? + diff --git a/tests/testthat/helpers.R b/tests/testthat/helpers.R index 4f7ca876..a67a5109 100644 --- a/tests/testthat/helpers.R +++ b/tests/testthat/helpers.R @@ -11,9 +11,9 @@ with_package <- function(dir, expr, msg_conn = NULL) { expr } -with_restoration_test_that <- function(pkg, desc, code, conn = NULL) { +with_restoration_test_that <- function(desc, pkg, code, conn = NULL) { pkg <- test_package(pkg) - conn <- mock_translation(conn) + if (!is.null(conn)) conn <- mock_translation(conn) with_package(pkg, code, conn) } @@ -45,4 +45,4 @@ expect_messages = function(expr, msgs, ..., invert=FALSE) { } test_package = function(pkg) test_path(file.path("test_packages", pkg)) -mock_translation = function(mocks) test_path(file.path("mock_translations", mocks)) +mock_translation = function(mocks) normalizePath(test_path(file.path("mock_translations", mocks))) diff --git a/tests/testthat/test-translate-package.R b/tests/testthat/test-translate-package.R index 3aae88d3..91623d40 100644 --- a/tests/testthat/test-translate-package.R +++ b/tests/testthat/test-translate-package.R @@ -24,28 +24,26 @@ with_restoration_test_that("translate_package handles empty packages", "no_msg", expect_snapshot(translate_package(verbose=TRUE)) }) -with_restoration_test_that("translate_package handles a data package (no R dir)", "r_data_package", { +with_restoration_test_that("translate_package handles a data package (no R dir)", "r_data_pkg", { expect_snapshot(translate_package(verbose=TRUE)) }) with_restoration_test_that("translate_package works on a simple package w/o translating", "r_msg", { - expect_snapshot({ - expect_snapshot(translate_package(verbose = TRUE)) - - pkg_files <- list.files(recursive=TRUE) - - pot_file <- "po/R-rMsg.pot" - expect_true(pot_file %in% pkg_files) - # testing gettextf's ... arguments are skipped - expect_all_match(readLines(file.path(pot_file)), "don't translate me", invert=TRUE, fixed=TRUE) - - # Non-UTF-8 machines don't run en@quot translations by default. - # Mostly applies to Windows, but can also apply to Unix - # (e.g. r-devel-linux-x86_64-debian-clang on CRAN), #191 - if (l10n_info()[["UTF-8"]]) { - expect_match(pkg_files, "inst/po/en@quot/LC_MESSAGES/R-rMsg.mo", all = FALSE) - } - }) + expect_snapshot(translate_package(verbose = TRUE)) + + pkg_files <- list.files(recursive=TRUE) + + pot_file <- "po/R-rMsg.pot" + expect_true(pot_file %in% pkg_files) + # testing gettextf's ... arguments are skipped + expect_all_match(readLines(file.path(pot_file)), "don't translate me", invert=TRUE, fixed=TRUE) + + # Non-UTF-8 machines don't run en@quot translations by default. + # Mostly applies to Windows, but can also apply to Unix + # (e.g. r-devel-linux-x86_64-debian-clang on CRAN), #191 + if (l10n_info()[["UTF-8"]]) { + expect_match(pkg_files, "inst/po/en@quot/LC_MESSAGES/R-rMsg.mo", all = FALSE) + } }) with_restoration_test_that( @@ -108,7 +106,7 @@ with_restoration_test_that( pkg = "r_msg", conn = "test-translate-package-r_msg-5.input", # Catalan -- romance language with >1 plural - code = expect_snapshot(translate_package('ca', diagnostics=NULL)) + code = expect_snapshot(translate_package(languages='ca', diagnostics=NULL)) ) with_restoration_test_that( @@ -179,7 +177,7 @@ with_restoration_test_that( "Packages with src code & fuzzy messages work", pkg = "r_src_fuzzy", conn = 'test-translate-package-r_src_fuzzy-1.input', - code = expect_snapshot(translate_package(langauges="zh_CN", verbose=TRUE)) + code = expect_snapshot(translate_package(languages="zh_CN", verbose=TRUE)) ) # TODO: separate get_message_data() tests from write_po_files() tests here @@ -260,7 +258,7 @@ with_restoration_test_that( pkg = "unusual_msg", conn = "test-translate-package-unusual_msg-1.input", { - translate_package(languages="es", copyright="Mata Hari", diagnostics=NULL) + expect_snapshot(translate_package(languages="es", copyright="Mata Hari", diagnostics=NULL)) r_pot_lines <- readLines(file.path("po", "R-rMsgUnusual.pot")) src_pot_lines <- readLines(file.path("po", "rMsgUnusual.pot")) @@ -300,7 +298,7 @@ with_restoration_test_that( pkg = "unusual_msg", conn = "test-translate-package-unusual_msg-1.input", { - translate_package(languages = "es", use_base_rules = TRUE, diagnostics = NULL) + expect_snapshot(translate_package(languages = "es", use_base_rules = TRUE, diagnostics = NULL)) r_pot_lines <- readLines(file.path("po", "R-rMsgUnusual.pot")) src_pot_lines <- readLines(file.path("po", "rMsgUnusual.pot")) @@ -381,7 +379,7 @@ with_restoration_test_that( ) # NB: this is _mostly_ about get_message_data(), but we also test the correct R.pot file is created -test_that( +with_restoration_test_that( "translation of 'base' works correctly", pkg = "r-devel", { From 1578f9b0d8b69171b84879c4d8ff986abff47671 Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Mon, 8 Nov 2021 20:24:12 -0800 Subject: [PATCH 03/22] add mockery to Suggests for tests --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 6399a063..d3dfb287 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -5,7 +5,7 @@ Version: 0.2.3 Author: Michael Chirico Depends: R (>= 4.0.0) Imports: data.table -Suggests: crayon, knitr, rmarkdown, testthat (>= 3.0.0) +Suggests: crayon, knitr, mockery, rmarkdown, testthat (>= 3.0.0) SystemRequirements: gettext Maintainer: Michael Chirico Description: Translating messages in R packages is managed using the po top-level directory and the 'gettext' program. This package provides some helper functions for building this support in R packages, e.g. common validation & I/O tasks. From 2f722c01edb43b7fb5b91e8ff3a9d80a325c9ca1 Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Mon, 8 Nov 2021 20:24:40 -0800 Subject: [PATCH 04/22] use local path to stabilize output on tests --- R/find_fuzzy_messages.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/find_fuzzy_messages.R b/R/find_fuzzy_messages.R index 6ae96254..d0955f82 100644 --- a/R/find_fuzzy_messages.R +++ b/R/find_fuzzy_messages.R @@ -2,7 +2,7 @@ find_fuzzy_messages <- function(message_data, lang_file) { old_message_data = get_po_messages(lang_file) if (any(idx <- old_message_data$fuzzy == 2L)) { - messagef('Found %d translations marked as deprecated in %s.', sum(idx), lang_file) + messagef('Found %d translations marked as deprecated in ./po/%s.', sum(idx), basename(lang_file)) message('Typically, this means the corresponding error messages have been refactored.') message('Reproducing these messages here for your reference since they might still provide some utility.') From 8370e1309e61c29ed7a53a9c13840cd9442d4091 Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Mon, 8 Nov 2021 20:25:35 -0800 Subject: [PATCH 05/22] mocked out test (not yet working) --- tests/testthat/helpers.R | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/testthat/helpers.R b/tests/testthat/helpers.R index a67a5109..d3347227 100644 --- a/tests/testthat/helpers.R +++ b/tests/testthat/helpers.R @@ -8,6 +8,7 @@ with_package <- function(dir, expr, msg_conn = NULL) { withr::local_options("__potools_testing_prompt_connection__" = msg_conn) } + mockery::stub(translate_package, "get_atime", function(...) "0000-01-01 00:00:00") expr } From de88cd89d66a98dd279e91ab16d1cf73562c2b1a Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Mon, 8 Nov 2021 20:37:48 -0800 Subject: [PATCH 06/22] migrate to system2() to capture stderr output, and improve GNU gettext() detection --- R/msgmerge.R | 32 ++++++++++++++++++++------------ R/utils.R | 5 +++++ 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/R/msgmerge.R b/R/msgmerge.R index 1b703618..79035c6c 100644 --- a/R/msgmerge.R +++ b/R/msgmerge.R @@ -1,8 +1,11 @@ # split off from tools::update_pkg_po() to only run the msgmerge & checkPoFile steps -run_msgmerge = function(po_file, pot_file) { - if (system(sprintf("msgmerge --update %s %s", po_file, shQuote(pot_file))) != 0L) { +run_msgmerge = function(po_file, pot_file, verbose) { + val = system2("msgmerge", c("--update", shQuote(po_file), shQuote(pot_file)), stderr = TRUE) + if (!identical(attr(val, "status", exact = TRUE), NULL)) { # nocov these warnings? i don't know how to trigger them as of this writing. - warningf("Running msgmerge on '%s' failed.", po_file) + warningf("Running msgmerge on '%s' failed:\n %s", po_file, paste(val, collapse = "\n")) + } else if (verbose) { + messagef("Running msgmerge on '%s' succeeded:\n %s", po_file, paste(val, collapse = "\n")) } res <- tools::checkPoFile(po_file, strictPlural = TRUE) @@ -14,19 +17,24 @@ run_msgmerge = function(po_file, pot_file) { } run_msgfmt = function(po_file, mo_file, verbose) { - use_stats <- if (verbose) '--statistics' else '' - # See #218. Solaris msgfmt doesn't support -c or --statistics - if (Sys.info()[["sysname"]] == "SunOS") { - cmd = sprintf("msgfmt -o %s %s", shQuote(mo_file), shQuote(po_file)) # nocov - } else { - cmd = sprintf("msgfmt -c %s -o %s %s", use_stats, shQuote(mo_file), shQuote(po_file)) + # See #218. Solaris msgfmt (non-GNU on CRAN) doesn't support --check or --statistics; + # see also https://bugs.r-project.org/show_bug.cgi?id=18150 + args = character() + if (is_gnu_gettext()) { + args = c("--check", if (verbose) '--statistics') } - if (system(cmd) != 0L) { + val = system2("msgfmt", c(args, "-o", shQuote(mo_file), shQuote(po_file)), stderr = TRUE) + if (!identical(attr(val, "status", exact = TRUE), NULL)) { warningf( - "running msgfmt on %s failed.\nHere is the po file:\n%s", - basename(po_file), paste(readLines(po_file), collapse = "\n"), + "running msgfmt on %s failed; output:\n %s\nHere is the po file:\n%s", + basename(po_file), paste(val, collapse = "\n"), paste(readLines(po_file), collapse = "\n"), immediate. = TRUE ) + } else if (verbose) { + messagef( + "running msgfmt on %s succeeded; output:\n %s", + basename(po_file), paste(val, collapse = "\n") + ) } return(invisible()) } diff --git a/R/utils.R b/R/utils.R index 7bbe332a..02b23c4e 100644 --- a/R/utils.R +++ b/R/utils.R @@ -156,3 +156,8 @@ get_lang_metadata = function(language) { } is_testing = function() identical(Sys.getenv("TESTTHAT"), "true") + +is_gnu_gettext = function() any(grepl("GNU gettext", system('gettext --version', intern=TRUE))) + +# wrapper function to facilitate mocking, else tests --> stochastic output +get_atime <- function(f) format(file.info(f, extra_cols = FALSE)$atime) From f6d6d087045ac7ae7a2241410769a58f28621abb Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Mon, 8 Nov 2021 20:38:17 -0800 Subject: [PATCH 07/22] improve mock-ability of translate_package() --- R/translate_package.R | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/R/translate_package.R b/R/translate_package.R index 3769ce29..dc17892b 100644 --- a/R/translate_package.R +++ b/R/translate_package.R @@ -44,7 +44,7 @@ translate_package = function( messagef( "Updating translation template for package '%s' (last updated %s)", package, - format(file.info(r_potfile)$atime) + get_atime(r_potfile) ) } else { messagef("Starting translations for package '%s'", package) @@ -110,11 +110,11 @@ translate_package = function( if (update && file.exists(lang_file)) { if (verbose) { messagef( - 'Found existing R translations for %s (%s/%s) in %s. Running msgmerge...', - language, metadata$full_name_eng, metadata$full_name_native, lang_file + 'Found existing R translations for %s (%s/%s) in ./po/%s. Running msgmerge...', + language, metadata$full_name_eng, metadata$full_name_native, basename(lang_file) ) } - run_msgmerge(lang_file, r_potfile) + run_msgmerge(lang_file, r_potfile, verbose) find_fuzzy_messages(message_data, lang_file) } else { @@ -125,11 +125,11 @@ translate_package = function( if (update && file.exists(lang_file)) { if (verbose) { messagef( - 'Found existing src translations for %s (%s/%s) in %s. Running msgmerge...', - language, metadata$full_name_eng, metadata$full_name_native, lang_file + 'Found existing src translations for %s (%s/%s) in ./po/%s. Running msgmerge...', + language, metadata$full_name_eng, metadata$full_name_native, basename(lang_file) ) } - run_msgmerge(lang_file, src_potfile) + run_msgmerge(lang_file, src_potfile, verbose) find_fuzzy_messages(message_data, lang_file) } else { From f85ab577770c1a8c43a223456d03473ab52e7d95 Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Mon, 8 Nov 2021 21:54:57 -0800 Subject: [PATCH 08/22] further improve re-testability --- R/msgmerge.R | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/R/msgmerge.R b/R/msgmerge.R index 79035c6c..fec3f72e 100644 --- a/R/msgmerge.R +++ b/R/msgmerge.R @@ -1,11 +1,11 @@ # split off from tools::update_pkg_po() to only run the msgmerge & checkPoFile steps run_msgmerge = function(po_file, pot_file, verbose) { - val = system2("msgmerge", c("--update", shQuote(po_file), shQuote(pot_file)), stderr = TRUE) + val = system2("msgmerge", c("--update", shQuote(po_file), shQuote(pot_file)), stdout = TRUE, stderr = TRUE) if (!identical(attr(val, "status", exact = TRUE), NULL)) { # nocov these warnings? i don't know how to trigger them as of this writing. - warningf("Running msgmerge on '%s' failed:\n %s", po_file, paste(val, collapse = "\n")) + warningf("Running msgmerge on './po/%s' failed:\n %s", basename(po_file), paste(val, collapse = "\n")) } else if (verbose) { - messagef("Running msgmerge on '%s' succeeded:\n %s", po_file, paste(val, collapse = "\n")) + messagef("Running msgmerge on './po/%s' succeeded:\n %s", basename(po_file), paste(val, collapse = "\n")) } res <- tools::checkPoFile(po_file, strictPlural = TRUE) @@ -23,7 +23,7 @@ run_msgfmt = function(po_file, mo_file, verbose) { if (is_gnu_gettext()) { args = c("--check", if (verbose) '--statistics') } - val = system2("msgfmt", c(args, "-o", shQuote(mo_file), shQuote(po_file)), stderr = TRUE) + val = system2("msgfmt", c(args, "-o", shQuote(mo_file), shQuote(po_file)), stdout = TRUE, stderr = TRUE) if (!identical(attr(val, "status", exact = TRUE), NULL)) { warningf( "running msgfmt on %s failed; output:\n %s\nHere is the po file:\n%s", @@ -66,7 +66,9 @@ update_en_quot_mo_files <- function(dir, verbose) { mo_dir <- file.path(dir, "inst", "po", "en@quot", "LC_MESSAGES") dir.create(mo_dir, recursive = TRUE, showWarnings = FALSE) for (pot_file in pot_files) { - po_file <- tempfile() + # don't use tempfile() -- want a static basename() to keep verbose output non-random + po_file <- file.path(tempdir(), if (startsWith(basename(pot_file), "R-")) "R-en@quot.po" else "en@quot.po") + on.exit(unlink(po_file)) # tools:::en_quote is blocked, but we still need it for now get("en_quote", envir=asNamespace("tools"))(pot_file, po_file) run_msgfmt( @@ -74,7 +76,6 @@ update_en_quot_mo_files <- function(dir, verbose) { mo_file = file.path(mo_dir, gsub("\\.pot$", ".mo", basename(pot_file))), verbose = verbose ) - unlink(po_file) } return(invisible()) } From a0e1997e20e151a16bf6ad2485e671ff28533411 Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Mon, 8 Nov 2021 22:03:48 -0800 Subject: [PATCH 09/22] now succeeding locally --- tests/testthat/_snaps/translate-package.md | 186 +-- .../testthat/_snaps/translate-package.new.md | 1389 ----------------- tests/testthat/helpers.R | 1 - tests/testthat/test-translate-package.R | 17 +- 4 files changed, 109 insertions(+), 1484 deletions(-) delete mode 100644 tests/testthat/_snaps/translate-package.new.md diff --git a/tests/testthat/_snaps/translate-package.md b/tests/testthat/_snaps/translate-package.md index e3c35683..1cefc077 100644 --- a/tests/testthat/_snaps/translate-package.md +++ b/tests/testthat/_snaps/translate-package.md @@ -34,7 +34,7 @@ Code translate_package(verbose = TRUE) Message - Updating translation template for package 'rMsg' (last updated 2021-11-07 23:42:57) + Updating translation template for package 'rMsg' (last updated 0000-01-01 00:00:00) Message Getting R-level messages... Message @@ -45,6 +45,9 @@ Generating .pot files... Message Generating en@quot translations + Message + running msgfmt on R-en@quot.po succeeded; output: + 5 translated messages. Message No languages provided; finishing @@ -53,7 +56,7 @@ Code translate_package(languages = "zh_CN", verbose = TRUE) Message - Updating translation template for package 'rMsg' (last updated 2021-11-07 23:42:58) + Updating translation template for package 'rMsg' (last updated 0000-01-01 00:00:00) Message Getting R-level messages... Message @@ -64,6 +67,9 @@ Generating .pot files... Message Generating en@quot translations + Message + running msgfmt on R-en@quot.po succeeded; output: + 5 translated messages. Message Beginning new translations for zh_CN (Mainland Chinese/普通话); found 6 untranslated messages Message @@ -115,13 +121,19 @@ How would you translate this message into Mainland Chinese independently of n? Message "Installing" translations with msgfmt + Message + running msgfmt on R-fa.po succeeded; output: + 5 translated messages. + Message + running msgfmt on R-zh_CN.po succeeded; output: + 5 translated messages. --- Code translate_package(languages = "fa", verbose = TRUE) Message - Updating translation template for package 'rMsg' (last updated 2021-11-07 23:42:58) + Updating translation template for package 'rMsg' (last updated 0000-01-01 00:00:00) Message Getting R-level messages... Message @@ -133,18 +145,27 @@ Message Generating en@quot translations Message - Found existing R translations for fa (Farsi/فارسی) in /tmp/RtmpoWfRHo/file775e716e91bb/r_msg/po/R-fa.po. Running msgmerge... + running msgfmt on R-en@quot.po succeeded; output: + 5 translated messages. + Message + Found existing R translations for fa (Farsi/فارسی) in ./po/R-fa.po. Running msgmerge... + Message + Running msgmerge on './po/R-fa.po' succeeded: + ...... done. Message Translations for fa are up to date! Skipping. Message "Installing" translations with msgfmt + Message + running msgfmt on R-fa.po succeeded; output: + 5 translated messages. --- Code translate_package(languages = "zh_CN", verbose = TRUE) Message - Updating translation template for package 'rFuzzyMsg' (last updated 2021-11-07 23:42:59) + Updating translation template for package 'rFuzzyMsg' (last updated 0000-01-01 00:00:00) Message Getting R-level messages... Message @@ -156,9 +177,15 @@ Message Generating en@quot translations Message - Found existing R translations for zh_CN (Mainland Chinese/普通话) in /tmp/RtmpoWfRHo/file775e707d4657/r_fuzzy/po/R-zh_CN.po. Running msgmerge... + running msgfmt on R-en@quot.po succeeded; output: + 3 translated messages. Message - Found 2 translations marked as deprecated in /tmp/RtmpoWfRHo/file775e707d4657/r_fuzzy/po/R-zh_CN.po. + Found existing R translations for zh_CN (Mainland Chinese/普通话) in ./po/R-zh_CN.po. Running msgmerge... + Message + Running msgmerge on './po/R-zh_CN.po' succeeded: + ..... done. + Message + Found 2 translations marked as deprecated in ./po/R-zh_CN.po. Message Typically, this means the corresponding error messages have been refactored. Message @@ -219,6 +246,9 @@ How would you translate this message into Mainland Chinese independently of n? Message "Installing" translations with msgfmt + Message + running msgfmt on R-zh_CN.po succeeded; output: + 3 translated messages. --- @@ -259,6 +289,32 @@ translate_package(languages = "cy") Message Generating en@quot translations + Message + 'cy' is not a known language. + Message + Please help supply some metadata about it. You can check https://l10n.gnome.org/teams/ + Output + How would you refer to this language in English? + How would you refer to this language in the language itself? + How many pluralizations are there for this language [nplurals]? + Message + Input must be of type 'integer', but received 'character'. Trying again. + Output + How many pluralizations are there for this language [nplurals]? + What is the rule for deciding which plural applies as a function of n [plural]? + Message + Supplied 'plural': + (n==1) ? 0 : (n==2) ? 1 : (n != 8 && n != 11) ? 2 : 3 + Did not match any known 'plural's: + (n!=1) + (n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2) + (n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2) + (n>1) + 0 + n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5 + Using generic description of cases instead. + Message + Thanks! Please file an issue on GitHub to get this language recognized permanently Output Thanks! Who should be credited with these translations? And what is their email? @@ -288,51 +344,6 @@ How would you translate this message into Welsh? - ** Oops! Invalid translation -- received 0 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** - - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s - ^---^ ^^ ^^ - How would you translate this message into Welsh? - - - ** Oops! Invalid translation -- received 0 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** - - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s - ^---^ ^^ ^^ - How would you translate this message into Welsh? - - - ** Oops! Invalid translation -- received 0 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** - - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s - ^---^ ^^ ^^ - How would you translate this message into Welsh? - - - ** Oops! Invalid translation -- received 0 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** - - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s - ^---^ ^^ ^^ - How would you translate this message into Welsh? - - - ** Oops! Invalid translation -- received 0 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** - - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s - ^---^ ^^ ^^ - How would you translate this message into Welsh? - - ** Oops! Invalid translation -- received the same set of templates + bordering newlines, but in incorrect order ([%.02f, %d, %s] vs [%.02f, %s, %d]). Recall that you can use %$N to do redirect, e.g. to swap the order of '%d %s' to be translated more naturally, your translation can use '%1$s %2$d'. Retrying... ** File: foo.R @@ -416,6 +427,17 @@ translate_package(languages = "ca", diagnostics = NULL) Message Generating en@quot translations + Message + 'ca' is not a known language. + Message + Please help supply some metadata about it. You can check https://l10n.gnome.org/teams/ + Output + How would you refer to this language in English? + How would you refer to this language in the language itself? + How many pluralizations are there for this language [nplurals]? + What is the rule for deciding which plural applies as a function of n [plural]? + Message + Thanks! Please file an issue on GitHub to get this language recognized permanently Output Thanks! Who should be credited with these translations? And what is their email? @@ -444,42 +466,6 @@ ^---^ ^^ ^^ How would you translate this message into Catalan? - - ** Oops! Invalid translation -- received 0 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** - - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s - ^---^ ^^ ^^ - How would you translate this message into Catalan? - - - ** Oops! Invalid translation -- received 0 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** - - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s - ^---^ ^^ ^^ - How would you translate this message into Catalan? - - - ** Oops! Invalid translation -- received 0 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** - - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s - ^---^ ^^ ^^ - How would you translate this message into Catalan? - - - ** Oops! Invalid translation -- received 0 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** - - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s - ^---^ ^^ ^^ - How would you translate this message into Catalan? - File: windows/bar.R Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") Plural message: small fail @@ -624,7 +610,7 @@ Code translate_package(languages = "zh_CN", verbose = TRUE) Message - Updating translation template for package 'rSrcFuzzyMsg' (last updated 2021-11-07 23:43:01) + Updating translation template for package 'rSrcFuzzyMsg' (last updated 0000-01-01 00:00:00) Message Getting R-level messages... Message @@ -636,9 +622,21 @@ Message Generating en@quot translations Message - Found existing R translations for zh_CN (Mainland Chinese/普通话) in /tmp/RtmpoWfRHo/file775e4758b448/r_src_fuzzy/po/R-zh_CN.po. Running msgmerge... + running msgfmt on R-en@quot.po succeeded; output: + 1 translated message. Message - Found existing src translations for zh_CN (Mainland Chinese/普通话) in /tmp/RtmpoWfRHo/file775e4758b448/r_src_fuzzy/po/zh_CN.po. Running msgmerge... + running msgfmt on en@quot.po succeeded; output: + 2 translated messages. + Message + Found existing R translations for zh_CN (Mainland Chinese/普通话) in ./po/R-zh_CN.po. Running msgmerge... + Message + Running msgmerge on './po/R-zh_CN.po' succeeded: + .. done. + Message + Found existing src translations for zh_CN (Mainland Chinese/普通话) in ./po/zh_CN.po. Running msgmerge... + Message + Running msgmerge on './po/zh_CN.po' succeeded: + ..... done. Message Beginning new translations for zh_CN (Mainland Chinese/普通话); found 2 untranslated messages Message @@ -676,6 +674,12 @@ 当然%s %s\n Message "Installing" translations with msgfmt + Message + running msgfmt on R-zh_CN.po succeeded; output: + 1 translated message. + Message + running msgfmt on zh_CN.po succeeded; output: + 2 translated messages. --- diff --git a/tests/testthat/_snaps/translate-package.new.md b/tests/testthat/_snaps/translate-package.new.md deleted file mode 100644 index dfe00a44..00000000 --- a/tests/testthat/_snaps/translate-package.new.md +++ /dev/null @@ -1,1389 +0,0 @@ -# translate_package arg checking errors work - - Code - translate_package() - ---- - - Code - translate_package(verbose = TRUE) - Message - Starting translations for package 'noMsg' - Message - Getting R-level messages... - Message - Getting src-level messages... - Message - No messages to translate; finishing - ---- - - Code - translate_package(verbose = TRUE) - Message - Starting translations for package 'rDataPkg' - Message - Getting R-level messages... - Message - Getting src-level messages... - Message - No messages to translate; finishing - ---- - - Code - translate_package(verbose = TRUE) - Message - Updating translation template for package 'rMsg' (last updated 2021-11-07 23:43:58) - Message - Getting R-level messages... - Message - Getting src-level messages... - Message - Running message diagnostics... - Message - Generating .pot files... - Message - Generating en@quot translations - Message - No languages provided; finishing - ---- - - Code - translate_package(languages = "zh_CN", verbose = TRUE) - Message - Updating translation template for package 'rMsg' (last updated 2021-11-07 23:43:58) - Message - Getting R-level messages... - Message - Getting src-level messages... - Message - Running message diagnostics... - Message - Generating .pot files... - Message - Generating en@quot translations - Message - Beginning new translations for zh_CN (Mainland Chinese/普通话); found 6 untranslated messages - Message - (To quit translating, press 'Esc'; progress will be saved) - Output - Thanks! Who should be credited with these translations? - And what is their email? - Message - *************************** - ** BEGINNING TRANSLATION ** - *************************** - - Some helpful reminders: - * You can skip a translation by entering nothing (just press RETURN) - * Special characters (like newlines, \n, or tabs, \t) should be written just like that (with an escape) - * Be sure to match message templates. The count of templates (%s, %d, etc.) must match in all languages, as must initial and terminal newlines (\n) - * While the count of templates must match, the _order_ can be changed by using e.g. %2$s to mean 'use the second input as a string here' - * Whenever templates or escaping is happening in a string, these will be 'highlighted' by carets (^) in the line below - Output - - File: foo.R - Call: base::warning("I warned you!") - Message: I warned you! - - How would you translate this message into Mainland Chinese? - - File: foo.R - Call: stop("Oh no you don't!") - Message: Oh no you don't! - - How would you translate this message into Mainland Chinese? - - File: foo.R - Call: gettext("Hi there") - Message: Hi there - - How would you translate this message into Mainland Chinese? - - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s - ^---^ ^^ ^^ - How would you translate this message into Mainland Chinese? - - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") - Plural message: small fail - - How would you translate this message into Mainland Chinese independently of n? - Message - "Installing" translations with msgfmt - ---- - - Code - translate_package(languages = "fa", verbose = TRUE) - Message - Updating translation template for package 'rMsg' (last updated 2021-11-07 23:43:59) - Message - Getting R-level messages... - Message - Getting src-level messages... - Message - Running message diagnostics... - Message - Generating .pot files... - Message - Generating en@quot translations - Message - Found existing R translations for fa (Farsi/فارسی) in /tmp/RtmpoWfRHo/file775e3d8006a0/r_msg/po/R-fa.po. Running msgmerge... - Message - Translations for fa are up to date! Skipping. - Message - "Installing" translations with msgfmt - ---- - - Code - translate_package(languages = "zh_CN", verbose = TRUE) - Message - Updating translation template for package 'rFuzzyMsg' (last updated 2021-11-07 23:43:59) - Message - Getting R-level messages... - Message - Getting src-level messages... - Message - Running message diagnostics... - Message - Generating .pot files... - Message - Generating en@quot translations - Message - Found existing R translations for zh_CN (Mainland Chinese/普通话) in /tmp/RtmpoWfRHo/file775e149d1121/r_fuzzy/po/R-zh_CN.po. Running msgmerge... - Message - Found 2 translations marked as deprecated in /tmp/RtmpoWfRHo/file775e149d1121/r_fuzzy/po/R-zh_CN.po. - Message - Typically, this means the corresponding error messages have been refactored. - Message - Reproducing these messages here for your reference since they might still provide some utility. - Message - ** SINGULAR MESSAGES ** - Output - ---------------------------------------------------------------------------------- - Oh no you don't! - 当然不会! - Message - ** PLURAL MESSAGES ** - Output - ---------------------------------------------------------------------------------- - small fail\n - 失败了\n - ---------------------------------------------------------------------------------- - big fail\n - 失败了\n - Message - Beginning new translations for zh_CN (Mainland Chinese/普通话); found 3 untranslated messages - Message - (To quit translating, press 'Esc'; progress will be saved) - Output - Thanks! Who should be credited with these translations? - And what is their email? - Message - *************************** - ** BEGINNING TRANSLATION ** - *************************** - - Some helpful reminders: - * You can skip a translation by entering nothing (just press RETURN) - * Special characters (like newlines, \n, or tabs, \t) should be written just like that (with an escape) - * Be sure to match message templates. The count of templates (%s, %d, etc.) must match in all languages, as must initial and terminal newlines (\n) - * While the count of templates must match, the _order_ can be changed by using e.g. %2$s to mean 'use the second input as a string here' - * Whenever templates or escaping is happening in a string, these will be 'highlighted' by carets (^) in the line below - Output - - File: foo.R - Call: warning("I warned you!!") - Message: I warned you!! - - How would you translate this message into Mainland Chinese? - **Note: a similar message was previously translated as: ** - 已经告诉你! - - File: foo.R - Call: stop("I really wish you'd reconsider") - Message: I really wish you'd reconsider - - How would you translate this message into Mainland Chinese? - - File: foo.R - Call: ngettext(length(x), "SOMEWHAT EPIC FAIL", "MAJORLY EPIC FAIL") - Plural message: SOMEWHAT EPIC FAIL - - How would you translate this message into Mainland Chinese independently of n? - Message - "Installing" translations with msgfmt - ---- - - Code - translate_package(languages = "zh_CN") - Message - Found 4 untranslated messaging calls passed through cat(): - Output - - Problematic call: - base::cat("I warned you!", fill=TRUE, append=TRUE) - < File:foo.R, Line:2 > - Potential replacement: - cat(gettext("I warned you!"), fill=TRUE) - - Problematic call: - cat("Oh no", "you\ndon't!") - < File:foo.R, Line:8 > - Potential replacement: - cat(gettext("Oh no you\ndon't!")) - - Problematic call: - cat("Hi", "boss", sep="xx") - < File:foo.R, Line:15 > - Potential replacement: - cat(gettext("Hixxboss")) - - Problematic call: - cat("This costs", x, "dollars") - < File:foo.R, Line:22 > - Potential replacement: - cat(gettextf("This costs %s dollars", x)) - Exit now to repair any of these? [y/N] - ---- - - Code - translate_package(languages = "cy") - Message - Generating en@quot translations - Output - Thanks! Who should be credited with these translations? - And what is their email? - - File: foo.R - Call: base::warning("I warned you!") - Message: I warned you! - - How would you translate this message into Welsh? - - File: foo.R - Call: stop("Oh no you don't!") - Message: Oh no you don't! - - How would you translate this message into Welsh? - - File: foo.R - Call: gettext("Hi there") - Message: Hi there - - How would you translate this message into Welsh? - - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s - ^---^ ^^ ^^ - How would you translate this message into Welsh? - - - ** Oops! Invalid translation -- received 0 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** - - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s - ^---^ ^^ ^^ - How would you translate this message into Welsh? - - - ** Oops! Invalid translation -- received 0 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** - - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s - ^---^ ^^ ^^ - How would you translate this message into Welsh? - - - ** Oops! Invalid translation -- received 0 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** - - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s - ^---^ ^^ ^^ - How would you translate this message into Welsh? - - - ** Oops! Invalid translation -- received 0 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** - - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s - ^---^ ^^ ^^ - How would you translate this message into Welsh? - - - ** Oops! Invalid translation -- received 0 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** - - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s - ^---^ ^^ ^^ - How would you translate this message into Welsh? - - - ** Oops! Invalid translation -- received the same set of templates + bordering newlines, but in incorrect order ([%.02f, %d, %s] vs [%.02f, %s, %d]). Recall that you can use %$N to do redirect, e.g. to swap the order of '%d %s' to be translated more naturally, your translation can use '%1$s %2$d'. Retrying... ** - - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s - ^---^ ^^ ^^ - How would you translate this message into Welsh? - - - ** Oops! Invalid translation -- received templates + bordering newlines not present in the original: %s. Retrying... ** - - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s - ^---^ ^^ ^^ - How would you translate this message into Welsh? - - - ** Oops! Invalid translation -- received the same set of templates + bordering newlines, but in incorrect order ([%.02f, %d, %s] vs [%1$.02f, %2$s, %3$d]). Recall that you can use %$N to do redirect, e.g. to swap the order of '%d %s' to be translated more naturally, your translation can use '%1$s %2$d'. Retrying... ** - - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s - ^---^ ^^ ^^ - How would you translate this message into Welsh? - - - ** Oops! Invalid translation -- received 2 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** - - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s - ^---^ ^^ ^^ - How would you translate this message into Welsh? - - - ** Oops! Invalid translation -- received 4 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** - - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s - ^---^ ^^ ^^ - How would you translate this message into Welsh? - - - ** Oops! Invalid translation -- received 5 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** - - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s - ^---^ ^^ ^^ - How would you translate this message into Welsh? - - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") - Plural message: small fail - - How would you translate this message into Welsh for n where 'plural' resolves to 0? - - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") - Plural message: small fail - - How would you translate this message into Welsh for n where 'plural' resolves to 1? - - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") - Plural message: small fail - - How would you translate this message into Welsh for n where 'plural' resolves to 2? - - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") - Plural message: small fail - - How would you translate this message into Welsh for n where 'plural' resolves to 3? - ---- - - Code - translate_package(languages = "ca", diagnostics = NULL) - Message - Generating en@quot translations - Output - Thanks! Who should be credited with these translations? - And what is their email? - - File: foo.R - Call: base::warning("I warned you!") - Message: I warned you! - - How would you translate this message into Catalan? - - File: foo.R - Call: stop("Oh no you don't!") - Message: Oh no you don't! - - How would you translate this message into Catalan? - - File: foo.R - Call: gettext("Hi there") - Message: Hi there - - How would you translate this message into Catalan? - - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s - ^---^ ^^ ^^ - How would you translate this message into Catalan? - - - ** Oops! Invalid translation -- received 0 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** - - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s - ^---^ ^^ ^^ - How would you translate this message into Catalan? - - - ** Oops! Invalid translation -- received 0 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** - - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s - ^---^ ^^ ^^ - How would you translate this message into Catalan? - - - ** Oops! Invalid translation -- received 0 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** - - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s - ^---^ ^^ ^^ - How would you translate this message into Catalan? - - - ** Oops! Invalid translation -- received 0 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** - - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s - ^---^ ^^ ^^ - How would you translate this message into Catalan? - - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") - Plural message: small fail - - How would you translate this message into Catalan when n = 1? - - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") - Plural message: small fail - - How would you translate this message into Catalan when n is not 1? - ---- - - Code - translate_package(languages = "zh_CN", diagnostics = NULL) - Message - Generating en@quot translations - Output - Thanks! Who should be credited with these translations? - And what is their email? - - File: foo.R - Call: base::warning("I warned you!") - Message: I warned you! - - How would you translate this message into Mainland Chinese? - - File: foo.R - Call: stop("Oh no you don't!") - Message: Oh no you don't! - - How would you translate this message into Mainland Chinese? - - File: foo.R - Call: gettext("Hi there") - Message: Hi there - - How would you translate this message into Mainland Chinese? - - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s - ^---^ ^^ ^^ - How would you translate this message into Mainland Chinese? - Error - Invalid templated message. If any %N$ redirects are used, all templates must be redirected. - Redirected tempates: %1$d - Un-redirected templates: %d - ---- - - Code - translate_package(languages = "zh_CN", diagnostics = NULL) - Message - Generating en@quot translations - Output - Thanks! Who should be credited with these translations? - And what is their email? - - File: foo.R - Call: base::warning("I warned you!") - Message: I warned you! - - How would you translate this message into Mainland Chinese? - - File: foo.R - Call: stop("Oh no you don't!") - Message: Oh no you don't! - - How would you translate this message into Mainland Chinese? - - File: foo.R - Call: gettext("Hi there") - Message: Hi there - - How would you translate this message into Mainland Chinese? - - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s - ^---^ ^^ ^^ - How would you translate this message into Mainland Chinese? - Error - Invalid templated message string with redirects -- all messages pointing to the same input must have identical formats, but received [%1$s, %1$d] - ---- - - Code - translate_package(languages = "zh_CN", diagnostics = check_untranslated_src) - Message - Generating en@quot translations - Output - Thanks! Who should be credited with these translations? - And what is their email? - - File: foo.R - Call: message("a string") - Message: a string - - How would you translate this message into Mainland Chinese? - - File: bar.c - Call: N_("Don't translate me now.") - Message: Don't translate me now. - - How would you translate this message into Mainland Chinese? - - File: bar.c - Call: Rprintf(_("an translated templated string: %" "" "\n"), 10000LL) - Message: an translated templated string: %\n - ^-------^^^ - How would you translate this message into Mainland Chinese? - - File: bar.c - Call: warning(_("a translated "\ - "warning: %s\n"), stardust(z)) - Message: a translated warning: %s\n - ^^^^ - How would you translate this message into Mainland Chinese? - - File: bar.c - Call: snprintf(BUF, 100, _("a simple message")) - Message: a simple message - - How would you translate this message into Mainland Chinese? - - File: bar.c - Call: ngettext("singular", "plural", z) - Plural message: singular - - How would you translate this message into Mainland Chinese independently of n? - - File: bar.c - Call: ngettext("singular %d", "plural %d", z) - Plural message: singular %d - ^^ - How would you translate this message into Mainland Chinese independently of n? - ---- - - Code - translate_package(languages = "zh_CN", verbose = TRUE) - Message - Updating translation template for package 'rSrcFuzzyMsg' (last updated 2021-11-07 23:44:02) - Message - Getting R-level messages... - Message - Getting src-level messages... - Message - Running message diagnostics... - Message - Generating .pot files... - Message - Generating en@quot translations - Message - Found existing R translations for zh_CN (Mainland Chinese/普通话) in /tmp/RtmpoWfRHo/file775e320132b2/r_src_fuzzy/po/R-zh_CN.po. Running msgmerge... - Message - Found existing src translations for zh_CN (Mainland Chinese/普通话) in /tmp/RtmpoWfRHo/file775e320132b2/r_src_fuzzy/po/zh_CN.po. Running msgmerge... - Message - Beginning new translations for zh_CN (Mainland Chinese/普通话); found 2 untranslated messages - Message - (To quit translating, press 'Esc'; progress will be saved) - Output - Thanks! Who should be credited with these translations? - And what is their email? - Message - *************************** - ** BEGINNING TRANSLATION ** - *************************** - - Some helpful reminders: - * You can skip a translation by entering nothing (just press RETURN) - * Special characters (like newlines, \n, or tabs, \t) should be written just like that (with an escape) - * Be sure to match message templates. The count of templates (%s, %d, etc.) must match in all languages, as must initial and terminal newlines (\n) - * While the count of templates must match, the _order_ can be changed by using e.g. %2$s to mean 'use the second input as a string here' - * Whenever templates or escaping is happening in a string, these will be 'highlighted' by carets (^) in the line below - Output - - File: src.c - Call: error(_("I really wish you'd do something else")) - Message: I really wish you'd do something else - - How would you translate this message into Mainland Chinese? - **Note: a similar message was previously translated as: ** - 失败了 - - File: src.c - Call: Rprintf(_("Here's what is wrong: %s %s\n"), "a", "b") - Message: Here's what is wrong: %s %s\n - ^^ ^^^^ - How would you translate this message into Mainland Chinese? - **Note: a similar message was previously translated as: ** - 当然%s %s\n - Message - "Installing" translations with msgfmt - ---- - - Code - translate_package(languages = "es", copyright = "Mata Hari", diagnostics = NULL) - Message - Generating en@quot translations - Output - Thanks! Who should be credited with these translations? - And what is their email? - - File: copy1.R - Call: stop("copy one") - Message: copy one - - How would you translate this message into Spanish? - - File: copy2.R - Call: stop("copy two") - Message: copy two - - How would you translate this message into Spanish? - - File: foo.R - Call: base::warning(" I warned you!\n\n") - Message: I warned you! - - How would you translate this message into Spanish? - - File: foo.R - Call: message(r"('abc')") - Message: 'abc' - - How would you translate this message into Spanish? - - File: foo.R - Call: message(R'("def")') - Message: "def" - - How would you translate this message into Spanish? - - File: foo.R - Call: message("R('abc')") - Message: R('abc') - - How would you translate this message into Spanish? - - File: foo.R - Call: message('r("def")') - Message: r("def") - - How would you translate this message into Spanish? - - File: foo.R - Call: message(R'---[ghi]---') - Message: ghi - - How would you translate this message into Spanish? - - File: foo.R - Call: gettext("Hi there") - Message: Hi there - - How would you translate this message into Spanish? - - File: foo.R - Call: gettextf(fmt = "good %s ", "grief") - Message: good %s - ^^ - How would you translate this message into Spanish? - - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: "first" - - How would you translate this message into Spanish? - - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: second - - How would you translate this message into Spanish? - - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: third - - How would you translate this message into Spanish? - - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: fourth - - How would you translate this message into Spanish? - - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: fifth - - How would you translate this message into Spanish? - - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: sixth - - How would you translate this message into Spanish? - - File: foo.R - Call: message("\\n vs \n is OK") - Message: \\n vs \n is OK - - How would you translate this message into Spanish? - - File: foo.R - Call: message("\\t vs \t is OK") - Message: \\t vs \t is OK - - How would you translate this message into Spanish? - - File: foo.R - Call: message('strings with "quotes" are OK') - Message: strings with "quotes" are OK - - How would you translate this message into Spanish? - - File: foo.R - Call: message("strings with escaped \"quotes\" are OK") - Message: strings with escaped "quotes" are OK - - How would you translate this message into Spanish? - - File: foo.R - Call: gettextf( paste("part 1 %s", "part 2"), "input" ) - Message: part 1 %s - ^^ - How would you translate this message into Spanish? - - File: foo.R - Call: gettextf( paste("part 1 %s", "part 2"), "input" ) - Message: part 2 - - How would you translate this message into Spanish? - - File: foo.R - Call: ngettext( 10, "singular ", "plural " ) - Plural message: singular  - - How would you translate this message into Spanish when n = 1? - - File: foo.R - Call: ngettext( 10, "singular ", "plural " ) - Plural message: singular  - - How would you translate this message into Spanish when n is not 1? - - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail ", msg2 = "big fail ") - Plural message: small fail  - - How would you translate this message into Spanish when n = 1? - - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail ", msg2 = "big fail ") - Plural message: small fail  - - How would you translate this message into Spanish when n is not 1? - - File: ABCDEFGHIJKLMNOPQRSTUVWXYZ.c - Call: _("an translated templated string: %" "" "\n") - Message: an translated templated string: %\n - ^-------^^^ - How would you translate this message into Spanish? - - File: MSGs.c - Call: _("any old \ - message") - Message: any old message - - How would you translate this message into Spanish? - - File: msg.c - Call: _("a message in a macro %s") - Message: a message in a macro %s - ^^ - How would you translate this message into Spanish? - - File: msg.c - Call: Rprintf(_("that's a mighty big %" """-sized wall over %"""), 100LL, 10L) - Message: that's a mighty big %-sized wall over % - ^-------^ ^-------^ - How would you translate this message into Spanish? - - File: msg.c - Call: Rprintf(_("/* this is what a C comment looks like */ ")) - Message: /* this is what a C comment looks like */  - - How would you translate this message into Spanish? - - File: msg.c - Call: Rprintf(_("// this is what a C comment looks like %s "), "abc") - Message: // this is what a C comment looks like %s  - ^^ - How would you translate this message into Spanish? - - File: msg.c - Call: Rprintf(_( - "01234567890123456789.01234567890123456789" - "01234567890123456789.01234567890123456789" - "01234567890123456789.01234567890123456789" - "01234567890123456789.01234567890123456789" - )) - Message: 01234567890123456789.0123456789012345678901234567890123456789.0123456789012345678901234567890123456789.0123456789012345678901234567890123456789.01234567890123456789 - - How would you translate this message into Spanish? - - File: msg.c - Call: error(_("This message\nSpans two lines")) - Message: This message\nSpans two lines - - How would you translate this message into Spanish? - - File: msg.c - Call: error(_("This one does not\n")) - Message: This one does not\n - ^^ - How would you translate this message into Spanish? - - File: msg.c - Call: error(_("Exotic formatters like %I32u, %llx, %li, %ls, %lc")) - Message: Exotic formatters like %I32u, %llx, %li, %ls, %lc - ^---^ ^--^ ^-^ ^-^ ^-^ - How would you translate this message into Spanish? - - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456\"890")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456"890 - - How would you translate this message into Spanish? - - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345(\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345("890 - - How would you translate this message into Spanish? - - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345'\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345'"890 - - How would you translate this message into Spanish? - - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345a\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345a"890 - - How would you translate this message into Spanish? - - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345A\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345A"890 - - How would you translate this message into Spanish? - - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345#\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345#"890 - - How would you translate this message into Spanish? - - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345@\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345@"890 - - How would you translate this message into Spanish? - - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 .%s.")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 .%s. - ^^ - How would you translate this message into Spanish? - - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 ?%s?")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 ?%s? - ^^ - How would you translate this message into Spanish? - - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 ;%s;")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 ;%s; - ^^ - How would you translate this message into Spanish? - - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 /%s/")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 /%s/ - ^^ - How would you translate this message into Spanish? - - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 '%s'")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 '%s' - ^^ - How would you translate this message into Spanish? - - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 [%s]")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 [%s] - ^^ - How would you translate this message into Spanish? - - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 |%s|")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 |%s| - ^^ - How would you translate this message into Spanish? - - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 -%s-")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 -%s- - ^^ - How would you translate this message into Spanish? - - File: msg.c - Call: error(_(test ? "abc" : "def")) - Message: abc - - How would you translate this message into Spanish? - - File: msg.c - Call: error(_(xxx "abc" "def")) - Message: abcdef - - How would you translate this message into Spanish? - - File: z.c - Call: error(_("You found me!")) - Message: You found me! - - How would you translate this message into Spanish? - - File: cairo/bedfellows.c - Call: _( - "any new message") - Message: any new message - - How would you translate this message into Spanish? - ---- - - Code - translate_package(languages = "es", use_base_rules = TRUE, diagnostics = NULL) - Message - Generating en@quot translations - Output - Thanks! Who should be credited with these translations? - And what is their email? - - File: copy1.R - Call: stop("copy one") - Message: copy one - - How would you translate this message into Spanish? - - File: copy2.R - Call: stop("copy two") - Message: copy two - - How would you translate this message into Spanish? - - File: foo.R - Call: base::warning(" I warned you!\n\n") - Message: I warned you! - - How would you translate this message into Spanish? - - File: foo.R - Call: message(r"('abc')") - Message: 'abc' - - How would you translate this message into Spanish? - - File: foo.R - Call: message(R'("def")') - Message: "def" - - How would you translate this message into Spanish? - - File: foo.R - Call: message("R('abc')") - Message: R('abc') - - How would you translate this message into Spanish? - - File: foo.R - Call: message('r("def")') - Message: r("def") - - How would you translate this message into Spanish? - - File: foo.R - Call: message(R'---[ghi]---') - Message: ghi - - How would you translate this message into Spanish? - - File: foo.R - Call: gettext("Hi there") - Message: Hi there - - How would you translate this message into Spanish? - - File: foo.R - Call: gettextf(fmt = "good %s ", "grief") - Message: good %s - ^^ - How would you translate this message into Spanish? - - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: "first" - - How would you translate this message into Spanish? - - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: second - - How would you translate this message into Spanish? - - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: third - - How would you translate this message into Spanish? - - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: fourth - - How would you translate this message into Spanish? - - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: fifth - - How would you translate this message into Spanish? - - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: sixth - - How would you translate this message into Spanish? - - File: foo.R - Call: message("\\n vs \n is OK") - Message: \\n vs \n is OK - - How would you translate this message into Spanish? - - File: foo.R - Call: message("\\t vs \t is OK") - Message: \\t vs \t is OK - - How would you translate this message into Spanish? - - File: foo.R - Call: message('strings with "quotes" are OK') - Message: strings with "quotes" are OK - - How would you translate this message into Spanish? - - File: foo.R - Call: message("strings with escaped \"quotes\" are OK") - Message: strings with escaped "quotes" are OK - - How would you translate this message into Spanish? - - File: foo.R - Call: gettextf( paste("part 1 %s", "part 2"), "input" ) - Message: part 1 %s - ^^ - How would you translate this message into Spanish? - - File: foo.R - Call: gettextf( paste("part 1 %s", "part 2"), "input" ) - Message: part 2 - - How would you translate this message into Spanish? - - File: foo.R - Call: ngettext( 10, "singular ", "plural " ) - Plural message: singular  - - How would you translate this message into Spanish when n = 1? - - File: foo.R - Call: ngettext( 10, "singular ", "plural " ) - Plural message: singular  - - How would you translate this message into Spanish when n is not 1? - - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail ", msg2 = "big fail ") - Plural message: small fail  - - How would you translate this message into Spanish when n = 1? - - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail ", msg2 = "big fail ") - Plural message: small fail  - - How would you translate this message into Spanish when n is not 1? - - File: ABCDEFGHIJKLMNOPQRSTUVWXYZ.c - Call: _("an translated templated string: %" "" "\n") - Message: an translated templated string: %\n - ^-------^^^ - How would you translate this message into Spanish? - - File: MSGs.c - Call: _("any old \ - message") - Message: any old message - - How would you translate this message into Spanish? - - File: msg.c - Call: _("a message in a macro %s") - Message: a message in a macro %s - ^^ - How would you translate this message into Spanish? - - File: msg.c - Call: Rprintf(_("that's a mighty big %" """-sized wall over %"""), 100LL, 10L) - Message: that's a mighty big %-sized wall over % - ^-------^ ^-------^ - How would you translate this message into Spanish? - - File: msg.c - Call: Rprintf(_("/* this is what a C comment looks like */ ")) - Message: /* this is what a C comment looks like */  - - How would you translate this message into Spanish? - - File: msg.c - Call: Rprintf(_("// this is what a C comment looks like %s "), "abc") - Message: // this is what a C comment looks like %s  - ^^ - How would you translate this message into Spanish? - - File: msg.c - Call: Rprintf(_( - "01234567890123456789.01234567890123456789" - "01234567890123456789.01234567890123456789" - "01234567890123456789.01234567890123456789" - "01234567890123456789.01234567890123456789" - )) - Message: 01234567890123456789.0123456789012345678901234567890123456789.0123456789012345678901234567890123456789.0123456789012345678901234567890123456789.01234567890123456789 - - How would you translate this message into Spanish? - - File: msg.c - Call: error(_("This message\nSpans two lines")) - Message: This message\nSpans two lines - - How would you translate this message into Spanish? - - File: msg.c - Call: error(_("This one does not\n")) - Message: This one does not\n - ^^ - How would you translate this message into Spanish? - - File: msg.c - Call: error(_("Exotic formatters like %I32u, %llx, %li, %ls, %lc")) - Message: Exotic formatters like %I32u, %llx, %li, %ls, %lc - ^---^ ^--^ ^-^ ^-^ ^-^ - How would you translate this message into Spanish? - - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456\"890")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456"890 - - How would you translate this message into Spanish? - - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345(\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345("890 - - How would you translate this message into Spanish? - - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345'\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345'"890 - - How would you translate this message into Spanish? - - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345a\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345a"890 - - How would you translate this message into Spanish? - - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345A\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345A"890 - - How would you translate this message into Spanish? - - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345#\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345#"890 - - How would you translate this message into Spanish? - - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345@\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345@"890 - - How would you translate this message into Spanish? - - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 .%s.")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 .%s. - ^^ - How would you translate this message into Spanish? - - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 ?%s?")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 ?%s? - ^^ - How would you translate this message into Spanish? - - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 ;%s;")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 ;%s; - ^^ - How would you translate this message into Spanish? - - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 /%s/")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 /%s/ - ^^ - How would you translate this message into Spanish? - - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 '%s'")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 '%s' - ^^ - How would you translate this message into Spanish? - - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 [%s]")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 [%s] - ^^ - How would you translate this message into Spanish? - - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 |%s|")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 |%s| - ^^ - How would you translate this message into Spanish? - - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 -%s-")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 -%s- - ^^ - How would you translate this message into Spanish? - - File: msg.c - Call: error(_(test ? "abc" : "def")) - Message: abc - - How would you translate this message into Spanish? - - File: msg.c - Call: error(_(xxx "abc" "def")) - Message: abcdef - - How would you translate this message into Spanish? - - File: z.c - Call: error(_("You found me!")) - Message: You found me! - - How would you translate this message into Spanish? - - File: cairo/bedfellows.c - Call: _( - "any new message") - Message: any new message - - How would you translate this message into Spanish? - ---- - - Code - translate_package(languages = "es", max_translations = 1L, diagnostics = NULL) - Message - Generating en@quot translations - Output - Thanks! Who should be credited with these translations? - And what is their email? - - File: foo.R - Call: base::warning("I warned you!") - Message: I warned you! - - How would you translate this message into Spanish? - diff --git a/tests/testthat/helpers.R b/tests/testthat/helpers.R index d3347227..a67a5109 100644 --- a/tests/testthat/helpers.R +++ b/tests/testthat/helpers.R @@ -8,7 +8,6 @@ with_package <- function(dir, expr, msg_conn = NULL) { withr::local_options("__potools_testing_prompt_connection__" = msg_conn) } - mockery::stub(translate_package, "get_atime", function(...) "0000-01-01 00:00:00") expr } diff --git a/tests/testthat/test-translate-package.R b/tests/testthat/test-translate-package.R index 91623d40..b96011f6 100644 --- a/tests/testthat/test-translate-package.R +++ b/tests/testthat/test-translate-package.R @@ -29,6 +29,7 @@ with_restoration_test_that("translate_package handles a data package (no R dir)" }) with_restoration_test_that("translate_package works on a simple package w/o translating", "r_msg", { + mockery::stub(translate_package, "get_atime", "0000-01-01 00:00:00") expect_snapshot(translate_package(verbose = TRUE)) pkg_files <- list.files(recursive=TRUE) @@ -51,6 +52,7 @@ with_restoration_test_that( pkg = "r_msg", conn = "test-translate-package-r_msg-1.input", { + mockery::stub(translate_package, "get_atime", "0000-01-01 00:00:00") expect_snapshot(translate_package(languages="zh_CN", verbose=TRUE)) pkg_files <- list.files(recursive = TRUE) @@ -70,14 +72,20 @@ with_restoration_test_that( with_restoration_test_that( "translate package works for up-to-date translations", pkg = "r_msg", - code = expect_snapshot(translate_package(languages="fa", verbose=TRUE)) + code = { + mockery::stub(translate_package, "get_atime", "0000-01-01 00:00:00") + expect_snapshot(translate_package(languages="fa", verbose=TRUE)) + } ) with_restoration_test_that( "translate_package works on package with outdated (fuzzy) translations", pkg = "r_fuzzy", conn = "test-translate-package-r_fuzzy-1.input", - code = expect_snapshot(translate_package(languages="zh_CN", verbose=TRUE)) + code = { + mockery::stub(translate_package, "get_atime", "0000-01-01 00:00:00") + expect_snapshot(translate_package(languages="zh_CN", verbose=TRUE)) + } ) # NB: keep this test here (not in test-diagnostics) to keep coverage of the diagnostic flow in translate_package() @@ -177,7 +185,10 @@ with_restoration_test_that( "Packages with src code & fuzzy messages work", pkg = "r_src_fuzzy", conn = 'test-translate-package-r_src_fuzzy-1.input', - code = expect_snapshot(translate_package(languages="zh_CN", verbose=TRUE)) + code = { + mockery::stub(translate_package, "get_atime", "0000-01-01 00:00:00") + expect_snapshot(translate_package(languages="zh_CN", verbose=TRUE)) + } ) # TODO: separate get_message_data() tests from write_po_files() tests here From 430cb176a2604cf2378985598c61780006a47226 Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Mon, 8 Nov 2021 22:30:31 -0800 Subject: [PATCH 10/22] turn off colors for tests --- R/onLoad.R | 20 +- tests/testthat.R | 3 + tests/testthat/_snaps/translate-package.md | 1286 ++++++++++---------- 3 files changed, 655 insertions(+), 654 deletions(-) diff --git a/R/onLoad.R b/R/onLoad.R index 5870c072..aba34f02 100644 --- a/R/onLoad.R +++ b/R/onLoad.R @@ -20,20 +20,18 @@ globalVariables( ) .potools = new.env() - -if (requireNamespace('crayon', quietly = TRUE)) { - call_color = getOption('potools.call_color', crayon::green) - file_color = getOption('potools.file_color', crayon::white) - msgid_color = getOption('potools.msgid_color', crayon::red) - language_color = getOption('potools.language_color', crayon::cyan) - replacement_color = getOption('potools.replacement_color', crayon::blue) - plural_range_color = getOption('potools.plural_range_color', crayon::yellow) -} else { - call_color = file_color = msgid_color = language_color = replacement_color = plural_range_color = identity -} +call_color = file_color = msgid_color = language_color = replacement_color = plural_range_color = identity # nocov start .onLoad = function(libname, pkgname) { .potools$base_package_names = get(".get_standard_package_names", envir=asNamespace("tools"), mode="function")()$base + if (getOption('potools.use_colors', requireNamespace('crayon', quietly = TRUE))) { + utils::assignInMyNamespace("call_color", getOption('potools.call_color', crayon::green)) + utils::assignInMyNamespace("file_color", getOption('potools.file_color', crayon::white)) + utils::assignInMyNamespace("msgid_color", getOption('potools.msgid_color', crayon::red)) + utils::assignInMyNamespace("language_color", getOption('potools.language_color', crayon::cyan)) + utils::assignInMyNamespace("replacement_color", getOption('potools.replacement_color', crayon::blue)) + utils::assignInMyNamespace("plural_range_color", getOption('potools.plural_range_color', crayon::yellow)) + } } # nocov end diff --git a/tests/testthat.R b/tests/testthat.R index 7551cfa4..c5ce8753 100755 --- a/tests/testthat.R +++ b/tests/testthat.R @@ -1,4 +1,6 @@ +library(withr) library(testthat) +old = options(potools.use_colors = FALSE) library(potools) # Failed on Solaris because the command-line tools are missing there (which means tools doesn't work there), #186 @@ -8,3 +10,4 @@ if (isTRUE(check_potools_sys_reqs())) { } else { writeLines("Skipping tests on system without gettext installed") } +options(old) diff --git a/tests/testthat/_snaps/translate-package.md b/tests/testthat/_snaps/translate-package.md index 1cefc077..58578866 100644 --- a/tests/testthat/_snaps/translate-package.md +++ b/tests/testthat/_snaps/translate-package.md @@ -90,35 +90,35 @@ * Whenever templates or escaping is happening in a string, these will be 'highlighted' by carets (^) in the line below Output - File: foo.R - Call: base::warning("I warned you!") - Message: I warned you! + File: foo.R + Call: base::warning("I warned you!") + Message: I warned you! - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: foo.R - Call: stop("Oh no you don't!") - Message: Oh no you don't! + File: foo.R + Call: stop("Oh no you don't!") + Message: Oh no you don't! - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: foo.R - Call: gettext("Hi there") - Message: Hi there + File: foo.R + Call: gettext("Hi there") + Message: Hi there - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s ^---^ ^^ ^^ - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") - Plural message: small fail + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") + Plural message: small fail - How would you translate this message into Mainland Chinese independently of n? + How would you translate this message into Mainland Chinese independently of n? Message "Installing" translations with msgfmt Message @@ -225,25 +225,25 @@ * Whenever templates or escaping is happening in a string, these will be 'highlighted' by carets (^) in the line below Output - File: foo.R - Call: warning("I warned you!!") - Message: I warned you!! + File: foo.R + Call: warning("I warned you!!") + Message: I warned you!! - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? **Note: a similar message was previously translated as: ** 已经告诉你! - File: foo.R - Call: stop("I really wish you'd reconsider") - Message: I really wish you'd reconsider + File: foo.R + Call: stop("I really wish you'd reconsider") + Message: I really wish you'd reconsider - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: foo.R - Call: ngettext(length(x), "SOMEWHAT EPIC FAIL", "MAJORLY EPIC FAIL") - Plural message: SOMEWHAT EPIC FAIL + File: foo.R + Call: ngettext(length(x), "SOMEWHAT EPIC FAIL", "MAJORLY EPIC FAIL") + Plural message: SOMEWHAT EPIC FAIL - How would you translate this message into Mainland Chinese independently of n? + How would you translate this message into Mainland Chinese independently of n? Message "Installing" translations with msgfmt Message @@ -259,28 +259,28 @@ Output Problematic call: - base::cat("I warned you!", fill=TRUE, append=TRUE) - < File:foo.R, Line:2 > + base::cat("I warned you!", fill=TRUE, append=TRUE) + < File:foo.R, Line:2 > Potential replacement: - cat(gettext("I warned you!"), fill=TRUE) + cat(gettext("I warned you!"), fill=TRUE) Problematic call: - cat("Oh no", "you\ndon't!") - < File:foo.R, Line:8 > + cat("Oh no", "you\ndon't!") + < File:foo.R, Line:8 > Potential replacement: - cat(gettext("Oh no you\ndon't!")) + cat(gettext("Oh no you\ndon't!")) Problematic call: - cat("Hi", "boss", sep="xx") - < File:foo.R, Line:15 > + cat("Hi", "boss", sep="xx") + < File:foo.R, Line:15 > Potential replacement: - cat(gettext("Hixxboss")) + cat(gettext("Hixxboss")) Problematic call: - cat("This costs", x, "dollars") - < File:foo.R, Line:22 > + cat("This costs", x, "dollars") + < File:foo.R, Line:22 > Potential replacement: - cat(gettextf("This costs %s dollars", x)) + cat(gettextf("This costs %s dollars", x)) Exit now to repair any of these? [y/N] --- @@ -319,107 +319,107 @@ Thanks! Who should be credited with these translations? And what is their email? - File: foo.R - Call: base::warning("I warned you!") - Message: I warned you! + File: foo.R + Call: base::warning("I warned you!") + Message: I warned you! - How would you translate this message into Welsh? + How would you translate this message into Welsh? - File: foo.R - Call: stop("Oh no you don't!") - Message: Oh no you don't! + File: foo.R + Call: stop("Oh no you don't!") + Message: Oh no you don't! - How would you translate this message into Welsh? + How would you translate this message into Welsh? - File: foo.R - Call: gettext("Hi there") - Message: Hi there + File: foo.R + Call: gettext("Hi there") + Message: Hi there - How would you translate this message into Welsh? + How would you translate this message into Welsh? - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s ^---^ ^^ ^^ - How would you translate this message into Welsh? + How would you translate this message into Welsh? ** Oops! Invalid translation -- received the same set of templates + bordering newlines, but in incorrect order ([%.02f, %d, %s] vs [%.02f, %s, %d]). Recall that you can use %$N to do redirect, e.g. to swap the order of '%d %s' to be translated more naturally, your translation can use '%1$s %2$d'. Retrying... ** - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s ^---^ ^^ ^^ - How would you translate this message into Welsh? + How would you translate this message into Welsh? ** Oops! Invalid translation -- received templates + bordering newlines not present in the original: %s. Retrying... ** - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s ^---^ ^^ ^^ - How would you translate this message into Welsh? + How would you translate this message into Welsh? ** Oops! Invalid translation -- received the same set of templates + bordering newlines, but in incorrect order ([%.02f, %d, %s] vs [%1$.02f, %2$s, %3$d]). Recall that you can use %$N to do redirect, e.g. to swap the order of '%d %s' to be translated more naturally, your translation can use '%1$s %2$d'. Retrying... ** - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s ^---^ ^^ ^^ - How would you translate this message into Welsh? + How would you translate this message into Welsh? ** Oops! Invalid translation -- received 2 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s ^---^ ^^ ^^ - How would you translate this message into Welsh? + How would you translate this message into Welsh? ** Oops! Invalid translation -- received 4 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s ^---^ ^^ ^^ - How would you translate this message into Welsh? + How would you translate this message into Welsh? ** Oops! Invalid translation -- received 5 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s ^---^ ^^ ^^ - How would you translate this message into Welsh? + How would you translate this message into Welsh? - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") - Plural message: small fail + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") + Plural message: small fail - How would you translate this message into Welsh for n where 'plural' resolves to 0? + How would you translate this message into Welsh for n where 'plural' resolves to 0? - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") - Plural message: small fail + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") + Plural message: small fail - How would you translate this message into Welsh for n where 'plural' resolves to 1? + How would you translate this message into Welsh for n where 'plural' resolves to 1? - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") - Plural message: small fail + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") + Plural message: small fail - How would you translate this message into Welsh for n where 'plural' resolves to 2? + How would you translate this message into Welsh for n where 'plural' resolves to 2? - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") - Plural message: small fail + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") + Plural message: small fail - How would you translate this message into Welsh for n where 'plural' resolves to 3? + How would you translate this message into Welsh for n where 'plural' resolves to 3? --- @@ -442,41 +442,41 @@ Thanks! Who should be credited with these translations? And what is their email? - File: foo.R - Call: base::warning("I warned you!") - Message: I warned you! + File: foo.R + Call: base::warning("I warned you!") + Message: I warned you! - How would you translate this message into Catalan? + How would you translate this message into Catalan? - File: foo.R - Call: stop("Oh no you don't!") - Message: Oh no you don't! + File: foo.R + Call: stop("Oh no you don't!") + Message: Oh no you don't! - How would you translate this message into Catalan? + How would you translate this message into Catalan? - File: foo.R - Call: gettext("Hi there") - Message: Hi there + File: foo.R + Call: gettext("Hi there") + Message: Hi there - How would you translate this message into Catalan? + How would you translate this message into Catalan? - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s ^---^ ^^ ^^ - How would you translate this message into Catalan? + How would you translate this message into Catalan? - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") - Plural message: small fail + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") + Plural message: small fail - How would you translate this message into Catalan when n = 1? + How would you translate this message into Catalan when n = 1? - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") - Plural message: small fail + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") + Plural message: small fail - How would you translate this message into Catalan when n is not 1? + How would you translate this message into Catalan when n is not 1? --- @@ -488,29 +488,29 @@ Thanks! Who should be credited with these translations? And what is their email? - File: foo.R - Call: base::warning("I warned you!") - Message: I warned you! + File: foo.R + Call: base::warning("I warned you!") + Message: I warned you! - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: foo.R - Call: stop("Oh no you don't!") - Message: Oh no you don't! + File: foo.R + Call: stop("Oh no you don't!") + Message: Oh no you don't! - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: foo.R - Call: gettext("Hi there") - Message: Hi there + File: foo.R + Call: gettext("Hi there") + Message: Hi there - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s ^---^ ^^ ^^ - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? Error Invalid templated message. If any %N$ redirects are used, all templates must be redirected. Redirected tempates: %1$d @@ -526,29 +526,29 @@ Thanks! Who should be credited with these translations? And what is their email? - File: foo.R - Call: base::warning("I warned you!") - Message: I warned you! + File: foo.R + Call: base::warning("I warned you!") + Message: I warned you! - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: foo.R - Call: stop("Oh no you don't!") - Message: Oh no you don't! + File: foo.R + Call: stop("Oh no you don't!") + Message: Oh no you don't! - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: foo.R - Call: gettext("Hi there") - Message: Hi there + File: foo.R + Call: gettext("Hi there") + Message: Hi there - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s ^---^ ^^ ^^ - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? Error Invalid templated message string with redirects -- all messages pointing to the same input must have identical formats, but received [%1$s, %1$d] @@ -562,48 +562,48 @@ Thanks! Who should be credited with these translations? And what is their email? - File: foo.R - Call: message("a string") - Message: a string + File: foo.R + Call: message("a string") + Message: a string - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: bar.c - Call: N_("Don't translate me now.") - Message: Don't translate me now. + File: bar.c + Call: N_("Don't translate me now.") + Message: Don't translate me now. - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: bar.c - Call: Rprintf(_("an translated templated string: %" "" "\n"), 10000LL) - Message: an translated templated string: %\n + File: bar.c + Call: Rprintf(_("an translated templated string: %" "" "\n"), 10000LL) + Message: an translated templated string: %\n ^-------^^^ - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: bar.c - Call: warning(_("a translated "\ - "warning: %s\n"), stardust(z)) - Message: a translated warning: %s\n + File: bar.c + Call: warning(_("a translated "\ + "warning: %s\n"), stardust(z)) + Message: a translated warning: %s\n ^^^^ - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: bar.c - Call: snprintf(BUF, 100, _("a simple message")) - Message: a simple message + File: bar.c + Call: snprintf(BUF, 100, _("a simple message")) + Message: a simple message - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: bar.c - Call: ngettext("singular", "plural", z) - Plural message: singular + File: bar.c + Call: ngettext("singular", "plural", z) + Plural message: singular - How would you translate this message into Mainland Chinese independently of n? + How would you translate this message into Mainland Chinese independently of n? - File: bar.c - Call: ngettext("singular %d", "plural %d", z) - Plural message: singular %d + File: bar.c + Call: ngettext("singular %d", "plural %d", z) + Plural message: singular %d ^^ - How would you translate this message into Mainland Chinese independently of n? + How would you translate this message into Mainland Chinese independently of n? --- @@ -657,19 +657,19 @@ * Whenever templates or escaping is happening in a string, these will be 'highlighted' by carets (^) in the line below Output - File: src.c - Call: error(_("I really wish you'd do something else")) - Message: I really wish you'd do something else + File: src.c + Call: error(_("I really wish you'd do something else")) + Message: I really wish you'd do something else - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? **Note: a similar message was previously translated as: ** 失败了 - File: src.c - Call: Rprintf(_("Here's what is wrong: %s %s\n"), "a", "b") - Message: Here's what is wrong: %s %s\n + File: src.c + Call: Rprintf(_("Here's what is wrong: %s %s\n"), "a", "b") + Message: Here's what is wrong: %s %s\n ^^ ^^^^ - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? **Note: a similar message was previously translated as: ** 当然%s %s\n Message @@ -691,342 +691,342 @@ Thanks! Who should be credited with these translations? And what is their email? - File: copy1.R - Call: stop("copy one") - Message: copy one + File: copy1.R + Call: stop("copy one") + Message: copy one - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: copy2.R - Call: stop("copy two") - Message: copy two + File: copy2.R + Call: stop("copy two") + Message: copy two - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: base::warning(" I warned you!\n\n") - Message: I warned you! + File: foo.R + Call: base::warning(" I warned you!\n\n") + Message: I warned you! - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message(r"('abc')") - Message: 'abc' + File: foo.R + Call: message(r"('abc')") + Message: 'abc' - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message(R'("def")') - Message: "def" + File: foo.R + Call: message(R'("def")') + Message: "def" - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message("R('abc')") - Message: R('abc') + File: foo.R + Call: message("R('abc')") + Message: R('abc') - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message('r("def")') - Message: r("def") + File: foo.R + Call: message('r("def")') + Message: r("def") - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message(R'---[ghi]---') - Message: ghi + File: foo.R + Call: message(R'---[ghi]---') + Message: ghi - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: gettext("Hi there") - Message: Hi there + File: foo.R + Call: gettext("Hi there") + Message: Hi there - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: gettextf(fmt = "good %s ", "grief") - Message: good %s + File: foo.R + Call: gettextf(fmt = "good %s ", "grief") + Message: good %s ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: "first" + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: "first" - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: second + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: second - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: third + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: third - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: fourth + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: fourth - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: fifth + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: fifth - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: sixth + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: sixth - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message("\\n vs \n is OK") - Message: \\n vs \n is OK + File: foo.R + Call: message("\\n vs \n is OK") + Message: \\n vs \n is OK - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message("\\t vs \t is OK") - Message: \\t vs \t is OK + File: foo.R + Call: message("\\t vs \t is OK") + Message: \\t vs \t is OK - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message('strings with "quotes" are OK') - Message: strings with "quotes" are OK + File: foo.R + Call: message('strings with "quotes" are OK') + Message: strings with "quotes" are OK - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message("strings with escaped \"quotes\" are OK") - Message: strings with escaped "quotes" are OK + File: foo.R + Call: message("strings with escaped \"quotes\" are OK") + Message: strings with escaped "quotes" are OK - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: gettextf( paste("part 1 %s", "part 2"), "input" ) - Message: part 1 %s + File: foo.R + Call: gettextf( paste("part 1 %s", "part 2"), "input" ) + Message: part 1 %s ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: gettextf( paste("part 1 %s", "part 2"), "input" ) - Message: part 2 + File: foo.R + Call: gettextf( paste("part 1 %s", "part 2"), "input" ) + Message: part 2 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: ngettext( 10, "singular ", "plural " ) - Plural message: singular  + File: foo.R + Call: ngettext( 10, "singular ", "plural " ) + Plural message: singular - How would you translate this message into Spanish when n = 1? + How would you translate this message into Spanish when n = 1? - File: foo.R - Call: ngettext( 10, "singular ", "plural " ) - Plural message: singular  + File: foo.R + Call: ngettext( 10, "singular ", "plural " ) + Plural message: singular - How would you translate this message into Spanish when n is not 1? + How would you translate this message into Spanish when n is not 1? - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail ", msg2 = "big fail ") - Plural message: small fail  + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail ", msg2 = "big fail ") + Plural message: small fail - How would you translate this message into Spanish when n = 1? + How would you translate this message into Spanish when n = 1? - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail ", msg2 = "big fail ") - Plural message: small fail  + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail ", msg2 = "big fail ") + Plural message: small fail - How would you translate this message into Spanish when n is not 1? + How would you translate this message into Spanish when n is not 1? - File: ABCDEFGHIJKLMNOPQRSTUVWXYZ.c - Call: _("an translated templated string: %" "" "\n") - Message: an translated templated string: %\n + File: ABCDEFGHIJKLMNOPQRSTUVWXYZ.c + Call: _("an translated templated string: %" "" "\n") + Message: an translated templated string: %\n ^-------^^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: MSGs.c - Call: _("any old \ - message") - Message: any old message + File: MSGs.c + Call: _("any old \ + message") + Message: any old message - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: _("a message in a macro %s") - Message: a message in a macro %s + File: msg.c + Call: _("a message in a macro %s") + Message: a message in a macro %s ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: Rprintf(_("that's a mighty big %" """-sized wall over %"""), 100LL, 10L) - Message: that's a mighty big %-sized wall over % + File: msg.c + Call: Rprintf(_("that's a mighty big %" """-sized wall over %"""), 100LL, 10L) + Message: that's a mighty big %-sized wall over % ^-------^ ^-------^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: Rprintf(_("/* this is what a C comment looks like */ ")) - Message: /* this is what a C comment looks like */  + File: msg.c + Call: Rprintf(_("/* this is what a C comment looks like */ ")) + Message: /* this is what a C comment looks like */ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: Rprintf(_("// this is what a C comment looks like %s "), "abc") - Message: // this is what a C comment looks like %s  + File: msg.c + Call: Rprintf(_("// this is what a C comment looks like %s "), "abc") + Message: // this is what a C comment looks like %s ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: Rprintf(_( + File: msg.c + Call: Rprintf(_( "01234567890123456789.01234567890123456789" "01234567890123456789.01234567890123456789" "01234567890123456789.01234567890123456789" "01234567890123456789.01234567890123456789" - )) - Message: 01234567890123456789.0123456789012345678901234567890123456789.0123456789012345678901234567890123456789.0123456789012345678901234567890123456789.01234567890123456789 + )) + Message: 01234567890123456789.0123456789012345678901234567890123456789.0123456789012345678901234567890123456789.0123456789012345678901234567890123456789.01234567890123456789 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("This message\nSpans two lines")) - Message: This message\nSpans two lines + File: msg.c + Call: error(_("This message\nSpans two lines")) + Message: This message\nSpans two lines - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("This one does not\n")) - Message: This one does not\n + File: msg.c + Call: error(_("This one does not\n")) + Message: This one does not\n ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("Exotic formatters like %I32u, %llx, %li, %ls, %lc")) - Message: Exotic formatters like %I32u, %llx, %li, %ls, %lc + File: msg.c + Call: error(_("Exotic formatters like %I32u, %llx, %li, %ls, %lc")) + Message: Exotic formatters like %I32u, %llx, %li, %ls, %lc ^---^ ^--^ ^-^ ^-^ ^-^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456\"890")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456"890 + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456\"890")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456"890 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345(\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345("890 + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345(\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345("890 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345'\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345'"890 + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345'\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345'"890 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345a\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345a"890 + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345a\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345a"890 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345A\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345A"890 + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345A\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345A"890 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345#\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345#"890 + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345#\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345#"890 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345@\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345@"890 + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345@\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345@"890 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 .%s.")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 .%s. + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 .%s.")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 .%s. ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 ?%s?")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 ?%s? + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 ?%s?")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 ?%s? ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 ;%s;")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 ;%s; + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 ;%s;")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 ;%s; ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 /%s/")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 /%s/ + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 /%s/")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 /%s/ ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 '%s'")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 '%s' + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 '%s'")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 '%s' ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 [%s]")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 [%s] + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 [%s]")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 [%s] ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 |%s|")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 |%s| + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 |%s|")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 |%s| ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 -%s-")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 -%s- + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 -%s-")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 -%s- ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_(test ? "abc" : "def")) - Message: abc + File: msg.c + Call: error(_(test ? "abc" : "def")) + Message: abc - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_(xxx "abc" "def")) - Message: abcdef + File: msg.c + Call: error(_(xxx "abc" "def")) + Message: abcdef - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: z.c - Call: error(_("You found me!")) - Message: You found me! + File: z.c + Call: error(_("You found me!")) + Message: You found me! - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: cairo/bedfellows.c - Call: _( - "any new message") - Message: any new message + File: cairo/bedfellows.c + Call: _( + "any new message") + Message: any new message - How would you translate this message into Spanish? + How would you translate this message into Spanish? --- @@ -1038,342 +1038,342 @@ Thanks! Who should be credited with these translations? And what is their email? - File: copy1.R - Call: stop("copy one") - Message: copy one + File: copy1.R + Call: stop("copy one") + Message: copy one - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: copy2.R - Call: stop("copy two") - Message: copy two + File: copy2.R + Call: stop("copy two") + Message: copy two - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: base::warning(" I warned you!\n\n") - Message: I warned you! + File: foo.R + Call: base::warning(" I warned you!\n\n") + Message: I warned you! - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message(r"('abc')") - Message: 'abc' + File: foo.R + Call: message(r"('abc')") + Message: 'abc' - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message(R'("def")') - Message: "def" + File: foo.R + Call: message(R'("def")') + Message: "def" - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message("R('abc')") - Message: R('abc') + File: foo.R + Call: message("R('abc')") + Message: R('abc') - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message('r("def")') - Message: r("def") + File: foo.R + Call: message('r("def")') + Message: r("def") - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message(R'---[ghi]---') - Message: ghi + File: foo.R + Call: message(R'---[ghi]---') + Message: ghi - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: gettext("Hi there") - Message: Hi there + File: foo.R + Call: gettext("Hi there") + Message: Hi there - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: gettextf(fmt = "good %s ", "grief") - Message: good %s + File: foo.R + Call: gettextf(fmt = "good %s ", "grief") + Message: good %s ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: "first" + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: "first" - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: second + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: second - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: third + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: third - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: fourth + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: fourth - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: fifth + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: fifth - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: sixth + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: sixth - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message("\\n vs \n is OK") - Message: \\n vs \n is OK + File: foo.R + Call: message("\\n vs \n is OK") + Message: \\n vs \n is OK - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message("\\t vs \t is OK") - Message: \\t vs \t is OK + File: foo.R + Call: message("\\t vs \t is OK") + Message: \\t vs \t is OK - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message('strings with "quotes" are OK') - Message: strings with "quotes" are OK + File: foo.R + Call: message('strings with "quotes" are OK') + Message: strings with "quotes" are OK - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message("strings with escaped \"quotes\" are OK") - Message: strings with escaped "quotes" are OK + File: foo.R + Call: message("strings with escaped \"quotes\" are OK") + Message: strings with escaped "quotes" are OK - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: gettextf( paste("part 1 %s", "part 2"), "input" ) - Message: part 1 %s + File: foo.R + Call: gettextf( paste("part 1 %s", "part 2"), "input" ) + Message: part 1 %s ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: gettextf( paste("part 1 %s", "part 2"), "input" ) - Message: part 2 + File: foo.R + Call: gettextf( paste("part 1 %s", "part 2"), "input" ) + Message: part 2 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: ngettext( 10, "singular ", "plural " ) - Plural message: singular  + File: foo.R + Call: ngettext( 10, "singular ", "plural " ) + Plural message: singular - How would you translate this message into Spanish when n = 1? + How would you translate this message into Spanish when n = 1? - File: foo.R - Call: ngettext( 10, "singular ", "plural " ) - Plural message: singular  + File: foo.R + Call: ngettext( 10, "singular ", "plural " ) + Plural message: singular - How would you translate this message into Spanish when n is not 1? + How would you translate this message into Spanish when n is not 1? - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail ", msg2 = "big fail ") - Plural message: small fail  + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail ", msg2 = "big fail ") + Plural message: small fail - How would you translate this message into Spanish when n = 1? + How would you translate this message into Spanish when n = 1? - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail ", msg2 = "big fail ") - Plural message: small fail  + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail ", msg2 = "big fail ") + Plural message: small fail - How would you translate this message into Spanish when n is not 1? + How would you translate this message into Spanish when n is not 1? - File: ABCDEFGHIJKLMNOPQRSTUVWXYZ.c - Call: _("an translated templated string: %" "" "\n") - Message: an translated templated string: %\n + File: ABCDEFGHIJKLMNOPQRSTUVWXYZ.c + Call: _("an translated templated string: %" "" "\n") + Message: an translated templated string: %\n ^-------^^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: MSGs.c - Call: _("any old \ - message") - Message: any old message + File: MSGs.c + Call: _("any old \ + message") + Message: any old message - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: _("a message in a macro %s") - Message: a message in a macro %s + File: msg.c + Call: _("a message in a macro %s") + Message: a message in a macro %s ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: Rprintf(_("that's a mighty big %" """-sized wall over %"""), 100LL, 10L) - Message: that's a mighty big %-sized wall over % + File: msg.c + Call: Rprintf(_("that's a mighty big %" """-sized wall over %"""), 100LL, 10L) + Message: that's a mighty big %-sized wall over % ^-------^ ^-------^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: Rprintf(_("/* this is what a C comment looks like */ ")) - Message: /* this is what a C comment looks like */  + File: msg.c + Call: Rprintf(_("/* this is what a C comment looks like */ ")) + Message: /* this is what a C comment looks like */ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: Rprintf(_("// this is what a C comment looks like %s "), "abc") - Message: // this is what a C comment looks like %s  + File: msg.c + Call: Rprintf(_("// this is what a C comment looks like %s "), "abc") + Message: // this is what a C comment looks like %s ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: Rprintf(_( + File: msg.c + Call: Rprintf(_( "01234567890123456789.01234567890123456789" "01234567890123456789.01234567890123456789" "01234567890123456789.01234567890123456789" "01234567890123456789.01234567890123456789" - )) - Message: 01234567890123456789.0123456789012345678901234567890123456789.0123456789012345678901234567890123456789.0123456789012345678901234567890123456789.01234567890123456789 + )) + Message: 01234567890123456789.0123456789012345678901234567890123456789.0123456789012345678901234567890123456789.0123456789012345678901234567890123456789.01234567890123456789 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("This message\nSpans two lines")) - Message: This message\nSpans two lines + File: msg.c + Call: error(_("This message\nSpans two lines")) + Message: This message\nSpans two lines - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("This one does not\n")) - Message: This one does not\n + File: msg.c + Call: error(_("This one does not\n")) + Message: This one does not\n ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("Exotic formatters like %I32u, %llx, %li, %ls, %lc")) - Message: Exotic formatters like %I32u, %llx, %li, %ls, %lc + File: msg.c + Call: error(_("Exotic formatters like %I32u, %llx, %li, %ls, %lc")) + Message: Exotic formatters like %I32u, %llx, %li, %ls, %lc ^---^ ^--^ ^-^ ^-^ ^-^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456\"890")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456"890 + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456\"890")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456"890 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345(\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345("890 + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345(\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345("890 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345'\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345'"890 + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345'\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345'"890 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345a\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345a"890 + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345a\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345a"890 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345A\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345A"890 + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345A\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345A"890 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345#\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345#"890 + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345#\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345#"890 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345@\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345@"890 + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345@\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345@"890 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 .%s.")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 .%s. + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 .%s.")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 .%s. ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 ?%s?")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 ?%s? + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 ?%s?")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 ?%s? ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 ;%s;")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 ;%s; + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 ;%s;")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 ;%s; ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 /%s/")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 /%s/ + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 /%s/")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 /%s/ ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 '%s'")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 '%s' + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 '%s'")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 '%s' ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 [%s]")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 [%s] + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 [%s]")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 [%s] ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 |%s|")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 |%s| + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 |%s|")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 |%s| ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 -%s-")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 -%s- + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 -%s-")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 -%s- ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_(test ? "abc" : "def")) - Message: abc + File: msg.c + Call: error(_(test ? "abc" : "def")) + Message: abc - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_(xxx "abc" "def")) - Message: abcdef + File: msg.c + Call: error(_(xxx "abc" "def")) + Message: abcdef - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: z.c - Call: error(_("You found me!")) - Message: You found me! + File: z.c + Call: error(_("You found me!")) + Message: You found me! - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: cairo/bedfellows.c - Call: _( - "any new message") - Message: any new message + File: cairo/bedfellows.c + Call: _( + "any new message") + Message: any new message - How would you translate this message into Spanish? + How would you translate this message into Spanish? --- @@ -1385,9 +1385,9 @@ Thanks! Who should be credited with these translations? And what is their email? - File: foo.R - Call: base::warning("I warned you!") - Message: I warned you! + File: foo.R + Call: base::warning("I warned you!") + Message: I warned you! - How would you translate this message into Spanish? + How would you translate this message into Spanish? From 5fe50170e8554c1febb9787658f98c19e3627b6a Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Mon, 8 Nov 2021 22:47:20 -0800 Subject: [PATCH 11/22] update to testthat 3.1.0 locally to better match CI snapshots --- tests/testthat.R | 2 +- tests/testthat/_snaps/translate-package.md | 74 +--------------------- 2 files changed, 4 insertions(+), 72 deletions(-) diff --git a/tests/testthat.R b/tests/testthat.R index c5ce8753..700cef57 100755 --- a/tests/testthat.R +++ b/tests/testthat.R @@ -1,6 +1,6 @@ library(withr) library(testthat) -old = options(potools.use_colors = FALSE) +old = options(potools.use_colors = FALSE, width = 80L) library(potools) # Failed on Solaris because the command-line tools are missing there (which means tools doesn't work there), #186 diff --git a/tests/testthat/_snaps/translate-package.md b/tests/testthat/_snaps/translate-package.md index 58578866..4ceb15d7 100644 --- a/tests/testthat/_snaps/translate-package.md +++ b/tests/testthat/_snaps/translate-package.md @@ -9,11 +9,8 @@ translate_package(verbose = TRUE) Message Starting translations for package 'noMsg' - Message Getting R-level messages... - Message Getting src-level messages... - Message No messages to translate; finishing --- @@ -22,11 +19,8 @@ translate_package(verbose = TRUE) Message Starting translations for package 'rDataPkg' - Message Getting R-level messages... - Message Getting src-level messages... - Message No messages to translate; finishing --- @@ -35,20 +29,13 @@ translate_package(verbose = TRUE) Message Updating translation template for package 'rMsg' (last updated 0000-01-01 00:00:00) - Message Getting R-level messages... - Message Getting src-level messages... - Message Running message diagnostics... - Message Generating .pot files... - Message Generating en@quot translations - Message running msgfmt on R-en@quot.po succeeded; output: 5 translated messages. - Message No languages provided; finishing --- @@ -57,22 +44,14 @@ translate_package(languages = "zh_CN", verbose = TRUE) Message Updating translation template for package 'rMsg' (last updated 0000-01-01 00:00:00) - Message Getting R-level messages... - Message Getting src-level messages... - Message Running message diagnostics... - Message Generating .pot files... - Message Generating en@quot translations - Message running msgfmt on R-en@quot.po succeeded; output: 5 translated messages. - Message Beginning new translations for zh_CN (Mainland Chinese/普通话); found 6 untranslated messages - Message (To quit translating, press 'Esc'; progress will be saved) Output Thanks! Who should be credited with these translations? @@ -121,10 +100,8 @@ How would you translate this message into Mainland Chinese independently of n? Message "Installing" translations with msgfmt - Message running msgfmt on R-fa.po succeeded; output: 5 translated messages. - Message running msgfmt on R-zh_CN.po succeeded; output: 5 translated messages. @@ -134,29 +111,18 @@ translate_package(languages = "fa", verbose = TRUE) Message Updating translation template for package 'rMsg' (last updated 0000-01-01 00:00:00) - Message Getting R-level messages... - Message Getting src-level messages... - Message Running message diagnostics... - Message Generating .pot files... - Message Generating en@quot translations - Message running msgfmt on R-en@quot.po succeeded; output: 5 translated messages. - Message Found existing R translations for fa (Farsi/فارسی) in ./po/R-fa.po. Running msgmerge... - Message Running msgmerge on './po/R-fa.po' succeeded: ...... done. - Message Translations for fa are up to date! Skipping. - Message "Installing" translations with msgfmt - Message running msgfmt on R-fa.po succeeded; output: 5 translated messages. @@ -166,48 +132,35 @@ translate_package(languages = "zh_CN", verbose = TRUE) Message Updating translation template for package 'rFuzzyMsg' (last updated 0000-01-01 00:00:00) - Message Getting R-level messages... - Message Getting src-level messages... - Message Running message diagnostics... - Message Generating .pot files... - Message Generating en@quot translations - Message running msgfmt on R-en@quot.po succeeded; output: 3 translated messages. - Message Found existing R translations for zh_CN (Mainland Chinese/普通话) in ./po/R-zh_CN.po. Running msgmerge... - Message Running msgmerge on './po/R-zh_CN.po' succeeded: ..... done. - Message Found 2 translations marked as deprecated in ./po/R-zh_CN.po. - Message Typically, this means the corresponding error messages have been refactored. - Message Reproducing these messages here for your reference since they might still provide some utility. - Message ** SINGULAR MESSAGES ** Output - ---------------------------------------------------------------------------------- + ------------------------------------------------------------------------ Oh no you don't! 当然不会! Message ** PLURAL MESSAGES ** Output - ---------------------------------------------------------------------------------- + ------------------------------------------------------------------------ small fail\n 失败了\n - ---------------------------------------------------------------------------------- + ------------------------------------------------------------------------ big fail\n 失败了\n Message Beginning new translations for zh_CN (Mainland Chinese/普通话); found 3 untranslated messages - Message (To quit translating, press 'Esc'; progress will be saved) Output Thanks! Who should be credited with these translations? @@ -246,7 +199,6 @@ How would you translate this message into Mainland Chinese independently of n? Message "Installing" translations with msgfmt - Message running msgfmt on R-zh_CN.po succeeded; output: 3 translated messages. @@ -289,9 +241,7 @@ translate_package(languages = "cy") Message Generating en@quot translations - Message 'cy' is not a known language. - Message Please help supply some metadata about it. You can check https://l10n.gnome.org/teams/ Output How would you refer to this language in English? @@ -313,7 +263,6 @@ 0 n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5 Using generic description of cases instead. - Message Thanks! Please file an issue on GitHub to get this language recognized permanently Output Thanks! Who should be credited with these translations? @@ -427,9 +376,7 @@ translate_package(languages = "ca", diagnostics = NULL) Message Generating en@quot translations - Message 'ca' is not a known language. - Message Please help supply some metadata about it. You can check https://l10n.gnome.org/teams/ Output How would you refer to this language in English? @@ -611,35 +558,22 @@ translate_package(languages = "zh_CN", verbose = TRUE) Message Updating translation template for package 'rSrcFuzzyMsg' (last updated 0000-01-01 00:00:00) - Message Getting R-level messages... - Message Getting src-level messages... - Message Running message diagnostics... - Message Generating .pot files... - Message Generating en@quot translations - Message running msgfmt on R-en@quot.po succeeded; output: 1 translated message. - Message running msgfmt on en@quot.po succeeded; output: 2 translated messages. - Message Found existing R translations for zh_CN (Mainland Chinese/普通话) in ./po/R-zh_CN.po. Running msgmerge... - Message Running msgmerge on './po/R-zh_CN.po' succeeded: .. done. - Message Found existing src translations for zh_CN (Mainland Chinese/普通话) in ./po/zh_CN.po. Running msgmerge... - Message Running msgmerge on './po/zh_CN.po' succeeded: ..... done. - Message Beginning new translations for zh_CN (Mainland Chinese/普通话); found 2 untranslated messages - Message (To quit translating, press 'Esc'; progress will be saved) Output Thanks! Who should be credited with these translations? @@ -674,10 +608,8 @@ 当然%s %s\n Message "Installing" translations with msgfmt - Message running msgfmt on R-zh_CN.po succeeded; output: 1 translated message. - Message running msgfmt on zh_CN.po succeeded; output: 2 translated messages. From e179b3f82918d208789aaeba5cfd84bdbabd0f7d Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Wed, 10 Nov 2021 21:16:45 -0800 Subject: [PATCH 12/22] re-generate snapshots --- tests/testthat/_snaps/translate-package.md | 157 +++++++++------------ tests/testthat/helpers.R | 2 + tests/testthat/test-po_update.R | 5 +- tests/testthat/test-translate-package.R | 34 ++--- 4 files changed, 85 insertions(+), 113 deletions(-) diff --git a/tests/testthat/_snaps/translate-package.md b/tests/testthat/_snaps/translate-package.md index 4ceb15d7..36da6ab3 100644 --- a/tests/testthat/_snaps/translate-package.md +++ b/tests/testthat/_snaps/translate-package.md @@ -9,8 +9,7 @@ translate_package(verbose = TRUE) Message Starting translations for package 'noMsg' - Getting R-level messages... - Getting src-level messages... + Getting R-level messages. No messages to translate; finishing --- @@ -19,8 +18,6 @@ translate_package(verbose = TRUE) Message Starting translations for package 'rDataPkg' - Getting R-level messages... - Getting src-level messages... No messages to translate; finishing --- @@ -29,10 +26,9 @@ translate_package(verbose = TRUE) Message Updating translation template for package 'rMsg' (last updated 0000-01-01 00:00:00) - Getting R-level messages... - Getting src-level messages... - Running message diagnostics... - Generating .pot files... + Getting R-level messages. + Running message diagnostics. + Writing R-rMsg.pot Generating en@quot translations running msgfmt on R-en@quot.po succeeded; output: 5 translated messages. @@ -44,10 +40,9 @@ translate_package(languages = "zh_CN", verbose = TRUE) Message Updating translation template for package 'rMsg' (last updated 0000-01-01 00:00:00) - Getting R-level messages... - Getting src-level messages... - Running message diagnostics... - Generating .pot files... + Getting R-level messages. + Running message diagnostics. + Writing R-rMsg.pot Generating en@quot translations running msgfmt on R-en@quot.po succeeded; output: 5 translated messages. @@ -99,9 +94,8 @@ How would you translate this message into Mainland Chinese independently of n? Message - "Installing" translations with msgfmt - running msgfmt on R-fa.po succeeded; output: - 5 translated messages. + Writing R-zh_CN.po + Recompiling 'zh_CN' R translation running msgfmt on R-zh_CN.po succeeded; output: 5 translated messages. @@ -111,18 +105,16 @@ translate_package(languages = "fa", verbose = TRUE) Message Updating translation template for package 'rMsg' (last updated 0000-01-01 00:00:00) - Getting R-level messages... - Getting src-level messages... - Running message diagnostics... - Generating .pot files... + Getting R-level messages. + Running message diagnostics. + Writing R-rMsg.pot Generating en@quot translations running msgfmt on R-en@quot.po succeeded; output: 5 translated messages. - Found existing R translations for fa (Farsi/فارسی) in ./po/R-fa.po. Running msgmerge... - Running msgmerge on './po/R-fa.po' succeeded: - ...... done. + Found existing R translations for fa (Farsi/فارسی) in ./po/R-fa.po. Running msgmerge. + . done. Translations for fa are up to date! Skipping. - "Installing" translations with msgfmt + Recompiling 'fa' R translation running msgfmt on R-fa.po succeeded; output: 5 translated messages. @@ -132,16 +124,14 @@ translate_package(languages = "zh_CN", verbose = TRUE) Message Updating translation template for package 'rFuzzyMsg' (last updated 0000-01-01 00:00:00) - Getting R-level messages... - Getting src-level messages... - Running message diagnostics... - Generating .pot files... + Getting R-level messages. + Running message diagnostics. + Writing R-rFuzzyMsg.pot Generating en@quot translations running msgfmt on R-en@quot.po succeeded; output: 3 translated messages. - Found existing R translations for zh_CN (Mainland Chinese/普通话) in ./po/R-zh_CN.po. Running msgmerge... - Running msgmerge on './po/R-zh_CN.po' succeeded: - ..... done. + Found existing R translations for zh_CN (Mainland Chinese/普通话) in ./po/R-zh_CN.po. Running msgmerge. + . done. Found 2 translations marked as deprecated in ./po/R-zh_CN.po. Typically, this means the corresponding error messages have been refactored. Reproducing these messages here for your reference since they might still provide some utility. @@ -160,7 +150,7 @@ big fail\n 失败了\n Message - Beginning new translations for zh_CN (Mainland Chinese/普通话); found 3 untranslated messages + Beginning new translations for zh_CN (Mainland Chinese/普通话); found 2 untranslated messages (To quit translating, press 'Esc'; progress will be saved) Output Thanks! Who should be credited with these translations? @@ -178,14 +168,6 @@ * Whenever templates or escaping is happening in a string, these will be 'highlighted' by carets (^) in the line below Output - File: foo.R - Call: warning("I warned you!!") - Message: I warned you!! - - How would you translate this message into Mainland Chinese? - **Note: a similar message was previously translated as: ** - 已经告诉你! - File: foo.R Call: stop("I really wish you'd reconsider") Message: I really wish you'd reconsider @@ -198,7 +180,8 @@ How would you translate this message into Mainland Chinese independently of n? Message - "Installing" translations with msgfmt + Writing R-zh_CN.po + Recompiling 'zh_CN' R translation running msgfmt on R-zh_CN.po succeeded; output: 3 translated messages. @@ -240,6 +223,7 @@ Code translate_package(languages = "cy") Message + Writing R-rMsg.pot Generating en@quot translations 'cy' is not a known language. Please help supply some metadata about it. You can check https://l10n.gnome.org/teams/ @@ -293,7 +277,7 @@ How would you translate this message into Welsh? - ** Oops! Invalid translation -- received the same set of templates + bordering newlines, but in incorrect order ([%.02f, %d, %s] vs [%.02f, %s, %d]). Recall that you can use %$N to do redirect, e.g. to swap the order of '%d %s' to be translated more naturally, your translation can use '%1$s %2$d'. Retrying... ** + ** Oops! Invalid translation -- received the same set of templates + bordering newlines, but in incorrect order ([%.02f, %d, %s] vs [%.02f, %s, %d]). Recall that you can use %$N to do redirect, e.g. to swap the order of '%d %s' to be translated more naturally, your translation can use '%1$s %2$d'. Retrying. ** File: foo.R Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) @@ -302,7 +286,7 @@ How would you translate this message into Welsh? - ** Oops! Invalid translation -- received templates + bordering newlines not present in the original: %s. Retrying... ** + ** Oops! Invalid translation -- received templates + bordering newlines not present in the original: %s. Retrying. ** File: foo.R Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) @@ -311,7 +295,7 @@ How would you translate this message into Welsh? - ** Oops! Invalid translation -- received the same set of templates + bordering newlines, but in incorrect order ([%.02f, %d, %s] vs [%1$.02f, %2$s, %3$d]). Recall that you can use %$N to do redirect, e.g. to swap the order of '%d %s' to be translated more naturally, your translation can use '%1$s %2$d'. Retrying... ** + ** Oops! Invalid translation -- received the same set of templates + bordering newlines, but in incorrect order ([%.02f, %d, %s] vs [%1$.02f, %2$s, %3$d]). Recall that you can use %$N to do redirect, e.g. to swap the order of '%d %s' to be translated more naturally, your translation can use '%1$s %2$d'. Retrying. ** File: foo.R Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) @@ -320,7 +304,7 @@ How would you translate this message into Welsh? - ** Oops! Invalid translation -- received 2 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** + ** Oops! Invalid translation -- received 2 unique templated arguments + bordering newlines but there are 3 in the original. Retrying. ** File: foo.R Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) @@ -329,7 +313,7 @@ How would you translate this message into Welsh? - ** Oops! Invalid translation -- received 4 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** + ** Oops! Invalid translation -- received 4 unique templated arguments + bordering newlines but there are 3 in the original. Retrying. ** File: foo.R Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) @@ -338,7 +322,7 @@ How would you translate this message into Welsh? - ** Oops! Invalid translation -- received 5 unique templated arguments + bordering newlines but there are 3 in the original. Retrying... ** + ** Oops! Invalid translation -- received 5 unique templated arguments + bordering newlines but there are 3 in the original. Retrying. ** File: foo.R Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) @@ -369,12 +353,15 @@ Plural message: small fail How would you translate this message into Welsh for n where 'plural' resolves to 3? + Message + Writing R-cy.po --- Code translate_package(languages = "ca", diagnostics = NULL) Message + Writing R-rMsg.pot Generating en@quot translations 'ca' is not a known language. Please help supply some metadata about it. You can check https://l10n.gnome.org/teams/ @@ -424,12 +411,15 @@ Plural message: small fail How would you translate this message into Catalan when n is not 1? + Message + Writing R-ca.po --- Code translate_package(languages = "zh_CN", diagnostics = NULL) Message + Writing R-rMsg.pot Generating en@quot translations Output Thanks! Who should be credited with these translations? @@ -462,12 +452,15 @@ Invalid templated message. If any %N$ redirects are used, all templates must be redirected. Redirected tempates: %1$d Un-redirected templates: %d + Message + Writing R-zh_CN.po --- Code translate_package(languages = "zh_CN", diagnostics = NULL) Message + Writing R-rMsg.pot Generating en@quot translations Output Thanks! Who should be credited with these translations? @@ -498,12 +491,15 @@ How would you translate this message into Mainland Chinese? Error Invalid templated message string with redirects -- all messages pointing to the same input must have identical formats, but received [%1$s, %1$d] + Message + Writing R-zh_CN.po --- Code translate_package(languages = "zh_CN", diagnostics = check_untranslated_src) Message + Writing R-rSrcMsg.pot Generating en@quot translations Output Thanks! Who should be credited with these translations? @@ -551,6 +547,8 @@ Plural message: singular %d ^^ How would you translate this message into Mainland Chinese independently of n? + Message + Writing R-zh_CN.po --- @@ -558,66 +556,33 @@ translate_package(languages = "zh_CN", verbose = TRUE) Message Updating translation template for package 'rSrcFuzzyMsg' (last updated 0000-01-01 00:00:00) - Getting R-level messages... - Getting src-level messages... - Running message diagnostics... - Generating .pot files... + Getting R-level messages. + Getting src-level messages. + Running message diagnostics. + Writing R-rSrcFuzzyMsg.pot Generating en@quot translations running msgfmt on R-en@quot.po succeeded; output: 1 translated message. running msgfmt on en@quot.po succeeded; output: 2 translated messages. - Found existing R translations for zh_CN (Mainland Chinese/普通话) in ./po/R-zh_CN.po. Running msgmerge... - Running msgmerge on './po/R-zh_CN.po' succeeded: - .. done. - Found existing src translations for zh_CN (Mainland Chinese/普通话) in ./po/zh_CN.po. Running msgmerge... - Running msgmerge on './po/zh_CN.po' succeeded: - ..... done. - Beginning new translations for zh_CN (Mainland Chinese/普通话); found 2 untranslated messages - (To quit translating, press 'Esc'; progress will be saved) - Output - Thanks! Who should be credited with these translations? - And what is their email? - Message - *************************** - ** BEGINNING TRANSLATION ** - *************************** - - Some helpful reminders: - * You can skip a translation by entering nothing (just press RETURN) - * Special characters (like newlines, \n, or tabs, \t) should be written just like that (with an escape) - * Be sure to match message templates. The count of templates (%s, %d, etc.) must match in all languages, as must initial and terminal newlines (\n) - * While the count of templates must match, the _order_ can be changed by using e.g. %2$s to mean 'use the second input as a string here' - * Whenever templates or escaping is happening in a string, these will be 'highlighted' by carets (^) in the line below - Output - - File: src.c - Call: error(_("I really wish you'd do something else")) - Message: I really wish you'd do something else - - How would you translate this message into Mainland Chinese? - **Note: a similar message was previously translated as: ** - 失败了 - - File: src.c - Call: Rprintf(_("Here's what is wrong: %s %s\n"), "a", "b") - Message: Here's what is wrong: %s %s\n - ^^ ^^^^ - How would you translate this message into Mainland Chinese? - **Note: a similar message was previously translated as: ** - 当然%s %s\n - Message - "Installing" translations with msgfmt + Found existing R translations for zh_CN (Mainland Chinese/普通话) in ./po/R-zh_CN.po. Running msgmerge. + . done. + Found existing src translations for zh_CN (Mainland Chinese/普通话) in ./po/zh_CN.po. Running msgmerge. + . done. + Translations for zh_CN are up to date! Skipping. + Recompiling 'zh_CN' R translation running msgfmt on R-zh_CN.po succeeded; output: 1 translated message. + Recompiling 'zh_CN' src translation running msgfmt on zh_CN.po succeeded; output: - 2 translated messages. + 0 translated messages, 2 fuzzy translations. --- Code translate_package(languages = "es", copyright = "Mata Hari", diagnostics = NULL) Message + Writing R-rMsgUnusual.pot Generating en@quot translations Output Thanks! Who should be credited with these translations? @@ -959,12 +924,15 @@ Message: any new message How would you translate this message into Spanish? + Message + Writing R-es.po --- Code translate_package(languages = "es", use_base_rules = TRUE, diagnostics = NULL) Message + Writing R-rMsgUnusual.pot Generating en@quot translations Output Thanks! Who should be credited with these translations? @@ -1306,12 +1274,15 @@ Message: any new message How would you translate this message into Spanish? + Message + Writing R-es.po --- Code translate_package(languages = "es", max_translations = 1L, diagnostics = NULL) Message + Writing R-rMsg.pot Generating en@quot translations Output Thanks! Who should be credited with these translations? @@ -1322,4 +1293,6 @@ Message: I warned you! How would you translate this message into Spanish? + Message + Writing R-es.po diff --git a/tests/testthat/helpers.R b/tests/testthat/helpers.R index 575b0cad..edf30cc4 100644 --- a/tests/testthat/helpers.R +++ b/tests/testthat/helpers.R @@ -68,3 +68,5 @@ local_test_package <- function(..., .envir = parent.frame()) { standardize_dots <- standardise_dots <- function(x) { gsub("\\.{2,}", ".", x) } + +expect_normalized_snapshot <- function(...) expect_snapshot(..., transform = standardize_dots) diff --git a/tests/testthat/test-po_update.R b/tests/testthat/test-po_update.R index 9f11b4f8..f5c0e4ca 100644 --- a/tests/testthat/test-po_update.R +++ b/tests/testthat/test-po_update.R @@ -5,8 +5,5 @@ test_that("user is told what's happening", { po_extract() po_create(c("ja", "fr")) - expect_snapshot( - po_update(verbose = TRUE, lazy = FALSE), - transform = standardise_dots - ) + expect_normalized_snapshot(po_update(verbose = TRUE, lazy = FALSE)) }) diff --git a/tests/testthat/test-translate-package.R b/tests/testthat/test-translate-package.R index b96011f6..6475f277 100644 --- a/tests/testthat/test-translate-package.R +++ b/tests/testthat/test-translate-package.R @@ -20,17 +20,17 @@ test_that("translate_package arg checking errors work", { }) with_restoration_test_that("translate_package handles empty packages", "no_msg", { - expect_snapshot(translate_package()) - expect_snapshot(translate_package(verbose=TRUE)) + expect_normalized_snapshot(translate_package()) + expect_normalized_snapshot(translate_package(verbose=TRUE)) }) with_restoration_test_that("translate_package handles a data package (no R dir)", "r_data_pkg", { - expect_snapshot(translate_package(verbose=TRUE)) + expect_normalized_snapshot(translate_package(verbose=TRUE)) }) with_restoration_test_that("translate_package works on a simple package w/o translating", "r_msg", { mockery::stub(translate_package, "get_atime", "0000-01-01 00:00:00") - expect_snapshot(translate_package(verbose = TRUE)) + expect_normalized_snapshot(translate_package(verbose = TRUE)) pkg_files <- list.files(recursive=TRUE) @@ -53,7 +53,7 @@ with_restoration_test_that( conn = "test-translate-package-r_msg-1.input", { mockery::stub(translate_package, "get_atime", "0000-01-01 00:00:00") - expect_snapshot(translate_package(languages="zh_CN", verbose=TRUE)) + expect_normalized_snapshot(translate_package(languages="zh_CN", verbose=TRUE)) pkg_files <- list.files(recursive = TRUE) @@ -74,7 +74,7 @@ with_restoration_test_that( pkg = "r_msg", code = { mockery::stub(translate_package, "get_atime", "0000-01-01 00:00:00") - expect_snapshot(translate_package(languages="fa", verbose=TRUE)) + expect_normalized_snapshot(translate_package(languages="fa", verbose=TRUE)) } ) @@ -84,7 +84,7 @@ with_restoration_test_that( conn = "test-translate-package-r_fuzzy-1.input", code = { mockery::stub(translate_package, "get_atime", "0000-01-01 00:00:00") - expect_snapshot(translate_package(languages="zh_CN", verbose=TRUE)) + expect_normalized_snapshot(translate_package(languages="zh_CN", verbose=TRUE)) } ) @@ -93,7 +93,7 @@ with_restoration_test_that( "translate_package identifies potential translations in cat() calls", pkg = "r_cat_msg", conn = "test-translate-package-r_cat_message-1.input", - code = expect_snapshot(translate_package(languages = "zh_CN")) + code = expect_normalized_snapshot(translate_package(languages = "zh_CN")) ) # NB: this test will fail if test_that is re-run on the same R session since potools' @@ -105,7 +105,7 @@ with_restoration_test_that( # earlier, did Arabic, but now that's an included language. switched two Welsh on the # (perhaps naive) judgment that it's unlikely to enter our scope anytime soon # and because there are still several (4) plural forms - code = expect_snapshot(translate_package(languages = 'cy')) + code = expect_normalized_snapshot(translate_package(languages = 'cy')) ) # #183 @@ -114,21 +114,21 @@ with_restoration_test_that( pkg = "r_msg", conn = "test-translate-package-r_msg-5.input", # Catalan -- romance language with >1 plural - code = expect_snapshot(translate_package(languages='ca', diagnostics=NULL)) + code = expect_normalized_snapshot(translate_package(languages='ca', diagnostics=NULL)) ) with_restoration_test_that( 'Erroneous messages stop get_specials_metadata (mixed use of template redirects)', pkg = "r_msg", conn = 'test-translate-package-r_msg-3.input', - code = expect_snapshot(translate_package(languages='zh_CN', diagnostics=NULL), error=TRUE) + code = expect_normalized_snapshot(translate_package(languages='zh_CN', diagnostics=NULL), error=TRUE) ) with_restoration_test_that( 'Erroneous messages stop get_specials_metadata (duplicate redirects with different formatters)', pkg = "r_msg", conn = 'test-translate-package-r_msg-4.input', - code = expect_snapshot(translate_package(languages='zh_CN', diagnostics=NULL), error=TRUE) + code = expect_normalized_snapshot(translate_package(languages='zh_CN', diagnostics=NULL), error=TRUE) ) with_restoration_test_that( @@ -136,7 +136,7 @@ with_restoration_test_that( pkg = "r_src_c", conn = 'test-translate-package-r_src_c-1.input', { - expect_snapshot(translate_package(languages="zh_CN", diagnostics = check_untranslated_src)) + expect_normalized_snapshot(translate_package(languages="zh_CN", diagnostics = check_untranslated_src)) pkg_files <- list.files(recursive = TRUE) expect_true("po/R-zh_CN.po" %in% pkg_files) @@ -187,7 +187,7 @@ with_restoration_test_that( conn = 'test-translate-package-r_src_fuzzy-1.input', code = { mockery::stub(translate_package, "get_atime", "0000-01-01 00:00:00") - expect_snapshot(translate_package(languages="zh_CN", verbose=TRUE)) + expect_normalized_snapshot(translate_package(languages="zh_CN", verbose=TRUE)) } ) @@ -269,7 +269,7 @@ with_restoration_test_that( pkg = "unusual_msg", conn = "test-translate-package-unusual_msg-1.input", { - expect_snapshot(translate_package(languages="es", copyright="Mata Hari", diagnostics=NULL)) + expect_normalized_snapshot(translate_package(languages="es", copyright="Mata Hari", diagnostics=NULL)) r_pot_lines <- readLines(file.path("po", "R-rMsgUnusual.pot")) src_pot_lines <- readLines(file.path("po", "rMsgUnusual.pot")) @@ -309,7 +309,7 @@ with_restoration_test_that( pkg = "unusual_msg", conn = "test-translate-package-unusual_msg-1.input", { - expect_snapshot(translate_package(languages = "es", use_base_rules = TRUE, diagnostics = NULL)) + expect_normalized_snapshot(translate_package(languages = "es", use_base_rules = TRUE, diagnostics = NULL)) r_pot_lines <- readLines(file.path("po", "R-rMsgUnusual.pot")) src_pot_lines <- readLines(file.path("po", "rMsgUnusual.pot")) @@ -444,5 +444,5 @@ with_restoration_test_that( "max_translations works as expected", pkg = "r_msg", conn = 'test-translate-package-r_msg-1.input', - code = expect_snapshot(translate_package(languages='es', max_translations = 1L, diagnostics = NULL)) + code = expect_normalized_snapshot(translate_package(languages='es', max_translations = 1L, diagnostics = NULL)) ) From e0082e8be108443cdc13d70308dd176f1341dea5 Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Wed, 10 Nov 2021 21:34:26 -0800 Subject: [PATCH 13/22] re-normalize for window --- tests/testthat/_snaps/translate-package.md | 26 +++++++++++----------- tests/testthat/helpers.R | 20 ++++++++++++----- 2 files changed, 28 insertions(+), 18 deletions(-) diff --git a/tests/testthat/_snaps/translate-package.md b/tests/testthat/_snaps/translate-package.md index 36da6ab3..9dcba75b 100644 --- a/tests/testthat/_snaps/translate-package.md +++ b/tests/testthat/_snaps/translate-package.md @@ -29,7 +29,7 @@ Getting R-level messages. Running message diagnostics. Writing R-rMsg.pot - Generating en@quot translations + running msgfmt on R-en@quot.po succeeded; output: 5 translated messages. No languages provided; finishing @@ -43,7 +43,7 @@ Getting R-level messages. Running message diagnostics. Writing R-rMsg.pot - Generating en@quot translations + running msgfmt on R-en@quot.po succeeded; output: 5 translated messages. Beginning new translations for zh_CN (Mainland Chinese/普通话); found 6 untranslated messages @@ -108,7 +108,7 @@ Getting R-level messages. Running message diagnostics. Writing R-rMsg.pot - Generating en@quot translations + running msgfmt on R-en@quot.po succeeded; output: 5 translated messages. Found existing R translations for fa (Farsi/فارسی) in ./po/R-fa.po. Running msgmerge. @@ -127,7 +127,7 @@ Getting R-level messages. Running message diagnostics. Writing R-rFuzzyMsg.pot - Generating en@quot translations + running msgfmt on R-en@quot.po succeeded; output: 3 translated messages. Found existing R translations for zh_CN (Mainland Chinese/普通话) in ./po/R-zh_CN.po. Running msgmerge. @@ -224,7 +224,7 @@ translate_package(languages = "cy") Message Writing R-rMsg.pot - Generating en@quot translations + 'cy' is not a known language. Please help supply some metadata about it. You can check https://l10n.gnome.org/teams/ Output @@ -362,7 +362,7 @@ translate_package(languages = "ca", diagnostics = NULL) Message Writing R-rMsg.pot - Generating en@quot translations + 'ca' is not a known language. Please help supply some metadata about it. You can check https://l10n.gnome.org/teams/ Output @@ -420,7 +420,7 @@ translate_package(languages = "zh_CN", diagnostics = NULL) Message Writing R-rMsg.pot - Generating en@quot translations + Output Thanks! Who should be credited with these translations? And what is their email? @@ -461,7 +461,7 @@ translate_package(languages = "zh_CN", diagnostics = NULL) Message Writing R-rMsg.pot - Generating en@quot translations + Output Thanks! Who should be credited with these translations? And what is their email? @@ -500,7 +500,7 @@ translate_package(languages = "zh_CN", diagnostics = check_untranslated_src) Message Writing R-rSrcMsg.pot - Generating en@quot translations + Output Thanks! Who should be credited with these translations? And what is their email? @@ -560,7 +560,7 @@ Getting src-level messages. Running message diagnostics. Writing R-rSrcFuzzyMsg.pot - Generating en@quot translations + running msgfmt on R-en@quot.po succeeded; output: 1 translated message. running msgfmt on en@quot.po succeeded; output: @@ -583,7 +583,7 @@ translate_package(languages = "es", copyright = "Mata Hari", diagnostics = NULL) Message Writing R-rMsgUnusual.pot - Generating en@quot translations + Output Thanks! Who should be credited with these translations? And what is their email? @@ -933,7 +933,7 @@ translate_package(languages = "es", use_base_rules = TRUE, diagnostics = NULL) Message Writing R-rMsgUnusual.pot - Generating en@quot translations + Output Thanks! Who should be credited with these translations? And what is their email? @@ -1283,7 +1283,7 @@ translate_package(languages = "es", max_translations = 1L, diagnostics = NULL) Message Writing R-rMsg.pot - Generating en@quot translations + Output Thanks! Who should be credited with these translations? And what is their email? diff --git a/tests/testthat/helpers.R b/tests/testthat/helpers.R index edf30cc4..d919638b 100644 --- a/tests/testthat/helpers.R +++ b/tests/testthat/helpers.R @@ -63,10 +63,20 @@ local_test_package <- function(..., .envir = parent.frame()) { temp } -# different platforms/installations of gettext apparently -# produce a different number of "." in "progress" output; normalize -standardize_dots <- standardise_dots <- function(x) { - gsub("\\.{2,}", ".", x) +normalize_output <- function(x) { + # different platforms/installations of gettext apparently + # produce a different number of "." in "progress" output; normalize + x <- gsub("\\.{2,}", ".", x) + + # en@quot translations are not produced on Windows (as of now) + idx <- grep("Generating en@quot translations", x, fixed = TRUE) + if (length(idx)) { + if (grepl("running msgfmt.*en@quot\\.po", x[idx + 1L])) { + idx <- idx + 0:2 + } + x <- x[-idx] + } + x } -expect_normalized_snapshot <- function(...) expect_snapshot(..., transform = standardize_dots) +expect_normalized_snapshot <- function(...) expect_snapshot(..., transform = normalize_output) From 8558cf2479195e41a783677c4141eebf933a7a05 Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Wed, 10 Nov 2021 21:53:05 -0800 Subject: [PATCH 14/22] improve en@quot removal --- R/utils.R | 2 +- tests/testthat/_snaps/translate-package.md | 18 ++++++------------ tests/testthat/helpers.R | 10 +++++----- 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/R/utils.R b/R/utils.R index 1e70bef1..428cd492 100644 --- a/R/utils.R +++ b/R/utils.R @@ -194,4 +194,4 @@ is_testing = function() identical(Sys.getenv("TESTTHAT"), "true") is_gnu_gettext = function() any(grepl("GNU gettext", system('gettext --version', intern=TRUE))) # wrapper function to facilitate mocking, else tests --> stochastic output -get_atime <- function(f) format(file.info(f, extra_cols = FALSE)$atime) +get_atime <- function(f) format(file.info(f, extra_cols = FALSE)$atime) # nocov. Always mocked in tests. diff --git a/tests/testthat/_snaps/translate-package.md b/tests/testthat/_snaps/translate-package.md index 9dcba75b..6fc962c8 100644 --- a/tests/testthat/_snaps/translate-package.md +++ b/tests/testthat/_snaps/translate-package.md @@ -30,8 +30,7 @@ Running message diagnostics. Writing R-rMsg.pot - running msgfmt on R-en@quot.po succeeded; output: - 5 translated messages. + No languages provided; finishing --- @@ -44,8 +43,7 @@ Running message diagnostics. Writing R-rMsg.pot - running msgfmt on R-en@quot.po succeeded; output: - 5 translated messages. + Beginning new translations for zh_CN (Mainland Chinese/普通话); found 6 untranslated messages (To quit translating, press 'Esc'; progress will be saved) Output @@ -109,8 +107,7 @@ Running message diagnostics. Writing R-rMsg.pot - running msgfmt on R-en@quot.po succeeded; output: - 5 translated messages. + Found existing R translations for fa (Farsi/فارسی) in ./po/R-fa.po. Running msgmerge. . done. Translations for fa are up to date! Skipping. @@ -128,8 +125,7 @@ Running message diagnostics. Writing R-rFuzzyMsg.pot - running msgfmt on R-en@quot.po succeeded; output: - 3 translated messages. + Found existing R translations for zh_CN (Mainland Chinese/普通话) in ./po/R-zh_CN.po. Running msgmerge. . done. Found 2 translations marked as deprecated in ./po/R-zh_CN.po. @@ -561,10 +557,8 @@ Running message diagnostics. Writing R-rSrcFuzzyMsg.pot - running msgfmt on R-en@quot.po succeeded; output: - 1 translated message. - running msgfmt on en@quot.po succeeded; output: - 2 translated messages. + + Found existing R translations for zh_CN (Mainland Chinese/普通话) in ./po/R-zh_CN.po. Running msgmerge. . done. Found existing src translations for zh_CN (Mainland Chinese/普通话) in ./po/zh_CN.po. Running msgmerge. diff --git a/tests/testthat/helpers.R b/tests/testthat/helpers.R index d919638b..ac76f861 100644 --- a/tests/testthat/helpers.R +++ b/tests/testthat/helpers.R @@ -69,12 +69,12 @@ normalize_output <- function(x) { x <- gsub("\\.{2,}", ".", x) # en@quot translations are not produced on Windows (as of now) - idx <- grep("Generating en@quot translations", x, fixed = TRUE) + x <- grep("Generating en@quot translations", x, fixed = TRUE, invert = TRUE, value = TRUE) + + # this is produced alongside the previous message, but in a different iteration of transform() + idx <- grep("running msgfmt on (?:R-)?en@quot\\.po", x) if (length(idx)) { - if (grepl("running msgfmt.*en@quot\\.po", x[idx + 1L])) { - idx <- idx + 0:2 - } - x <- x[-idx] + x <- x[-(idx + 0:1)] } x } From a5076762e01d82ac4d2364055053fc8662a43c80 Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Thu, 11 Nov 2021 20:34:07 -0800 Subject: [PATCH 15/22] attempt to set encoding --- R/translate_package.R | 47 +++++++++++++++++++------------------------ tests/testthat.R | 9 ++++++++- 2 files changed, 29 insertions(+), 27 deletions(-) diff --git a/R/translate_package.R b/R/translate_package.R index 6530d23d..9ade7771 100644 --- a/R/translate_package.R +++ b/R/translate_package.R @@ -478,39 +478,34 @@ invisible({ gettext("when n is not 1") }) -# take from those present in r-devel: -# ls -1 ~/svn/R-devel/src/library/*/po/*.po | \ -# awk -F"[./]" '{print $10}' | \ -# sed -r 's/^R(Gui)?-//g' | sort -u | \ -# awk '{print " ", $1, " = ,"}' -# alternatively, a more complete list can be found on some websites: -# https://saimana.com/list-of-country-locale-code/ -# nplurals,plural info from https://l10n.gnome.org/teams/ -# NB: looks may be deceiving for right-to-left scripts (e.g. Farsi), where the -# displayed below might not be in the order it is parsed. -# assign to .potools, not a package env, to keep more readily mutable inside update_metadata() -.potools$KNOWN_LANGUAGES = fread(system.file('extdata', 'language_metadata.csv', package='potools'), key='code') - -# the 'plural' column above is designed for computers; -# translate that to something human-legible here. -# NB: 'plural' is 0-based (like in the .po file), but -# 'plural_index' is 1-based (to match the above R-level code). -# assign to .potools, not a package env, to keep more readily mutable inside update_metadata() -.potools$PLURAL_RANGE_STRINGS = fread( - system.file('extdata', 'plurals_metadata.csv', package='potools'), - key = c('plural', 'plural_index') -) - # for testing; unexported -# nocov start reset_language_metadata = function() { + # initially taken from those present in r-devel: + # ls -1 ~/svn/R-devel/src/library/*/po/*.po | \ + # awk -F"[./]" '{print $10}' | \ + # sed -r 's/^R(Gui)?-//g' | sort -u | \ + # awk '{print " ", $1, " = ,"}' + # for extension, a more complete list can be found on some websites: + # https://saimana.com/list-of-country-locale-code/ + # nplurals,plural info from https://l10n.gnome.org/teams/ + # NB: looks may be deceiving for right-to-left scripts (e.g. Farsi), where the + # displayed below might not be in the order it is parsed. + # assign to .potools, not a package env, to keep more readily mutable + # inside update_metadata() & elsewhere .potools$KNOWN_LANGUAGES = fread( system.file('extdata', 'language_metadata.csv', package='potools'), - key='code' + encoding = "UTF-8", + key = 'code' ) + # the 'plural' column above is designed for computers; + # translate that to something human-legible here. + # NB: 'plural' is 0-based (like in the .po file), but + # 'plural_index' is 1-based (to match the above R-level code). + # assign to .potools, not a package env, to keep more readily mutable inside update_metadata() .potools$PLURAL_RANGE_STRINGS = fread( system.file('extdata', 'plurals_metadata.csv', package='potools'), key = c('plural', 'plural_index') ) } -# nocov end + +reset_language_metadata() diff --git a/tests/testthat.R b/tests/testthat.R index 700cef57..fd0ed62c 100755 --- a/tests/testthat.R +++ b/tests/testthat.R @@ -1,6 +1,13 @@ library(withr) library(testthat) -old = options(potools.use_colors = FALSE, width = 80L) +old = options( + potools.use_colors = FALSE, + width = 80L, + warnPartialMatchArgs = TRUE, + warnPartialMatchAttr = TRUE, + warnPartialMatchDollar = TRUE +) +withr::local_envvar("_R_CHECK_LENGTH_1_CONDITION_" = "true") library(potools) # Failed on Solaris because the command-line tools are missing there (which means tools doesn't work there), #186 From 496b750656cf542d07af0c32b3a77b6610a00665 Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Thu, 11 Nov 2021 21:29:56 -0800 Subject: [PATCH 16/22] use bleeding-edge testthat in an attempt to match windows snapshot --- R/translate_package.R | 1 + tests/testthat/_snaps/translate-package.md | 19 ------------------- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/R/translate_package.R b/R/translate_package.R index 9ade7771..f53d6245 100644 --- a/R/translate_package.R +++ b/R/translate_package.R @@ -494,6 +494,7 @@ reset_language_metadata = function() { # inside update_metadata() & elsewhere .potools$KNOWN_LANGUAGES = fread( system.file('extdata', 'language_metadata.csv', package='potools'), + # encoding is required for the full_name_native field to display well on Windows encoding = "UTF-8", key = 'code' ) diff --git a/tests/testthat/_snaps/translate-package.md b/tests/testthat/_snaps/translate-package.md index 6fc962c8..3c10931e 100644 --- a/tests/testthat/_snaps/translate-package.md +++ b/tests/testthat/_snaps/translate-package.md @@ -29,8 +29,6 @@ Getting R-level messages. Running message diagnostics. Writing R-rMsg.pot - - No languages provided; finishing --- @@ -42,8 +40,6 @@ Getting R-level messages. Running message diagnostics. Writing R-rMsg.pot - - Beginning new translations for zh_CN (Mainland Chinese/普通话); found 6 untranslated messages (To quit translating, press 'Esc'; progress will be saved) Output @@ -106,8 +102,6 @@ Getting R-level messages. Running message diagnostics. Writing R-rMsg.pot - - Found existing R translations for fa (Farsi/فارسی) in ./po/R-fa.po. Running msgmerge. . done. Translations for fa are up to date! Skipping. @@ -124,8 +118,6 @@ Getting R-level messages. Running message diagnostics. Writing R-rFuzzyMsg.pot - - Found existing R translations for zh_CN (Mainland Chinese/普通话) in ./po/R-zh_CN.po. Running msgmerge. . done. Found 2 translations marked as deprecated in ./po/R-zh_CN.po. @@ -220,7 +212,6 @@ translate_package(languages = "cy") Message Writing R-rMsg.pot - 'cy' is not a known language. Please help supply some metadata about it. You can check https://l10n.gnome.org/teams/ Output @@ -358,7 +349,6 @@ translate_package(languages = "ca", diagnostics = NULL) Message Writing R-rMsg.pot - 'ca' is not a known language. Please help supply some metadata about it. You can check https://l10n.gnome.org/teams/ Output @@ -416,7 +406,6 @@ translate_package(languages = "zh_CN", diagnostics = NULL) Message Writing R-rMsg.pot - Output Thanks! Who should be credited with these translations? And what is their email? @@ -457,7 +446,6 @@ translate_package(languages = "zh_CN", diagnostics = NULL) Message Writing R-rMsg.pot - Output Thanks! Who should be credited with these translations? And what is their email? @@ -496,7 +484,6 @@ translate_package(languages = "zh_CN", diagnostics = check_untranslated_src) Message Writing R-rSrcMsg.pot - Output Thanks! Who should be credited with these translations? And what is their email? @@ -556,9 +543,6 @@ Getting src-level messages. Running message diagnostics. Writing R-rSrcFuzzyMsg.pot - - - Found existing R translations for zh_CN (Mainland Chinese/普通话) in ./po/R-zh_CN.po. Running msgmerge. . done. Found existing src translations for zh_CN (Mainland Chinese/普通话) in ./po/zh_CN.po. Running msgmerge. @@ -577,7 +561,6 @@ translate_package(languages = "es", copyright = "Mata Hari", diagnostics = NULL) Message Writing R-rMsgUnusual.pot - Output Thanks! Who should be credited with these translations? And what is their email? @@ -927,7 +910,6 @@ translate_package(languages = "es", use_base_rules = TRUE, diagnostics = NULL) Message Writing R-rMsgUnusual.pot - Output Thanks! Who should be credited with these translations? And what is their email? @@ -1277,7 +1259,6 @@ translate_package(languages = "es", max_translations = 1L, diagnostics = NULL) Message Writing R-rMsg.pot - Output Thanks! Who should be credited with these translations? And what is their email? From 13dc814ed386ab48c3818ac45e0af6c9b819fc96 Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Sat, 13 Nov 2021 23:55:44 -0800 Subject: [PATCH 17/22] try writeLines() in fuzzy messages --- R/find_fuzzy_messages.R | 4 ++-- tests/testthat/_snaps/translate-package.md | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/R/find_fuzzy_messages.R b/R/find_fuzzy_messages.R index d0955f82..c51e5a1f 100644 --- a/R/find_fuzzy_messages.R +++ b/R/find_fuzzy_messages.R @@ -10,13 +10,13 @@ find_fuzzy_messages <- function(message_data, lang_file) { old_message_data[idx & type == 'singular', { if (.N > 0L) { message(' ** SINGULAR MESSAGES **') - cat(rbind(dashes, msgid, msgstr), sep='\n') + writeLines(rbind(dashes, msgid, msgstr), useBytes=TRUE) } }] old_message_data[idx & type == 'plural', { if (.N > 0L) { message(' ** PLURAL MESSAGES **') - cat(do.call(rbind, c(list(dashes), msgid_plural, msgstr_plural)), sep='\n') + writeLines(do.call(rbind, c(list(dashes), msgid_plural, msgstr_plural)), useBytes=TRUE) } }] diff --git a/tests/testthat/_snaps/translate-package.md b/tests/testthat/_snaps/translate-package.md index 3c10931e..6fc962c8 100644 --- a/tests/testthat/_snaps/translate-package.md +++ b/tests/testthat/_snaps/translate-package.md @@ -29,6 +29,8 @@ Getting R-level messages. Running message diagnostics. Writing R-rMsg.pot + + No languages provided; finishing --- @@ -40,6 +42,8 @@ Getting R-level messages. Running message diagnostics. Writing R-rMsg.pot + + Beginning new translations for zh_CN (Mainland Chinese/普通话); found 6 untranslated messages (To quit translating, press 'Esc'; progress will be saved) Output @@ -102,6 +106,8 @@ Getting R-level messages. Running message diagnostics. Writing R-rMsg.pot + + Found existing R translations for fa (Farsi/فارسی) in ./po/R-fa.po. Running msgmerge. . done. Translations for fa are up to date! Skipping. @@ -118,6 +124,8 @@ Getting R-level messages. Running message diagnostics. Writing R-rFuzzyMsg.pot + + Found existing R translations for zh_CN (Mainland Chinese/普通话) in ./po/R-zh_CN.po. Running msgmerge. . done. Found 2 translations marked as deprecated in ./po/R-zh_CN.po. @@ -212,6 +220,7 @@ translate_package(languages = "cy") Message Writing R-rMsg.pot + 'cy' is not a known language. Please help supply some metadata about it. You can check https://l10n.gnome.org/teams/ Output @@ -349,6 +358,7 @@ translate_package(languages = "ca", diagnostics = NULL) Message Writing R-rMsg.pot + 'ca' is not a known language. Please help supply some metadata about it. You can check https://l10n.gnome.org/teams/ Output @@ -406,6 +416,7 @@ translate_package(languages = "zh_CN", diagnostics = NULL) Message Writing R-rMsg.pot + Output Thanks! Who should be credited with these translations? And what is their email? @@ -446,6 +457,7 @@ translate_package(languages = "zh_CN", diagnostics = NULL) Message Writing R-rMsg.pot + Output Thanks! Who should be credited with these translations? And what is their email? @@ -484,6 +496,7 @@ translate_package(languages = "zh_CN", diagnostics = check_untranslated_src) Message Writing R-rSrcMsg.pot + Output Thanks! Who should be credited with these translations? And what is their email? @@ -543,6 +556,9 @@ Getting src-level messages. Running message diagnostics. Writing R-rSrcFuzzyMsg.pot + + + Found existing R translations for zh_CN (Mainland Chinese/普通话) in ./po/R-zh_CN.po. Running msgmerge. . done. Found existing src translations for zh_CN (Mainland Chinese/普通话) in ./po/zh_CN.po. Running msgmerge. @@ -561,6 +577,7 @@ translate_package(languages = "es", copyright = "Mata Hari", diagnostics = NULL) Message Writing R-rMsgUnusual.pot + Output Thanks! Who should be credited with these translations? And what is their email? @@ -910,6 +927,7 @@ translate_package(languages = "es", use_base_rules = TRUE, diagnostics = NULL) Message Writing R-rMsgUnusual.pot + Output Thanks! Who should be credited with these translations? And what is their email? @@ -1259,6 +1277,7 @@ translate_package(languages = "es", max_translations = 1L, diagnostics = NULL) Message Writing R-rMsg.pot + Output Thanks! Who should be credited with these translations? And what is their email? From 7cc62d1451adc663fb2b5ccc6fdbbf9a69ea2fb8 Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Wed, 17 Nov 2021 22:33:21 -0800 Subject: [PATCH 18/22] some improvement on UTF-8 guarding --- R/get_po_messages.R | 8 +++++--- R/utils.R | 15 +++++++++++++++ R/write_po_file.R | 11 ++++------- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/R/get_po_messages.R b/R/get_po_messages.R index c8f4b2a6..9958a15b 100644 --- a/R/get_po_messages.R +++ b/R/get_po_messages.R @@ -123,12 +123,14 @@ get_po_messages <- function(po_file) { msg_j = msg_j + 1L } - # somewhat hacky approach -- strip the comment markers & recurse - writeLines( + # somewhat hacky approach -- strip the comment markers & recurse. + # beware of potential encoding dragons. + + tmp_conn <- write_utf8( gsub("^#~ ", "", grep("^#~ ", po_lines, value = TRUE)), tmp <- tempfile() ) - on.exit(unlink(tmp)) + on.exit({ close(tmp_conn); unlink(tmp) }) deprecated = get_po_messages(tmp) if (nrow(deprecated) > 0L) { set(deprecated, NULL, 'fuzzy', 2L) diff --git a/R/utils.R b/R/utils.R index 428cd492..01a2b73f 100644 --- a/R/utils.R +++ b/R/utils.R @@ -195,3 +195,18 @@ is_gnu_gettext = function() any(grepl("GNU gettext", system('gettext --version', # wrapper function to facilitate mocking, else tests --> stochastic output get_atime <- function(f) format(file.info(f, extra_cols = FALSE)$atime) # nocov. Always mocked in tests. + +# a safer version of writeLines that's better at avoiding encoding hell +# cat seems to fail at writing UTF-8 on Windows; useBytes should do the trick instead: +# https://stackoverflow.com/q/10675360 +# "native.enc" supplied explicitly thanks to: +# https://kevinushey.github.io/blog/2018/02/21/string-encoding-and-r/ +write_utf8 <- function(lines, file, open = "w+") { + if (!inherits(file, "connection")) { + file <- file(file, open, encoding = "native.enc") + } + + writeLines(lines, file, useBytes = TRUE) + # don't necessarily close; let calling env do so + return(file) +} diff --git a/R/write_po_file.R b/R/write_po_file.R index 942d7126..da8ea54f 100644 --- a/R/write_po_file.R +++ b/R/write_po_file.R @@ -158,6 +158,7 @@ write_po_files <- function(message_data, po_dir, params, template = FALSE, use_b #' tmp_po <- tempfile(fileext = '.po'), #' metadata #' ) +#' # NB: in general, beware of encoding in this snippet #' writeLines(readLines(tmp_po)) #' #' # write .pot template @@ -181,18 +182,14 @@ write_po_file <- function( template = endsWith(po_file, ".pot") - # cat seems to fail at writing UTF-8 on Windows; useBytes should do the trick instead: - # https://stackoverflow.com/q/10675360 - po_conn = file(po_file, "wb") - on.exit(close(po_conn)) - po_header = format( metadata, template = template, use_plurals = any(message_data$type == "plural") ) - writeLines(con=po_conn, useBytes=TRUE, po_header) + po_conn <- write_utf8(po_header, po_file, "wb") + on.exit(close(po_conn)) # drop untranslated strings, collapse duplicates, drop unneeded data. # for now, treating R & src separately so they can be treated differently; eventually this should @@ -286,7 +283,7 @@ write_po_file <- function( ) } - writeLines(con=po_conn, useBytes=TRUE, out_lines) + write_utf8(out_lines, po_conn) }] } From cdbfce5256adc2ad12641dcbc70d12689c04c3a5 Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Wed, 17 Nov 2021 22:47:57 -0800 Subject: [PATCH 19/22] update snaps --- tests/testthat/_snaps/translate-package.md | 1280 ++++++++++---------- 1 file changed, 631 insertions(+), 649 deletions(-) diff --git a/tests/testthat/_snaps/translate-package.md b/tests/testthat/_snaps/translate-package.md index 6fc962c8..ee97f870 100644 --- a/tests/testthat/_snaps/translate-package.md +++ b/tests/testthat/_snaps/translate-package.md @@ -62,35 +62,35 @@ * Whenever templates or escaping is happening in a string, these will be 'highlighted' by carets (^) in the line below Output - File: foo.R - Call: base::warning("I warned you!") - Message: I warned you! + File: foo.R + Call: base::warning("I warned you!") + Message: I warned you! - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: foo.R - Call: stop("Oh no you don't!") - Message: Oh no you don't! + File: foo.R + Call: stop("Oh no you don't!") + Message: Oh no you don't! - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: foo.R - Call: gettext("Hi there") - Message: Hi there + File: foo.R + Call: gettext("Hi there") + Message: Hi there - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s ^---^ ^^ ^^ - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") - Plural message: small fail + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") + Plural message: small fail - How would you translate this message into Mainland Chinese independently of n? + How would you translate this message into Mainland Chinese independently of n? Message Writing R-zh_CN.po Recompiling 'zh_CN' R translation @@ -128,24 +128,6 @@ Found existing R translations for zh_CN (Mainland Chinese/普通话) in ./po/R-zh_CN.po. Running msgmerge. . done. - Found 2 translations marked as deprecated in ./po/R-zh_CN.po. - Typically, this means the corresponding error messages have been refactored. - Reproducing these messages here for your reference since they might still provide some utility. - ** SINGULAR MESSAGES ** - Output - ------------------------------------------------------------------------ - Oh no you don't! - 当然不会! - Message - ** PLURAL MESSAGES ** - Output - ------------------------------------------------------------------------ - small fail\n - 失败了\n - ------------------------------------------------------------------------ - big fail\n - 失败了\n - Message Beginning new translations for zh_CN (Mainland Chinese/普通话); found 2 untranslated messages (To quit translating, press 'Esc'; progress will be saved) Output @@ -164,17 +146,17 @@ * Whenever templates or escaping is happening in a string, these will be 'highlighted' by carets (^) in the line below Output - File: foo.R - Call: stop("I really wish you'd reconsider") - Message: I really wish you'd reconsider + File: foo.R + Call: stop("I really wish you'd reconsider") + Message: I really wish you'd reconsider - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: foo.R - Call: ngettext(length(x), "SOMEWHAT EPIC FAIL", "MAJORLY EPIC FAIL") - Plural message: SOMEWHAT EPIC FAIL + File: foo.R + Call: ngettext(length(x), "SOMEWHAT EPIC FAIL", "MAJORLY EPIC FAIL") + Plural message: SOMEWHAT EPIC FAIL - How would you translate this message into Mainland Chinese independently of n? + How would you translate this message into Mainland Chinese independently of n? Message Writing R-zh_CN.po Recompiling 'zh_CN' R translation @@ -190,28 +172,28 @@ Output Problematic call: - base::cat("I warned you!", fill=TRUE, append=TRUE) - < File:foo.R, Line:2 > + base::cat("I warned you!", fill=TRUE, append=TRUE) + < File:foo.R, Line:2 > Potential replacement: - cat(gettext("I warned you!"), fill=TRUE) + cat(gettext("I warned you!"), fill=TRUE) Problematic call: - cat("Oh no", "you\ndon't!") - < File:foo.R, Line:8 > + cat("Oh no", "you\ndon't!") + < File:foo.R, Line:8 > Potential replacement: - cat(gettext("Oh no you\ndon't!")) + cat(gettext("Oh no you\ndon't!")) Problematic call: - cat("Hi", "boss", sep="xx") - < File:foo.R, Line:15 > + cat("Hi", "boss", sep="xx") + < File:foo.R, Line:15 > Potential replacement: - cat(gettext("Hixxboss")) + cat(gettext("Hixxboss")) Problematic call: - cat("This costs", x, "dollars") - < File:foo.R, Line:22 > + cat("This costs", x, "dollars") + < File:foo.R, Line:22 > Potential replacement: - cat(gettextf("This costs %s dollars", x)) + cat(gettextf("This costs %s dollars", x)) Exit now to repair any of these? [y/N] --- @@ -248,107 +230,107 @@ Thanks! Who should be credited with these translations? And what is their email? - File: foo.R - Call: base::warning("I warned you!") - Message: I warned you! + File: foo.R + Call: base::warning("I warned you!") + Message: I warned you! - How would you translate this message into Welsh? + How would you translate this message into Welsh? - File: foo.R - Call: stop("Oh no you don't!") - Message: Oh no you don't! + File: foo.R + Call: stop("Oh no you don't!") + Message: Oh no you don't! - How would you translate this message into Welsh? + How would you translate this message into Welsh? - File: foo.R - Call: gettext("Hi there") - Message: Hi there + File: foo.R + Call: gettext("Hi there") + Message: Hi there - How would you translate this message into Welsh? + How would you translate this message into Welsh? - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s ^---^ ^^ ^^ - How would you translate this message into Welsh? + How would you translate this message into Welsh? ** Oops! Invalid translation -- received the same set of templates + bordering newlines, but in incorrect order ([%.02f, %d, %s] vs [%.02f, %s, %d]). Recall that you can use %$N to do redirect, e.g. to swap the order of '%d %s' to be translated more naturally, your translation can use '%1$s %2$d'. Retrying. ** - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s ^---^ ^^ ^^ - How would you translate this message into Welsh? + How would you translate this message into Welsh? ** Oops! Invalid translation -- received templates + bordering newlines not present in the original: %s. Retrying. ** - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s ^---^ ^^ ^^ - How would you translate this message into Welsh? + How would you translate this message into Welsh? ** Oops! Invalid translation -- received the same set of templates + bordering newlines, but in incorrect order ([%.02f, %d, %s] vs [%1$.02f, %2$s, %3$d]). Recall that you can use %$N to do redirect, e.g. to swap the order of '%d %s' to be translated more naturally, your translation can use '%1$s %2$d'. Retrying. ** - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s ^---^ ^^ ^^ - How would you translate this message into Welsh? + How would you translate this message into Welsh? ** Oops! Invalid translation -- received 2 unique templated arguments + bordering newlines but there are 3 in the original. Retrying. ** - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s ^---^ ^^ ^^ - How would you translate this message into Welsh? + How would you translate this message into Welsh? ** Oops! Invalid translation -- received 4 unique templated arguments + bordering newlines but there are 3 in the original. Retrying. ** - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s ^---^ ^^ ^^ - How would you translate this message into Welsh? + How would you translate this message into Welsh? ** Oops! Invalid translation -- received 5 unique templated arguments + bordering newlines but there are 3 in the original. Retrying. ** - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s ^---^ ^^ ^^ - How would you translate this message into Welsh? + How would you translate this message into Welsh? - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") - Plural message: small fail + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") + Plural message: small fail - How would you translate this message into Welsh for n where 'plural' resolves to 0? + How would you translate this message into Welsh for n where 'plural' resolves to 0? - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") - Plural message: small fail + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") + Plural message: small fail - How would you translate this message into Welsh for n where 'plural' resolves to 1? + How would you translate this message into Welsh for n where 'plural' resolves to 1? - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") - Plural message: small fail + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") + Plural message: small fail - How would you translate this message into Welsh for n where 'plural' resolves to 2? + How would you translate this message into Welsh for n where 'plural' resolves to 2? - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") - Plural message: small fail + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") + Plural message: small fail - How would you translate this message into Welsh for n where 'plural' resolves to 3? + How would you translate this message into Welsh for n where 'plural' resolves to 3? Message Writing R-cy.po @@ -372,41 +354,41 @@ Thanks! Who should be credited with these translations? And what is their email? - File: foo.R - Call: base::warning("I warned you!") - Message: I warned you! + File: foo.R + Call: base::warning("I warned you!") + Message: I warned you! - How would you translate this message into Catalan? + How would you translate this message into Catalan? - File: foo.R - Call: stop("Oh no you don't!") - Message: Oh no you don't! + File: foo.R + Call: stop("Oh no you don't!") + Message: Oh no you don't! - How would you translate this message into Catalan? + How would you translate this message into Catalan? - File: foo.R - Call: gettext("Hi there") - Message: Hi there + File: foo.R + Call: gettext("Hi there") + Message: Hi there - How would you translate this message into Catalan? + How would you translate this message into Catalan? - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s ^---^ ^^ ^^ - How would you translate this message into Catalan? + How would you translate this message into Catalan? - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") - Plural message: small fail + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") + Plural message: small fail - How would you translate this message into Catalan when n = 1? + How would you translate this message into Catalan when n = 1? - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") - Plural message: small fail + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") + Plural message: small fail - How would you translate this message into Catalan when n is not 1? + How would you translate this message into Catalan when n is not 1? Message Writing R-ca.po @@ -421,29 +403,29 @@ Thanks! Who should be credited with these translations? And what is their email? - File: foo.R - Call: base::warning("I warned you!") - Message: I warned you! + File: foo.R + Call: base::warning("I warned you!") + Message: I warned you! - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: foo.R - Call: stop("Oh no you don't!") - Message: Oh no you don't! + File: foo.R + Call: stop("Oh no you don't!") + Message: Oh no you don't! - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: foo.R - Call: gettext("Hi there") - Message: Hi there + File: foo.R + Call: gettext("Hi there") + Message: Hi there - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s ^---^ ^^ ^^ - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? Error Invalid templated message. If any %N$ redirects are used, all templates must be redirected. Redirected tempates: %1$d @@ -462,29 +444,29 @@ Thanks! Who should be credited with these translations? And what is their email? - File: foo.R - Call: base::warning("I warned you!") - Message: I warned you! + File: foo.R + Call: base::warning("I warned you!") + Message: I warned you! - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: foo.R - Call: stop("Oh no you don't!") - Message: Oh no you don't! + File: foo.R + Call: stop("Oh no you don't!") + Message: Oh no you don't! - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: foo.R - Call: gettext("Hi there") - Message: Hi there + File: foo.R + Call: gettext("Hi there") + Message: Hi there - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s ^---^ ^^ ^^ - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? Error Invalid templated message string with redirects -- all messages pointing to the same input must have identical formats, but received [%1$s, %1$d] Message @@ -501,48 +483,48 @@ Thanks! Who should be credited with these translations? And what is their email? - File: foo.R - Call: message("a string") - Message: a string + File: foo.R + Call: message("a string") + Message: a string - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: bar.c - Call: N_("Don't translate me now.") - Message: Don't translate me now. + File: bar.c + Call: N_("Don't translate me now.") + Message: Don't translate me now. - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: bar.c - Call: Rprintf(_("an translated templated string: %" "" "\n"), 10000LL) - Message: an translated templated string: %\n + File: bar.c + Call: Rprintf(_("an translated templated string: %" "" "\n"), 10000LL) + Message: an translated templated string: %\n ^-------^^^ - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: bar.c - Call: warning(_("a translated "\ - "warning: %s\n"), stardust(z)) - Message: a translated warning: %s\n + File: bar.c + Call: warning(_("a translated "\ + "warning: %s\n"), stardust(z)) + Message: a translated warning: %s\n ^^^^ - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: bar.c - Call: snprintf(BUF, 100, _("a simple message")) - Message: a simple message + File: bar.c + Call: snprintf(BUF, 100, _("a simple message")) + Message: a simple message - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: bar.c - Call: ngettext("singular", "plural", z) - Plural message: singular + File: bar.c + Call: ngettext("singular", "plural", z) + Plural message: singular - How would you translate this message into Mainland Chinese independently of n? + How would you translate this message into Mainland Chinese independently of n? - File: bar.c - Call: ngettext("singular %d", "plural %d", z) - Plural message: singular %d + File: bar.c + Call: ngettext("singular %d", "plural %d", z) + Plural message: singular %d ^^ - How would you translate this message into Mainland Chinese independently of n? + How would you translate this message into Mainland Chinese independently of n? Message Writing R-zh_CN.po @@ -582,342 +564,342 @@ Thanks! Who should be credited with these translations? And what is their email? - File: copy1.R - Call: stop("copy one") - Message: copy one + File: copy1.R + Call: stop("copy one") + Message: copy one - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: copy2.R - Call: stop("copy two") - Message: copy two + File: copy2.R + Call: stop("copy two") + Message: copy two - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: base::warning(" I warned you!\n\n") - Message: I warned you! + File: foo.R + Call: base::warning(" I warned you!\n\n") + Message: I warned you! - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message(r"('abc')") - Message: 'abc' + File: foo.R + Call: message(r"('abc')") + Message: 'abc' - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message(R'("def")') - Message: "def" + File: foo.R + Call: message(R'("def")') + Message: "def" - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message("R('abc')") - Message: R('abc') + File: foo.R + Call: message("R('abc')") + Message: R('abc') - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message('r("def")') - Message: r("def") + File: foo.R + Call: message('r("def")') + Message: r("def") - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message(R'---[ghi]---') - Message: ghi + File: foo.R + Call: message(R'---[ghi]---') + Message: ghi - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: gettext("Hi there") - Message: Hi there + File: foo.R + Call: gettext("Hi there") + Message: Hi there - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: gettextf(fmt = "good %s ", "grief") - Message: good %s + File: foo.R + Call: gettextf(fmt = "good %s ", "grief") + Message: good %s ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: "first" + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: "first" - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: second + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: second - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: third + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: third - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: fourth + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: fourth - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: fifth + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: fifth - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: sixth + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: sixth - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message("\\n vs \n is OK") - Message: \\n vs \n is OK + File: foo.R + Call: message("\\n vs \n is OK") + Message: \\n vs \n is OK - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message("\\t vs \t is OK") - Message: \\t vs \t is OK + File: foo.R + Call: message("\\t vs \t is OK") + Message: \\t vs \t is OK - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message('strings with "quotes" are OK') - Message: strings with "quotes" are OK + File: foo.R + Call: message('strings with "quotes" are OK') + Message: strings with "quotes" are OK - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message("strings with escaped \"quotes\" are OK") - Message: strings with escaped "quotes" are OK + File: foo.R + Call: message("strings with escaped \"quotes\" are OK") + Message: strings with escaped "quotes" are OK - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: gettextf( paste("part 1 %s", "part 2"), "input" ) - Message: part 1 %s + File: foo.R + Call: gettextf( paste("part 1 %s", "part 2"), "input" ) + Message: part 1 %s ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: gettextf( paste("part 1 %s", "part 2"), "input" ) - Message: part 2 + File: foo.R + Call: gettextf( paste("part 1 %s", "part 2"), "input" ) + Message: part 2 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: ngettext( 10, "singular ", "plural " ) - Plural message: singular + File: foo.R + Call: ngettext( 10, "singular ", "plural " ) + Plural message: singular  - How would you translate this message into Spanish when n = 1? + How would you translate this message into Spanish when n = 1? - File: foo.R - Call: ngettext( 10, "singular ", "plural " ) - Plural message: singular + File: foo.R + Call: ngettext( 10, "singular ", "plural " ) + Plural message: singular  - How would you translate this message into Spanish when n is not 1? + How would you translate this message into Spanish when n is not 1? - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail ", msg2 = "big fail ") - Plural message: small fail + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail ", msg2 = "big fail ") + Plural message: small fail  - How would you translate this message into Spanish when n = 1? + How would you translate this message into Spanish when n = 1? - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail ", msg2 = "big fail ") - Plural message: small fail + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail ", msg2 = "big fail ") + Plural message: small fail  - How would you translate this message into Spanish when n is not 1? + How would you translate this message into Spanish when n is not 1? - File: ABCDEFGHIJKLMNOPQRSTUVWXYZ.c - Call: _("an translated templated string: %" "" "\n") - Message: an translated templated string: %\n + File: ABCDEFGHIJKLMNOPQRSTUVWXYZ.c + Call: _("an translated templated string: %" "" "\n") + Message: an translated templated string: %\n ^-------^^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: MSGs.c - Call: _("any old \ - message") - Message: any old message + File: MSGs.c + Call: _("any old \ + message") + Message: any old message - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: _("a message in a macro %s") - Message: a message in a macro %s + File: msg.c + Call: _("a message in a macro %s") + Message: a message in a macro %s ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: Rprintf(_("that's a mighty big %" """-sized wall over %"""), 100LL, 10L) - Message: that's a mighty big %-sized wall over % + File: msg.c + Call: Rprintf(_("that's a mighty big %" """-sized wall over %"""), 100LL, 10L) + Message: that's a mighty big %-sized wall over % ^-------^ ^-------^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: Rprintf(_("/* this is what a C comment looks like */ ")) - Message: /* this is what a C comment looks like */ + File: msg.c + Call: Rprintf(_("/* this is what a C comment looks like */ ")) + Message: /* this is what a C comment looks like */  - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: Rprintf(_("// this is what a C comment looks like %s "), "abc") - Message: // this is what a C comment looks like %s + File: msg.c + Call: Rprintf(_("// this is what a C comment looks like %s "), "abc") + Message: // this is what a C comment looks like %s  ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: Rprintf(_( + File: msg.c + Call: Rprintf(_( "01234567890123456789.01234567890123456789" "01234567890123456789.01234567890123456789" "01234567890123456789.01234567890123456789" "01234567890123456789.01234567890123456789" - )) - Message: 01234567890123456789.0123456789012345678901234567890123456789.0123456789012345678901234567890123456789.0123456789012345678901234567890123456789.01234567890123456789 + )) + Message: 01234567890123456789.0123456789012345678901234567890123456789.0123456789012345678901234567890123456789.0123456789012345678901234567890123456789.01234567890123456789 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("This message\nSpans two lines")) - Message: This message\nSpans two lines + File: msg.c + Call: error(_("This message\nSpans two lines")) + Message: This message\nSpans two lines - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("This one does not\n")) - Message: This one does not\n + File: msg.c + Call: error(_("This one does not\n")) + Message: This one does not\n ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("Exotic formatters like %I32u, %llx, %li, %ls, %lc")) - Message: Exotic formatters like %I32u, %llx, %li, %ls, %lc + File: msg.c + Call: error(_("Exotic formatters like %I32u, %llx, %li, %ls, %lc")) + Message: Exotic formatters like %I32u, %llx, %li, %ls, %lc ^---^ ^--^ ^-^ ^-^ ^-^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456\"890")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456"890 + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456\"890")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456"890 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345(\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345("890 + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345(\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345("890 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345'\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345'"890 + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345'\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345'"890 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345a\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345a"890 + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345a\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345a"890 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345A\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345A"890 + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345A\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345A"890 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345#\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345#"890 + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345#\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345#"890 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345@\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345@"890 + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345@\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345@"890 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 .%s.")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 .%s. + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 .%s.")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 .%s. ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 ?%s?")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 ?%s? + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 ?%s?")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 ?%s? ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 ;%s;")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 ;%s; + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 ;%s;")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 ;%s; ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 /%s/")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 /%s/ + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 /%s/")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 /%s/ ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 '%s'")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 '%s' + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 '%s'")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 '%s' ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 [%s]")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 [%s] + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 [%s]")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 [%s] ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 |%s|")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 |%s| + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 |%s|")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 |%s| ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 -%s-")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 -%s- + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 -%s-")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 -%s- ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_(test ? "abc" : "def")) - Message: abc + File: msg.c + Call: error(_(test ? "abc" : "def")) + Message: abc - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_(xxx "abc" "def")) - Message: abcdef + File: msg.c + Call: error(_(xxx "abc" "def")) + Message: abcdef - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: z.c - Call: error(_("You found me!")) - Message: You found me! + File: z.c + Call: error(_("You found me!")) + Message: You found me! - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: cairo/bedfellows.c - Call: _( - "any new message") - Message: any new message + File: cairo/bedfellows.c + Call: _( + "any new message") + Message: any new message - How would you translate this message into Spanish? + How would you translate this message into Spanish? Message Writing R-es.po @@ -932,342 +914,342 @@ Thanks! Who should be credited with these translations? And what is their email? - File: copy1.R - Call: stop("copy one") - Message: copy one + File: copy1.R + Call: stop("copy one") + Message: copy one - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: copy2.R - Call: stop("copy two") - Message: copy two + File: copy2.R + Call: stop("copy two") + Message: copy two - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: base::warning(" I warned you!\n\n") - Message: I warned you! + File: foo.R + Call: base::warning(" I warned you!\n\n") + Message: I warned you! - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message(r"('abc')") - Message: 'abc' + File: foo.R + Call: message(r"('abc')") + Message: 'abc' - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message(R'("def")') - Message: "def" + File: foo.R + Call: message(R'("def")') + Message: "def" - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message("R('abc')") - Message: R('abc') + File: foo.R + Call: message("R('abc')") + Message: R('abc') - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message('r("def")') - Message: r("def") + File: foo.R + Call: message('r("def")') + Message: r("def") - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message(R'---[ghi]---') - Message: ghi + File: foo.R + Call: message(R'---[ghi]---') + Message: ghi - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: gettext("Hi there") - Message: Hi there + File: foo.R + Call: gettext("Hi there") + Message: Hi there - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: gettextf(fmt = "good %s ", "grief") - Message: good %s + File: foo.R + Call: gettextf(fmt = "good %s ", "grief") + Message: good %s ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: "first" + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: "first" - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: second + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: second - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: third + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: third - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: fourth + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: fourth - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: fifth + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: fifth - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: sixth + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: sixth - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message("\\n vs \n is OK") - Message: \\n vs \n is OK + File: foo.R + Call: message("\\n vs \n is OK") + Message: \\n vs \n is OK - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message("\\t vs \t is OK") - Message: \\t vs \t is OK + File: foo.R + Call: message("\\t vs \t is OK") + Message: \\t vs \t is OK - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message('strings with "quotes" are OK') - Message: strings with "quotes" are OK + File: foo.R + Call: message('strings with "quotes" are OK') + Message: strings with "quotes" are OK - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message("strings with escaped \"quotes\" are OK") - Message: strings with escaped "quotes" are OK + File: foo.R + Call: message("strings with escaped \"quotes\" are OK") + Message: strings with escaped "quotes" are OK - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: gettextf( paste("part 1 %s", "part 2"), "input" ) - Message: part 1 %s + File: foo.R + Call: gettextf( paste("part 1 %s", "part 2"), "input" ) + Message: part 1 %s ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: gettextf( paste("part 1 %s", "part 2"), "input" ) - Message: part 2 + File: foo.R + Call: gettextf( paste("part 1 %s", "part 2"), "input" ) + Message: part 2 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: ngettext( 10, "singular ", "plural " ) - Plural message: singular + File: foo.R + Call: ngettext( 10, "singular ", "plural " ) + Plural message: singular  - How would you translate this message into Spanish when n = 1? + How would you translate this message into Spanish when n = 1? - File: foo.R - Call: ngettext( 10, "singular ", "plural " ) - Plural message: singular + File: foo.R + Call: ngettext( 10, "singular ", "plural " ) + Plural message: singular  - How would you translate this message into Spanish when n is not 1? + How would you translate this message into Spanish when n is not 1? - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail ", msg2 = "big fail ") - Plural message: small fail + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail ", msg2 = "big fail ") + Plural message: small fail  - How would you translate this message into Spanish when n = 1? + How would you translate this message into Spanish when n = 1? - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail ", msg2 = "big fail ") - Plural message: small fail + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail ", msg2 = "big fail ") + Plural message: small fail  - How would you translate this message into Spanish when n is not 1? + How would you translate this message into Spanish when n is not 1? - File: ABCDEFGHIJKLMNOPQRSTUVWXYZ.c - Call: _("an translated templated string: %" "" "\n") - Message: an translated templated string: %\n + File: ABCDEFGHIJKLMNOPQRSTUVWXYZ.c + Call: _("an translated templated string: %" "" "\n") + Message: an translated templated string: %\n ^-------^^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: MSGs.c - Call: _("any old \ - message") - Message: any old message + File: MSGs.c + Call: _("any old \ + message") + Message: any old message - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: _("a message in a macro %s") - Message: a message in a macro %s + File: msg.c + Call: _("a message in a macro %s") + Message: a message in a macro %s ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: Rprintf(_("that's a mighty big %" """-sized wall over %"""), 100LL, 10L) - Message: that's a mighty big %-sized wall over % + File: msg.c + Call: Rprintf(_("that's a mighty big %" """-sized wall over %"""), 100LL, 10L) + Message: that's a mighty big %-sized wall over % ^-------^ ^-------^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: Rprintf(_("/* this is what a C comment looks like */ ")) - Message: /* this is what a C comment looks like */ + File: msg.c + Call: Rprintf(_("/* this is what a C comment looks like */ ")) + Message: /* this is what a C comment looks like */  - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: Rprintf(_("// this is what a C comment looks like %s "), "abc") - Message: // this is what a C comment looks like %s + File: msg.c + Call: Rprintf(_("// this is what a C comment looks like %s "), "abc") + Message: // this is what a C comment looks like %s  ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: Rprintf(_( + File: msg.c + Call: Rprintf(_( "01234567890123456789.01234567890123456789" "01234567890123456789.01234567890123456789" "01234567890123456789.01234567890123456789" "01234567890123456789.01234567890123456789" - )) - Message: 01234567890123456789.0123456789012345678901234567890123456789.0123456789012345678901234567890123456789.0123456789012345678901234567890123456789.01234567890123456789 + )) + Message: 01234567890123456789.0123456789012345678901234567890123456789.0123456789012345678901234567890123456789.0123456789012345678901234567890123456789.01234567890123456789 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("This message\nSpans two lines")) - Message: This message\nSpans two lines + File: msg.c + Call: error(_("This message\nSpans two lines")) + Message: This message\nSpans two lines - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("This one does not\n")) - Message: This one does not\n + File: msg.c + Call: error(_("This one does not\n")) + Message: This one does not\n ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("Exotic formatters like %I32u, %llx, %li, %ls, %lc")) - Message: Exotic formatters like %I32u, %llx, %li, %ls, %lc + File: msg.c + Call: error(_("Exotic formatters like %I32u, %llx, %li, %ls, %lc")) + Message: Exotic formatters like %I32u, %llx, %li, %ls, %lc ^---^ ^--^ ^-^ ^-^ ^-^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456\"890")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456"890 + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456\"890")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456"890 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345(\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345("890 + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345(\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345("890 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345'\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345'"890 + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345'\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345'"890 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345a\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345a"890 + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345a\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345a"890 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345A\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345A"890 + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345A\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345A"890 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345#\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345#"890 + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345#\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345#"890 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345@\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345@"890 + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345@\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345@"890 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 .%s.")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 .%s. + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 .%s.")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 .%s. ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 ?%s?")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 ?%s? + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 ?%s?")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 ?%s? ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 ;%s;")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 ;%s; + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 ;%s;")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 ;%s; ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 /%s/")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 /%s/ + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 /%s/")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 /%s/ ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 '%s'")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 '%s' + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 '%s'")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 '%s' ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 [%s]")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 [%s] + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 [%s]")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 [%s] ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 |%s|")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 |%s| + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 |%s|")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 |%s| ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 -%s-")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 -%s- + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 -%s-")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 -%s- ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_(test ? "abc" : "def")) - Message: abc + File: msg.c + Call: error(_(test ? "abc" : "def")) + Message: abc - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_(xxx "abc" "def")) - Message: abcdef + File: msg.c + Call: error(_(xxx "abc" "def")) + Message: abcdef - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: z.c - Call: error(_("You found me!")) - Message: You found me! + File: z.c + Call: error(_("You found me!")) + Message: You found me! - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: cairo/bedfellows.c - Call: _( - "any new message") - Message: any new message + File: cairo/bedfellows.c + Call: _( + "any new message") + Message: any new message - How would you translate this message into Spanish? + How would you translate this message into Spanish? Message Writing R-es.po @@ -1282,11 +1264,11 @@ Thanks! Who should be credited with these translations? And what is their email? - File: foo.R - Call: base::warning("I warned you!") - Message: I warned you! + File: foo.R + Call: base::warning("I warned you!") + Message: I warned you! - How would you translate this message into Spanish? + How would you translate this message into Spanish? Message Writing R-es.po From a2e7cebec4fd266a9da693d8535ce09a5dd3a6a4 Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Wed, 17 Nov 2021 22:54:54 -0800 Subject: [PATCH 20/22] re-regenerate the snaps :| --- tests/testthat/_snaps/translate-package.md | 1262 ++++++++++---------- 1 file changed, 631 insertions(+), 631 deletions(-) diff --git a/tests/testthat/_snaps/translate-package.md b/tests/testthat/_snaps/translate-package.md index ee97f870..b4102057 100644 --- a/tests/testthat/_snaps/translate-package.md +++ b/tests/testthat/_snaps/translate-package.md @@ -62,35 +62,35 @@ * Whenever templates or escaping is happening in a string, these will be 'highlighted' by carets (^) in the line below Output - File: foo.R - Call: base::warning("I warned you!") - Message: I warned you! + File: foo.R + Call: base::warning("I warned you!") + Message: I warned you! - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: foo.R - Call: stop("Oh no you don't!") - Message: Oh no you don't! + File: foo.R + Call: stop("Oh no you don't!") + Message: Oh no you don't! - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: foo.R - Call: gettext("Hi there") - Message: Hi there + File: foo.R + Call: gettext("Hi there") + Message: Hi there - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s ^---^ ^^ ^^ - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") - Plural message: small fail + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") + Plural message: small fail - How would you translate this message into Mainland Chinese independently of n? + How would you translate this message into Mainland Chinese independently of n? Message Writing R-zh_CN.po Recompiling 'zh_CN' R translation @@ -146,17 +146,17 @@ * Whenever templates or escaping is happening in a string, these will be 'highlighted' by carets (^) in the line below Output - File: foo.R - Call: stop("I really wish you'd reconsider") - Message: I really wish you'd reconsider + File: foo.R + Call: stop("I really wish you'd reconsider") + Message: I really wish you'd reconsider - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: foo.R - Call: ngettext(length(x), "SOMEWHAT EPIC FAIL", "MAJORLY EPIC FAIL") - Plural message: SOMEWHAT EPIC FAIL + File: foo.R + Call: ngettext(length(x), "SOMEWHAT EPIC FAIL", "MAJORLY EPIC FAIL") + Plural message: SOMEWHAT EPIC FAIL - How would you translate this message into Mainland Chinese independently of n? + How would you translate this message into Mainland Chinese independently of n? Message Writing R-zh_CN.po Recompiling 'zh_CN' R translation @@ -172,28 +172,28 @@ Output Problematic call: - base::cat("I warned you!", fill=TRUE, append=TRUE) - < File:foo.R, Line:2 > + base::cat("I warned you!", fill=TRUE, append=TRUE) + < File:foo.R, Line:2 > Potential replacement: - cat(gettext("I warned you!"), fill=TRUE) + cat(gettext("I warned you!"), fill=TRUE) Problematic call: - cat("Oh no", "you\ndon't!") - < File:foo.R, Line:8 > + cat("Oh no", "you\ndon't!") + < File:foo.R, Line:8 > Potential replacement: - cat(gettext("Oh no you\ndon't!")) + cat(gettext("Oh no you\ndon't!")) Problematic call: - cat("Hi", "boss", sep="xx") - < File:foo.R, Line:15 > + cat("Hi", "boss", sep="xx") + < File:foo.R, Line:15 > Potential replacement: - cat(gettext("Hixxboss")) + cat(gettext("Hixxboss")) Problematic call: - cat("This costs", x, "dollars") - < File:foo.R, Line:22 > + cat("This costs", x, "dollars") + < File:foo.R, Line:22 > Potential replacement: - cat(gettextf("This costs %s dollars", x)) + cat(gettextf("This costs %s dollars", x)) Exit now to repair any of these? [y/N] --- @@ -230,107 +230,107 @@ Thanks! Who should be credited with these translations? And what is their email? - File: foo.R - Call: base::warning("I warned you!") - Message: I warned you! + File: foo.R + Call: base::warning("I warned you!") + Message: I warned you! - How would you translate this message into Welsh? + How would you translate this message into Welsh? - File: foo.R - Call: stop("Oh no you don't!") - Message: Oh no you don't! + File: foo.R + Call: stop("Oh no you don't!") + Message: Oh no you don't! - How would you translate this message into Welsh? + How would you translate this message into Welsh? - File: foo.R - Call: gettext("Hi there") - Message: Hi there + File: foo.R + Call: gettext("Hi there") + Message: Hi there - How would you translate this message into Welsh? + How would you translate this message into Welsh? - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s ^---^ ^^ ^^ - How would you translate this message into Welsh? + How would you translate this message into Welsh? ** Oops! Invalid translation -- received the same set of templates + bordering newlines, but in incorrect order ([%.02f, %d, %s] vs [%.02f, %s, %d]). Recall that you can use %$N to do redirect, e.g. to swap the order of '%d %s' to be translated more naturally, your translation can use '%1$s %2$d'. Retrying. ** - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s ^---^ ^^ ^^ - How would you translate this message into Welsh? + How would you translate this message into Welsh? ** Oops! Invalid translation -- received templates + bordering newlines not present in the original: %s. Retrying. ** - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s ^---^ ^^ ^^ - How would you translate this message into Welsh? + How would you translate this message into Welsh? ** Oops! Invalid translation -- received the same set of templates + bordering newlines, but in incorrect order ([%.02f, %d, %s] vs [%1$.02f, %2$s, %3$d]). Recall that you can use %$N to do redirect, e.g. to swap the order of '%d %s' to be translated more naturally, your translation can use '%1$s %2$d'. Retrying. ** - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s ^---^ ^^ ^^ - How would you translate this message into Welsh? + How would you translate this message into Welsh? ** Oops! Invalid translation -- received 2 unique templated arguments + bordering newlines but there are 3 in the original. Retrying. ** - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s ^---^ ^^ ^^ - How would you translate this message into Welsh? + How would you translate this message into Welsh? ** Oops! Invalid translation -- received 4 unique templated arguments + bordering newlines but there are 3 in the original. Retrying. ** - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s ^---^ ^^ ^^ - How would you translate this message into Welsh? + How would you translate this message into Welsh? ** Oops! Invalid translation -- received 5 unique templated arguments + bordering newlines but there are 3 in the original. Retrying. ** - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s ^---^ ^^ ^^ - How would you translate this message into Welsh? + How would you translate this message into Welsh? - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") - Plural message: small fail + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") + Plural message: small fail - How would you translate this message into Welsh for n where 'plural' resolves to 0? + How would you translate this message into Welsh for n where 'plural' resolves to 0? - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") - Plural message: small fail + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") + Plural message: small fail - How would you translate this message into Welsh for n where 'plural' resolves to 1? + How would you translate this message into Welsh for n where 'plural' resolves to 1? - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") - Plural message: small fail + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") + Plural message: small fail - How would you translate this message into Welsh for n where 'plural' resolves to 2? + How would you translate this message into Welsh for n where 'plural' resolves to 2? - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") - Plural message: small fail + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") + Plural message: small fail - How would you translate this message into Welsh for n where 'plural' resolves to 3? + How would you translate this message into Welsh for n where 'plural' resolves to 3? Message Writing R-cy.po @@ -354,41 +354,41 @@ Thanks! Who should be credited with these translations? And what is their email? - File: foo.R - Call: base::warning("I warned you!") - Message: I warned you! + File: foo.R + Call: base::warning("I warned you!") + Message: I warned you! - How would you translate this message into Catalan? + How would you translate this message into Catalan? - File: foo.R - Call: stop("Oh no you don't!") - Message: Oh no you don't! + File: foo.R + Call: stop("Oh no you don't!") + Message: Oh no you don't! - How would you translate this message into Catalan? + How would you translate this message into Catalan? - File: foo.R - Call: gettext("Hi there") - Message: Hi there + File: foo.R + Call: gettext("Hi there") + Message: Hi there - How would you translate this message into Catalan? + How would you translate this message into Catalan? - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s ^---^ ^^ ^^ - How would you translate this message into Catalan? + How would you translate this message into Catalan? - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") - Plural message: small fail + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") + Plural message: small fail - How would you translate this message into Catalan when n = 1? + How would you translate this message into Catalan when n = 1? - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") - Plural message: small fail + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail", msg2 = "big fail") + Plural message: small fail - How would you translate this message into Catalan when n is not 1? + How would you translate this message into Catalan when n is not 1? Message Writing R-ca.po @@ -403,29 +403,29 @@ Thanks! Who should be credited with these translations? And what is their email? - File: foo.R - Call: base::warning("I warned you!") - Message: I warned you! + File: foo.R + Call: base::warning("I warned you!") + Message: I warned you! - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: foo.R - Call: stop("Oh no you don't!") - Message: Oh no you don't! + File: foo.R + Call: stop("Oh no you don't!") + Message: Oh no you don't! - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: foo.R - Call: gettext("Hi there") - Message: Hi there + File: foo.R + Call: gettext("Hi there") + Message: Hi there - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s ^---^ ^^ ^^ - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? Error Invalid templated message. If any %N$ redirects are used, all templates must be redirected. Redirected tempates: %1$d @@ -444,29 +444,29 @@ Thanks! Who should be credited with these translations? And what is their email? - File: foo.R - Call: base::warning("I warned you!") - Message: I warned you! + File: foo.R + Call: base::warning("I warned you!") + Message: I warned you! - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: foo.R - Call: stop("Oh no you don't!") - Message: Oh no you don't! + File: foo.R + Call: stop("Oh no you don't!") + Message: Oh no you don't! - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: foo.R - Call: gettext("Hi there") - Message: Hi there + File: foo.R + Call: gettext("Hi there") + Message: Hi there - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: foo.R - Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) - Message: Avg cat() failures: %.02f; N failures: %d; failure: %s + File: foo.R + Call: gettextf( fmt = "Avg cat() failures: %.02f; N failures: %d; failure: %s", mean(x), length(x), "don't translate me" ) + Message: Avg cat() failures: %.02f; N failures: %d; failure: %s ^---^ ^^ ^^ - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? Error Invalid templated message string with redirects -- all messages pointing to the same input must have identical formats, but received [%1$s, %1$d] Message @@ -483,48 +483,48 @@ Thanks! Who should be credited with these translations? And what is their email? - File: foo.R - Call: message("a string") - Message: a string + File: foo.R + Call: message("a string") + Message: a string - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: bar.c - Call: N_("Don't translate me now.") - Message: Don't translate me now. + File: bar.c + Call: N_("Don't translate me now.") + Message: Don't translate me now. - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: bar.c - Call: Rprintf(_("an translated templated string: %" "" "\n"), 10000LL) - Message: an translated templated string: %\n + File: bar.c + Call: Rprintf(_("an translated templated string: %" "" "\n"), 10000LL) + Message: an translated templated string: %\n ^-------^^^ - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: bar.c - Call: warning(_("a translated "\ - "warning: %s\n"), stardust(z)) - Message: a translated warning: %s\n + File: bar.c + Call: warning(_("a translated "\ + "warning: %s\n"), stardust(z)) + Message: a translated warning: %s\n ^^^^ - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: bar.c - Call: snprintf(BUF, 100, _("a simple message")) - Message: a simple message + File: bar.c + Call: snprintf(BUF, 100, _("a simple message")) + Message: a simple message - How would you translate this message into Mainland Chinese? + How would you translate this message into Mainland Chinese? - File: bar.c - Call: ngettext("singular", "plural", z) - Plural message: singular + File: bar.c + Call: ngettext("singular", "plural", z) + Plural message: singular - How would you translate this message into Mainland Chinese independently of n? + How would you translate this message into Mainland Chinese independently of n? - File: bar.c - Call: ngettext("singular %d", "plural %d", z) - Plural message: singular %d + File: bar.c + Call: ngettext("singular %d", "plural %d", z) + Plural message: singular %d ^^ - How would you translate this message into Mainland Chinese independently of n? + How would you translate this message into Mainland Chinese independently of n? Message Writing R-zh_CN.po @@ -564,342 +564,342 @@ Thanks! Who should be credited with these translations? And what is their email? - File: copy1.R - Call: stop("copy one") - Message: copy one + File: copy1.R + Call: stop("copy one") + Message: copy one - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: copy2.R - Call: stop("copy two") - Message: copy two + File: copy2.R + Call: stop("copy two") + Message: copy two - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: base::warning(" I warned you!\n\n") - Message: I warned you! + File: foo.R + Call: base::warning(" I warned you!\n\n") + Message: I warned you! - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message(r"('abc')") - Message: 'abc' + File: foo.R + Call: message(r"('abc')") + Message: 'abc' - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message(R'("def")') - Message: "def" + File: foo.R + Call: message(R'("def")') + Message: "def" - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message("R('abc')") - Message: R('abc') + File: foo.R + Call: message("R('abc')") + Message: R('abc') - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message('r("def")') - Message: r("def") + File: foo.R + Call: message('r("def")') + Message: r("def") - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message(R'---[ghi]---') - Message: ghi + File: foo.R + Call: message(R'---[ghi]---') + Message: ghi - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: gettext("Hi there") - Message: Hi there + File: foo.R + Call: gettext("Hi there") + Message: Hi there - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: gettextf(fmt = "good %s ", "grief") - Message: good %s + File: foo.R + Call: gettextf(fmt = "good %s ", "grief") + Message: good %s ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: "first" + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: "first" - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: second + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: second - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: third + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: third - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: fourth + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: fourth - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: fifth + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: fifth - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: sixth + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: sixth - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message("\\n vs \n is OK") - Message: \\n vs \n is OK + File: foo.R + Call: message("\\n vs \n is OK") + Message: \\n vs \n is OK - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message("\\t vs \t is OK") - Message: \\t vs \t is OK + File: foo.R + Call: message("\\t vs \t is OK") + Message: \\t vs \t is OK - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message('strings with "quotes" are OK') - Message: strings with "quotes" are OK + File: foo.R + Call: message('strings with "quotes" are OK') + Message: strings with "quotes" are OK - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message("strings with escaped \"quotes\" are OK") - Message: strings with escaped "quotes" are OK + File: foo.R + Call: message("strings with escaped \"quotes\" are OK") + Message: strings with escaped "quotes" are OK - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: gettextf( paste("part 1 %s", "part 2"), "input" ) - Message: part 1 %s + File: foo.R + Call: gettextf( paste("part 1 %s", "part 2"), "input" ) + Message: part 1 %s ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: gettextf( paste("part 1 %s", "part 2"), "input" ) - Message: part 2 + File: foo.R + Call: gettextf( paste("part 1 %s", "part 2"), "input" ) + Message: part 2 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: ngettext( 10, "singular ", "plural " ) - Plural message: singular  + File: foo.R + Call: ngettext( 10, "singular ", "plural " ) + Plural message: singular - How would you translate this message into Spanish when n = 1? + How would you translate this message into Spanish when n = 1? - File: foo.R - Call: ngettext( 10, "singular ", "plural " ) - Plural message: singular  + File: foo.R + Call: ngettext( 10, "singular ", "plural " ) + Plural message: singular - How would you translate this message into Spanish when n is not 1? + How would you translate this message into Spanish when n is not 1? - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail ", msg2 = "big fail ") - Plural message: small fail  + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail ", msg2 = "big fail ") + Plural message: small fail - How would you translate this message into Spanish when n = 1? + How would you translate this message into Spanish when n = 1? - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail ", msg2 = "big fail ") - Plural message: small fail  + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail ", msg2 = "big fail ") + Plural message: small fail - How would you translate this message into Spanish when n is not 1? + How would you translate this message into Spanish when n is not 1? - File: ABCDEFGHIJKLMNOPQRSTUVWXYZ.c - Call: _("an translated templated string: %" "" "\n") - Message: an translated templated string: %\n + File: ABCDEFGHIJKLMNOPQRSTUVWXYZ.c + Call: _("an translated templated string: %" "" "\n") + Message: an translated templated string: %\n ^-------^^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: MSGs.c - Call: _("any old \ - message") - Message: any old message + File: MSGs.c + Call: _("any old \ + message") + Message: any old message - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: _("a message in a macro %s") - Message: a message in a macro %s + File: msg.c + Call: _("a message in a macro %s") + Message: a message in a macro %s ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: Rprintf(_("that's a mighty big %" """-sized wall over %"""), 100LL, 10L) - Message: that's a mighty big %-sized wall over % + File: msg.c + Call: Rprintf(_("that's a mighty big %" """-sized wall over %"""), 100LL, 10L) + Message: that's a mighty big %-sized wall over % ^-------^ ^-------^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: Rprintf(_("/* this is what a C comment looks like */ ")) - Message: /* this is what a C comment looks like */  + File: msg.c + Call: Rprintf(_("/* this is what a C comment looks like */ ")) + Message: /* this is what a C comment looks like */ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: Rprintf(_("// this is what a C comment looks like %s "), "abc") - Message: // this is what a C comment looks like %s  + File: msg.c + Call: Rprintf(_("// this is what a C comment looks like %s "), "abc") + Message: // this is what a C comment looks like %s ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: Rprintf(_( + File: msg.c + Call: Rprintf(_( "01234567890123456789.01234567890123456789" "01234567890123456789.01234567890123456789" "01234567890123456789.01234567890123456789" "01234567890123456789.01234567890123456789" - )) - Message: 01234567890123456789.0123456789012345678901234567890123456789.0123456789012345678901234567890123456789.0123456789012345678901234567890123456789.01234567890123456789 + )) + Message: 01234567890123456789.0123456789012345678901234567890123456789.0123456789012345678901234567890123456789.0123456789012345678901234567890123456789.01234567890123456789 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("This message\nSpans two lines")) - Message: This message\nSpans two lines + File: msg.c + Call: error(_("This message\nSpans two lines")) + Message: This message\nSpans two lines - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("This one does not\n")) - Message: This one does not\n + File: msg.c + Call: error(_("This one does not\n")) + Message: This one does not\n ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("Exotic formatters like %I32u, %llx, %li, %ls, %lc")) - Message: Exotic formatters like %I32u, %llx, %li, %ls, %lc + File: msg.c + Call: error(_("Exotic formatters like %I32u, %llx, %li, %ls, %lc")) + Message: Exotic formatters like %I32u, %llx, %li, %ls, %lc ^---^ ^--^ ^-^ ^-^ ^-^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456\"890")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456"890 + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456\"890")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456"890 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345(\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345("890 + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345(\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345("890 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345'\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345'"890 + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345'\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345'"890 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345a\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345a"890 + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345a\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345a"890 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345A\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345A"890 + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345A\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345A"890 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345#\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345#"890 + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345#\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345#"890 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345@\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345@"890 + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345@\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345@"890 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 .%s.")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 .%s. + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 .%s.")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 .%s. ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 ?%s?")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 ?%s? + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 ?%s?")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 ?%s? ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 ;%s;")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 ;%s; + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 ;%s;")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 ;%s; ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 /%s/")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 /%s/ + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 /%s/")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 /%s/ ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 '%s'")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 '%s' + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 '%s'")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 '%s' ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 [%s]")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 [%s] + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 [%s]")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 [%s] ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 |%s|")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 |%s| + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 |%s|")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 |%s| ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 -%s-")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 -%s- + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 -%s-")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 -%s- ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_(test ? "abc" : "def")) - Message: abc + File: msg.c + Call: error(_(test ? "abc" : "def")) + Message: abc - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_(xxx "abc" "def")) - Message: abcdef + File: msg.c + Call: error(_(xxx "abc" "def")) + Message: abcdef - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: z.c - Call: error(_("You found me!")) - Message: You found me! + File: z.c + Call: error(_("You found me!")) + Message: You found me! - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: cairo/bedfellows.c - Call: _( - "any new message") - Message: any new message + File: cairo/bedfellows.c + Call: _( + "any new message") + Message: any new message - How would you translate this message into Spanish? + How would you translate this message into Spanish? Message Writing R-es.po @@ -914,342 +914,342 @@ Thanks! Who should be credited with these translations? And what is their email? - File: copy1.R - Call: stop("copy one") - Message: copy one + File: copy1.R + Call: stop("copy one") + Message: copy one - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: copy2.R - Call: stop("copy two") - Message: copy two + File: copy2.R + Call: stop("copy two") + Message: copy two - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: base::warning(" I warned you!\n\n") - Message: I warned you! + File: foo.R + Call: base::warning(" I warned you!\n\n") + Message: I warned you! - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message(r"('abc')") - Message: 'abc' + File: foo.R + Call: message(r"('abc')") + Message: 'abc' - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message(R'("def")') - Message: "def" + File: foo.R + Call: message(R'("def")') + Message: "def" - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message("R('abc')") - Message: R('abc') + File: foo.R + Call: message("R('abc')") + Message: R('abc') - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message('r("def")') - Message: r("def") + File: foo.R + Call: message('r("def")') + Message: r("def") - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message(R'---[ghi]---') - Message: ghi + File: foo.R + Call: message(R'---[ghi]---') + Message: ghi - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: gettext("Hi there") - Message: Hi there + File: foo.R + Call: gettext("Hi there") + Message: Hi there - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: gettextf(fmt = "good %s ", "grief") - Message: good %s + File: foo.R + Call: gettextf(fmt = "good %s ", "grief") + Message: good %s ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: "first" + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: "first" - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: second + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: second - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: third + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: third - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: fourth + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: fourth - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: fifth + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: fifth - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) - Message: sixth + File: foo.R + Call: warning( '"first"', "second", "third", "fourth", "fifth", "sixth" ) + Message: sixth - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message("\\n vs \n is OK") - Message: \\n vs \n is OK + File: foo.R + Call: message("\\n vs \n is OK") + Message: \\n vs \n is OK - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message("\\t vs \t is OK") - Message: \\t vs \t is OK + File: foo.R + Call: message("\\t vs \t is OK") + Message: \\t vs \t is OK - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message('strings with "quotes" are OK') - Message: strings with "quotes" are OK + File: foo.R + Call: message('strings with "quotes" are OK') + Message: strings with "quotes" are OK - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: message("strings with escaped \"quotes\" are OK") - Message: strings with escaped "quotes" are OK + File: foo.R + Call: message("strings with escaped \"quotes\" are OK") + Message: strings with escaped "quotes" are OK - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: gettextf( paste("part 1 %s", "part 2"), "input" ) - Message: part 1 %s + File: foo.R + Call: gettextf( paste("part 1 %s", "part 2"), "input" ) + Message: part 1 %s ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: gettextf( paste("part 1 %s", "part 2"), "input" ) - Message: part 2 + File: foo.R + Call: gettextf( paste("part 1 %s", "part 2"), "input" ) + Message: part 2 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: foo.R - Call: ngettext( 10, "singular ", "plural " ) - Plural message: singular  + File: foo.R + Call: ngettext( 10, "singular ", "plural " ) + Plural message: singular - How would you translate this message into Spanish when n = 1? + How would you translate this message into Spanish when n = 1? - File: foo.R - Call: ngettext( 10, "singular ", "plural " ) - Plural message: singular  + File: foo.R + Call: ngettext( 10, "singular ", "plural " ) + Plural message: singular - How would you translate this message into Spanish when n is not 1? + How would you translate this message into Spanish when n is not 1? - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail ", msg2 = "big fail ") - Plural message: small fail  + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail ", msg2 = "big fail ") + Plural message: small fail - How would you translate this message into Spanish when n = 1? + How would you translate this message into Spanish when n = 1? - File: windows/bar.R - Call: ngettext(length(x), msg1 = "small fail ", msg2 = "big fail ") - Plural message: small fail  + File: windows/bar.R + Call: ngettext(length(x), msg1 = "small fail ", msg2 = "big fail ") + Plural message: small fail - How would you translate this message into Spanish when n is not 1? + How would you translate this message into Spanish when n is not 1? - File: ABCDEFGHIJKLMNOPQRSTUVWXYZ.c - Call: _("an translated templated string: %" "" "\n") - Message: an translated templated string: %\n + File: ABCDEFGHIJKLMNOPQRSTUVWXYZ.c + Call: _("an translated templated string: %" "" "\n") + Message: an translated templated string: %\n ^-------^^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: MSGs.c - Call: _("any old \ - message") - Message: any old message + File: MSGs.c + Call: _("any old \ + message") + Message: any old message - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: _("a message in a macro %s") - Message: a message in a macro %s + File: msg.c + Call: _("a message in a macro %s") + Message: a message in a macro %s ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: Rprintf(_("that's a mighty big %" """-sized wall over %"""), 100LL, 10L) - Message: that's a mighty big %-sized wall over % + File: msg.c + Call: Rprintf(_("that's a mighty big %" """-sized wall over %"""), 100LL, 10L) + Message: that's a mighty big %-sized wall over % ^-------^ ^-------^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: Rprintf(_("/* this is what a C comment looks like */ ")) - Message: /* this is what a C comment looks like */  + File: msg.c + Call: Rprintf(_("/* this is what a C comment looks like */ ")) + Message: /* this is what a C comment looks like */ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: Rprintf(_("// this is what a C comment looks like %s "), "abc") - Message: // this is what a C comment looks like %s  + File: msg.c + Call: Rprintf(_("// this is what a C comment looks like %s "), "abc") + Message: // this is what a C comment looks like %s ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: Rprintf(_( + File: msg.c + Call: Rprintf(_( "01234567890123456789.01234567890123456789" "01234567890123456789.01234567890123456789" "01234567890123456789.01234567890123456789" "01234567890123456789.01234567890123456789" - )) - Message: 01234567890123456789.0123456789012345678901234567890123456789.0123456789012345678901234567890123456789.0123456789012345678901234567890123456789.01234567890123456789 + )) + Message: 01234567890123456789.0123456789012345678901234567890123456789.0123456789012345678901234567890123456789.0123456789012345678901234567890123456789.01234567890123456789 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("This message\nSpans two lines")) - Message: This message\nSpans two lines + File: msg.c + Call: error(_("This message\nSpans two lines")) + Message: This message\nSpans two lines - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("This one does not\n")) - Message: This one does not\n + File: msg.c + Call: error(_("This one does not\n")) + Message: This one does not\n ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("Exotic formatters like %I32u, %llx, %li, %ls, %lc")) - Message: Exotic formatters like %I32u, %llx, %li, %ls, %lc + File: msg.c + Call: error(_("Exotic formatters like %I32u, %llx, %li, %ls, %lc")) + Message: Exotic formatters like %I32u, %llx, %li, %ls, %lc ^---^ ^--^ ^-^ ^-^ ^-^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456\"890")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456"890 + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456\"890")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456"890 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345(\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345("890 + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345(\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345("890 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345'\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345'"890 + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345'\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345'"890 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345a\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345a"890 + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345a\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345a"890 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345A\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345A"890 + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345A\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345A"890 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345#\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345#"890 + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345#\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345#"890 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345@\"890")) - Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345@"890 + File: msg.c + Call: error(_("0123456789012345678901234567890123456789012345678901234567890123456789012345@\"890")) + Message: 0123456789012345678901234567890123456789012345678901234567890123456789012345@"890 - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 .%s.")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 .%s. + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 .%s.")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 .%s. ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 ?%s?")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 ?%s? + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 ?%s?")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 ?%s? ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 ;%s;")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 ;%s; + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 ;%s;")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 ;%s; ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 /%s/")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 /%s/ + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 /%s/")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 /%s/ ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 '%s'")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 '%s' + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 '%s'")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 '%s' ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 [%s]")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 [%s] + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 [%s]")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 [%s] ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 |%s|")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 |%s| + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 |%s|")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 |%s| ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 -%s-")) - Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 -%s- + File: msg.c + Call: error(_("01234567890123456789012345678901234567890123456789012345678901234567890123456 -%s-")) + Message: 01234567890123456789012345678901234567890123456789012345678901234567890123456 -%s- ^^ - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_(test ? "abc" : "def")) - Message: abc + File: msg.c + Call: error(_(test ? "abc" : "def")) + Message: abc - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: msg.c - Call: error(_(xxx "abc" "def")) - Message: abcdef + File: msg.c + Call: error(_(xxx "abc" "def")) + Message: abcdef - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: z.c - Call: error(_("You found me!")) - Message: You found me! + File: z.c + Call: error(_("You found me!")) + Message: You found me! - How would you translate this message into Spanish? + How would you translate this message into Spanish? - File: cairo/bedfellows.c - Call: _( - "any new message") - Message: any new message + File: cairo/bedfellows.c + Call: _( + "any new message") + Message: any new message - How would you translate this message into Spanish? + How would you translate this message into Spanish? Message Writing R-es.po @@ -1264,11 +1264,11 @@ Thanks! Who should be credited with these translations? And what is their email? - File: foo.R - Call: base::warning("I warned you!") - Message: I warned you! + File: foo.R + Call: base::warning("I warned you!") + Message: I warned you! - How would you translate this message into Spanish? + How would you translate this message into Spanish? Message Writing R-es.po From b0d7b55806ba4006281a0b81e34bc54f49061db1 Mon Sep 17 00:00:00 2001 From: Hadley Wickham Date: Tue, 4 Jan 2022 21:35:39 -0600 Subject: [PATCH 21/22] Use dev testthat Just ignoring the spurious changes for now --- DESCRIPTION | 1 + tests/testthat/_snaps/translate-package.md | 19 ------------------- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index afec466c..9423185b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -26,6 +26,7 @@ Suggests: VignetteBuilder: knitr Config/testthat/edition: 3 +Remotes: r-lib/testthat Encoding: UTF-8 Roxygen: list(markdown = TRUE) RoxygenNote: 7.1.2 diff --git a/tests/testthat/_snaps/translate-package.md b/tests/testthat/_snaps/translate-package.md index b4102057..3418d922 100644 --- a/tests/testthat/_snaps/translate-package.md +++ b/tests/testthat/_snaps/translate-package.md @@ -29,8 +29,6 @@ Getting R-level messages. Running message diagnostics. Writing R-rMsg.pot - - No languages provided; finishing --- @@ -42,8 +40,6 @@ Getting R-level messages. Running message diagnostics. Writing R-rMsg.pot - - Beginning new translations for zh_CN (Mainland Chinese/普通话); found 6 untranslated messages (To quit translating, press 'Esc'; progress will be saved) Output @@ -106,8 +102,6 @@ Getting R-level messages. Running message diagnostics. Writing R-rMsg.pot - - Found existing R translations for fa (Farsi/فارسی) in ./po/R-fa.po. Running msgmerge. . done. Translations for fa are up to date! Skipping. @@ -124,8 +118,6 @@ Getting R-level messages. Running message diagnostics. Writing R-rFuzzyMsg.pot - - Found existing R translations for zh_CN (Mainland Chinese/普通话) in ./po/R-zh_CN.po. Running msgmerge. . done. Beginning new translations for zh_CN (Mainland Chinese/普通话); found 2 untranslated messages @@ -202,7 +194,6 @@ translate_package(languages = "cy") Message Writing R-rMsg.pot - 'cy' is not a known language. Please help supply some metadata about it. You can check https://l10n.gnome.org/teams/ Output @@ -340,7 +331,6 @@ translate_package(languages = "ca", diagnostics = NULL) Message Writing R-rMsg.pot - 'ca' is not a known language. Please help supply some metadata about it. You can check https://l10n.gnome.org/teams/ Output @@ -398,7 +388,6 @@ translate_package(languages = "zh_CN", diagnostics = NULL) Message Writing R-rMsg.pot - Output Thanks! Who should be credited with these translations? And what is their email? @@ -439,7 +428,6 @@ translate_package(languages = "zh_CN", diagnostics = NULL) Message Writing R-rMsg.pot - Output Thanks! Who should be credited with these translations? And what is their email? @@ -478,7 +466,6 @@ translate_package(languages = "zh_CN", diagnostics = check_untranslated_src) Message Writing R-rSrcMsg.pot - Output Thanks! Who should be credited with these translations? And what is their email? @@ -538,9 +525,6 @@ Getting src-level messages. Running message diagnostics. Writing R-rSrcFuzzyMsg.pot - - - Found existing R translations for zh_CN (Mainland Chinese/普通话) in ./po/R-zh_CN.po. Running msgmerge. . done. Found existing src translations for zh_CN (Mainland Chinese/普通话) in ./po/zh_CN.po. Running msgmerge. @@ -559,7 +543,6 @@ translate_package(languages = "es", copyright = "Mata Hari", diagnostics = NULL) Message Writing R-rMsgUnusual.pot - Output Thanks! Who should be credited with these translations? And what is their email? @@ -909,7 +892,6 @@ translate_package(languages = "es", use_base_rules = TRUE, diagnostics = NULL) Message Writing R-rMsgUnusual.pot - Output Thanks! Who should be credited with these translations? And what is their email? @@ -1259,7 +1241,6 @@ translate_package(languages = "es", max_translations = 1L, diagnostics = NULL) Message Writing R-rMsg.pot - Output Thanks! Who should be credited with these translations? And what is their email? From b144942e85f4aca170ad41b2d80208e5ec6f89f2 Mon Sep 17 00:00:00 2001 From: Hadley Wickham Date: Tue, 4 Jan 2022 21:36:17 -0600 Subject: [PATCH 22/22] Focus workflow --- .github/workflows/R-CMD-check.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 138a250c..38648c6e 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -21,11 +21,11 @@ jobs: fail-fast: false matrix: config: - - {os: macOS-latest, r: 'release'} + # - {os: macOS-latest, r: 'release'} - {os: windows-latest, r: 'release'} - - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} + # - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} - {os: ubuntu-latest, r: 'release'} - - {os: ubuntu-latest, r: 'oldrel-1'} + # - {os: ubuntu-latest, r: 'oldrel-1'} env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}