找回密码
 注册
查看: 1411|回复: 0

R语言:xgettext()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-16 18:12:56 | 显示全部楼层 |阅读模式
xgettext(tools)
xgettext()所属R语言包:tools

                                        Extract Translatable Messages from R Files in a Package
                                         R文件中提取封装的可转换消息

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

For each file in the "R" directory (including system-specific subdirectories) of a package, extract the unique arguments passed to stop, warning, message, gettext and gettextf, or to ngettext.
对于每一个R包(包括系统特定的子目录)目录中的文件,提取传递stop的独特论点,warning,message gettext和gettextf,或ngettext的。


用法----------Usage----------


xgettext(dir, verbose = FALSE, asCall = TRUE)

xngettext(dir, verbose = FALSE)

xgettext2pot(dir, potFile)



参数----------Arguments----------

参数:dir
the directory of a source package.
源码包的目录。


参数:verbose
logical: should each file be listed as it is processed?
逻辑:每个文件应该被列为处理?


参数:asCall
logical: if TRUE each argument is returned whole, otherwise the strings within each argument are extracted.
逻辑:如果TRUE整个每一个参数,则返回,否则在每个参数的字符串提取。


参数:potFile
name of po template file to be produced. Defaults to "R-<VAR>pkgname</VAR>.pot" where <VAR>pkgname</VAR> is the basename of "dir".
po模板文件名待产。默认为R-<VAR>pkgname</VAR>.pot<VAR> PKGNAME </ VAR的是“dir的主档名。


Details

详情----------Details----------

Leading and trailing white space (space, tab and linefeed) is removed for calls to gettext, gettextf, stop, warning, and message, as it is by the internal code that passes strings for translation.
前导和尾随空格(空格,制表符和换行符)调用gettext的拆除,gettextf,stop,warning,message,因为它是由内部的代码,通过翻译字符串。

We look to see if these functions were called with domain = NA and if so omit the call if asCall = TRUE: note that the call might contain a call to gettext which would be visible if asCall = FALSE.
我们希望看到,如果这些功能被称为domain = NA如果asCall = TRUE若有省略呼叫:注意该呼叫可能包含一个调用gettext这将是可见的,如果<X >

xgettext2pot calls xgettext and then xngettext, and writes a PO template file for use with the GNU Gettext tools.  This ensures that the strings for simple translation are unique in the file (as GNU Gettext requires), but does not do so for ngettext calls (and the rules are not stated in the Gettext manual).
xgettext2pot要求xgettext然后xngettext,和写入GNU Gettext工具使用的PO模板文件。这确保了简单的翻译字符串文件中是唯一的(GNU Gettext要求),但不这样做ngettext通话(和规则的gettext手册中所述)。

If applied to the base package, this also looks in the ".R" files in "<VAR>R_HOME</VAR>/share/R".
如果应用到base包,这看起来也.R<VAR>R_HOME</VAR>/share/R文件。


值----------Value----------

For xgettext, a list of objects of class "xgettext" (which has a print method), one per source file that potentially contains translatable strings.
xgettext,一类对象的名单"xgettext"(其中有print方法),每一个源文件可能包含翻译字符串。

For xngettext, a list of objects of class "xngettext", which are themselves lists of length-2 character strings.
xngettext类"xngettext",对象名单本身长度为2个字符的字符串列表。


举例----------Examples----------


xgettext(file.path(R.home(), "src", "library", "splines"))


转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-1-23 09:08 , Processed in 0.052693 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表