首页 | Linux | 论坛 | 精华 | 博客 | 资料 | 手册 | 知识库 | 下载 | 人才 | 沙龙 | 搜索 | 登录 | 注册  
下载分类
操作系统
系统相关
网络互连
开发工具
应用程序
多媒体工具
游戏娱乐
资料视频
本类周下载TOP10
本类总下载TOP10
您的位置:自由软件库->应用程序->文本处理->gettext

首字母搜索 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z


软件名称: gettext
授权方式: GPL
操作系统: Linux,FreeBSD,UNIX,i386,x86_64
软件大小: 17408b
最新更新: 2012-01-17 10:44:53
软件简介:

gettext 是GNU国际化与本地化(i18n)函数库。它常被用于编写多语言程序。

程序源代码需要进行修改以响应 GNU gettext 请求。多数编程语言均已通过字符封装的方式实现了对其的支持。为了减少输入量和代码量,此功能通常以标记别名 _ 的形式使用,所以例如以下C语言代码:

printf(gettext("My name is %s. "), my_name);
应当写作:

printf(_("My name is %s. "), my_name);
gettext使用其中的字符串寻找对应的其他语言翻译,若没有可用翻译则返回原始内容。

除C语言外, GNU gettext 还支持 C++, Objective-C,Pascal/Object Pascal,sh 脚本,bash 脚本,Python,GNU CLISP,Emacs Lisp,librep,GNU Smalltalk,Java,GNU awk,wxWidgets(通过 wxLocale类),YCP (YaST2语言),Tcl,Perl,PHP,Pike,Ruby以及R。用法均与在C语言上类似。

xgettext程序从源代码生成 .pot 文件,作为源代码中需翻译内容的模板。一个典型的 .pot 文件条目应当是这样的:

 #: src/name.c:36
 msgid "My name is %s. "
 msgstr ""
注释被直接放置在字符串前,用于帮助翻译者理解待翻译内容:

 /// TRANSLATORS: Please leave %s as it is, because it is needed by the program.
 /// Thank you for contributing to this project.
 printf(_("My name is %s. "), my_name);
本例中的注释是以 /// 开头的,其作用是用于 xgettext 程序生成 .pot 模板文件。

xgettext --add-comments=///

在 .pot文件中的注释应为以下形式:

 #. TRANSLATORS: Please leave %s as it is, because it is needed by the program.
 #. Thank you for contributing to this project.
 #: src/name.c:36
 msgid "My name is %s. "
 msgstr ""

Usually, programs are written and documented in English, and use English at execution time for interacting with users. This is true not only from within GNU, but also in a great deal of proprietary and free software. Using a common language is quite handy for communication between developers, maintainers and users from all countries. On the other hand, most people are less comfortable with English than with their own native language, and would rather be using their mother tongue for day to day s work, as far as possible. Many would simply love seeing their computer screen showing a lot less of English, and far more of their own language.

GNU  gettext  is an important step for the GNU Translation Project, as it is an asset on which we may build many other steps. This package offers to programmers, translators, and even users, a well integrated set of tools and documentation. Specifically, the GNU  gettext  utilities are a set of tools that provides a framework to help other GNU packages produce multi-lingual messages. These tools include a set of conventions about how programs should be written to support message catalogs, a directory and file naming organization for the message catalogs themselves, a runtime library supporting the retrieval of translated messages, and a few stand-alone programs to massage in various ways the sets of translatable strings, or already translated strings. A special GNU Emacs mode also helps interested parties in preparing these sets, or bringing them up to date.

 

相关论坛: 下载频道交流区 讨论区
立即下载

gettext-0.12.1.tar.gz
gettext-0.14.1.tar.gz
gettext-0.14.2.tar.gz
gettext-0.14.4.tar.gz
gettext-0.14.5.tar.gz
gettext-1.0.0.gem
gettext-1.01.tar.gz
gettext-1.03.tar.gz
gettext-1.04.tar.gz
gettext-1.05.tar.gz
gettext-0.14.6.tar.gz
gettext-0.16.1.tar.gz
gettext-1.9.0.gem
gettext-1.10.0.gem
gettext-0.17.tar.gz
gettext-1.90.0.gem
gettext-1.91.0.gem
gettext-1.92.0.gem
gettext-1.93.0.gem
gettext-0.18.1.1.tar.gz
gettext-0.18.1.tar.gz
gettext-0.18.tar.gz
gettext-2.1.0.gem
gettext-2.0.4.gem
gettext_i18n_rails-0.3.2.gem
gettext_i18n_rails-0.3.6.gem

 Linux最新资讯更多>> 
·Evernote推进入华节奏:
·桌面操作系统 4 月最新
·Linux基金会:Linux成B
·中国联通升级HSPA+网络
·联通“随意打”论战:绝
·阿里巴巴集团30亿美元贷
·要以扫黄打非的精神进行
·内核源码,ARM架构上的
·Ubuntu 10.04版本企业云
·企业级Linux三国鼎立 与
·开源图像软件GIMP开发者
·不给Source就捣蛋?谈G
 IT最新资讯更多>> 
·大连外企500强急招java
·(内部推荐)EMC-Princ
·(内部推荐)EMC-greenpl
·页游公司招聘:运维开发
·赶集移动部门招聘前端开
·【北京】知名软件公司招
·有莫有C++ and C# and
·下班路上捡到一张工资表
·猎头代招:北京大型上市
·DSI猎头代招:华为-IP部
·上海诚聘JAVA工程师
·微软和苹果10大失败产品
·Darl McBride离开领导岗
·提升Qt的应用诺基亚即将
 综合:更多>> 
·PHP中strtotime函数使用
·五个常见 PHP数据库问题
·初探PHP单元测试利器:
·PHP开发人员容易忽略的
·逃离伪PHP程序员应该做
·大型Web应用运行时 PHP
·PHP企业级应用缓存技术
·PHP应用提速面面观
·用书签查询网站pr值
·PHP句法规则详解
·阴历-农历-转换类
·PHP定时执行任务的实现
·几种有用的变型 PHP中循
·PHP如何修改Linux或Uni
·PHP中全面阻止SQL注入式
·分享几个非常有用的PHP
·PHP面向对象法则
·优化PHP程序的方法
·orcale queue
·谁可以推荐几本经典的操
关于我们 | 联系方式 | 广告合作 | 诚聘英才 | 网站地图 | 友情链接 | 免费注册

Copyright © 2001-2006 ChinaUnix.net All Rights Reserved

感谢所有关心和支持过ChinaUnix的朋友们

京ICP证041476号