是否有可能使用像 optext 这样的文字来翻译 R 脚本 。 如果是, 如何翻译? 如果没有, 我还有什么其他选择?
In php (or maybe gettext in general), what does gettext do when it sees a variable to dynamic content? I have 2 cases in mind. 1) Let s say I have <?=$user1?> poked John <?=$user2?>. ...
是否有可能使用像 optext 这样的文字来翻译 R 脚本 。 如果是, 如何翻译? 如果没有, 我还有什么其他选择?
You can use base::gettext/ngettext, base::bindtextdomain and tools::xgettext2pot functions.
For example:
myFunction <- function()
{
bindtextdomain("R-myProgram","/my/translation/dir")
gettext("Hello",domain="R-myProgram")
}
然后,假设此函数位于一个路径为“/my/ dir/R/myfile.R” 的文件内,使用: tools::xgettext2poot ("/my/dir"), ,然后使用 msginit、 msgfmt 等创建 mo 文件
/my/ translation/dir/fr/LC_MESAGES/R-myProgram.mo
。 我的功能() 现在应该打印“ Bonjour”, 而不是“ hello”, 如果您的语系是法语 。
还有其他几点:
domain
argument seems to be by default the namespace of the function calling gettext()In php (or maybe gettext in general), what does gettext do when it sees a variable to dynamic content? I have 2 cases in mind. 1) Let s say I have <?=$user1?> poked John <?=$user2?>. ...
Reading the question Why doesn’t C++ STL support atoi(const string& ) like functions?, I encountered a comment which warned that GCC (at least) has a bug that can slow down multi-threaded ...
My company uses an internally developed package to support internationalization/localization. However, it was developed some twenty years ago, and the libraries are restricted to one product line. I m ...
How does Vistalizer manage to override the language limit in Windows Vista Home edition. Which api s does it use to allow installation of Multiple language packages.
I m converting an existing table such as this: CREATE TABLE `example`(`id` int(10) unsigned NOT NULL AUTO_INCREMENT, `column1` char(32) COLLATE latin1_general_ci NOT NULL ...
I am developing a Struts 2 application with support for multiple languages. If one of the domain objects needs to throw an exception, how can it do so in such a way that the error message is no ...
Has anyone gotten the Globalize plugin to work Rails 2.3.2 or later? If so, could you direct me to some useful info?
I received the following query from a customer: I am doing some research into character sets for future versions of our products. Most of the sites we have built use html including a ...