checkPoFile
checks one file, while checkPoFiles
checks all files for a specified
language.checkPoFile(f, strictPlural = FALSE)
checkPoFiles(language, dir = ".")
"check_po_files"
. A
print
method is defined for this class to display a report on
the differences.sprintf
and related functions. In these cases, the
translation must give a compatible format or an error will be
generated when the message is displayed. The rules for compatibility differ between C and Rin several ways. C
supports several conversions not supported by R, namely c
,
u
, p
, n
. It is allowed in C's sprintf()
function to have more arguments than are needed by the format string,
but in Rthe counts must match exactly. Rrequires types of
arguments to match, whereas C will do the display whether it makes
sense or not.
These functions compromise on the testing as follows. The additional formats allowed in C are accepted, and all differences in argument type or count are reported. As a consequence some reported differences are not errors.
If the strictPlural
argument is TRUE
, then argument
lists must agree exactly between singular and plural forms of messages; if
FALSE
, then translations only need to match one or the other
of the two forms. When checkPoFiles
calls checkPoFile
,
the strictPlural
argument is set to TRUE
for files with
names starting FALSE
otherwise.
Items marked as
If a difference is found, the translated string is checked for variant
percent signs (e.g., the wide percent sign "\uFF05"
). Such signs
will not be recognized as format specifiers, and are likely to be
errors.
update_pkg_po()
which calls checkPoFile()
;
xgettext
, sprintf
.checkPoFiles("de", "/path/to/R/src/directory")
Run the code above in your browser using DataCamp Workspace