https://techbase.kde.org/api.php?action=feedcontributions&user=Yinfan.ustc&feedformat=atom
KDE TechBase - User contributions [en]
2024-03-29T07:20:25Z
User contributions
MediaWiki 1.40.2
https://techbase.kde.org/index.php?title=Archive:Policies_(zh_CN)&diff=52365
Archive:Policies (zh CN)
2010-07-03T03:59:23Z
<p>Yinfan.ustc: Created page with 'KDE开发者固守着一些成文或不成文的规则。下面的文档就总结了这些规则,但这并不是完全的。如果您想参与构建这些规则,或者参与...'</p>
<hr />
<div>KDE开发者固守着一些成文或不成文的规则。下面的文档就总结了这些规则,但这并不是完全的。如果您想参与构建这些规则,或者参与讨论他们,请使用kde-policies邮件组。该邮件组就是为了这个目的而创建的。<br />
== 开发者准则 ==<br />
<br />
下列准则适用于所有的KDE开发者,并且,希望所有拥有KDE SVN帐号的人都能遵守这些准则。SVN 的commit 准则是最为重要的。开发库函数(主要是kdelibs,当然SVN的核心库函数的开发当属此列)的人应该阅读库函数文档准则(还有apidox howto文档). <br />
<br />
;[[/SVN Commit Policy|SVN Commit Policy]]<br />
:保证KDE SVN能正常工作。有三条黄金定律(确保能编译,遵从既有代码风格,使用描述性的日志消息),以及其他18条规则。他们使得您的SVN贡献能够最好的发挥作用。<br />
<br />
;[[/SVN Guidelines|Application Life Cycle]]<br />
:了解KDE程序的生命周期。了解如何上载程序,如何获得者主要KDE模块,以及在放弃维护您的程序需该做些什么。<br />
<br />
;[[/Licensing Policy|Licensing Policy]]<br />
:KDE SVN中的文件不能随意的授权。这条准则规定了在软件仓库中什么是可以做的。简而言之: 对库函数使用LGPL协议,对其他东西使用GPL或BSD协议。 <br />
<br />
;[[/Library Documentation Policy|Library Documentation Policy]]<br />
:(重)使用库需要做文档说明。这条准则解释了为什么以及如何做文档,以及需要遵从的风格。[[Development/Tutorials/API Documentation|apidox howto]] 含有更多为库函数写文档的技术信息。<br />
<br />
;[[/Library Code Policy|Library Code Policy]]<br />
:KDE库的API及代码需要遵从此准则所给出的公约。<br />
<br />
;[[/Kdelibs Coding Style|Kdelibs Coding Style]]<br />
:这份文档描述了kdelibs的推荐代码风格。这种风格并不是硬性要求的,但要保证代码格式的一致性,还是推荐这种风格。<br />
<br />
;[[/New_KDE_Library_API_Policy|Adding New Classes to kdelibs]]<br />
:如何给kdelibs加入新类或新库的建议。<br />
<br />
;[[/CMake Coding Style|CMake Coding Style]]<br />
:这份文档描述了在KDE下使用CMake的编程风格。<br />
<br />
;[[/CMake and Source Compatibility|CMake and Source Compatibility]]<br />
:使得未来发布的KDE能CMake兼容。<br />
<br />
;[[/CMake Commit Policy|CMake Commit Policies]]<br />
:考虑改变CMake构建系统是说需要遵从的准则。<br />
<br />
;[[/Binary Compatibility Issues With C++|Binary Compatibility Issues With C++]] ([http://developer.kde.org/documentation/other/binarycompatibility.html Original])<br />
:A quick overview of issues with binary compatibility with C++. Keep this in mind while altering the API of kdelibs.<br />
<br />
;[[/URI & XML Namespaces Policy|URI & XML Namespaces Policy]]<br />
:Sometimes KDE technologies and applications needs URIs, such as for XML formats. This policy describes practices for that, and how to allocate URIs.<br />
<br />
;[[/API to Avoid|API to Avoid]]<br />
:There are classes and functions in Qt or other places that should be avoided by KDE applications.<br />
<br />
== Procedures ==<br />
<br />
Whereas policies are normative for individual developers -- that is, they describe how developers must behave -- procedures describe how 'the KDE project' as a whole has chosen to behave. We describe what we will do under certain circumstances and why. <br />
<br />
;[[/Security Policy|Security Policy]]<br />
:How security problems can be reported to [mailto:security@kde.org security@kde.org] and how the security team responds to security issues.<br />
<br />
;[[/Packaging Policy|Packaging Policy]]<br />
:This describes KDE's viewpoint on binary packages and elaborates the statement 'KDE provides source.'<br />
<br />
[[Category:Policies]]</div>
Yinfan.ustc
https://techbase.kde.org/index.php?title=Archive:Development/Tutorials/Localization/i18n_Build_Systems_(zh_CN)&diff=52187
Archive:Development/Tutorials/Localization/i18n Build Systems (zh CN)
2010-06-21T07:58:33Z
<p>Yinfan.ustc: /* 幕后的故事 */</p>
<hr />
<div><br />
== 摘要 ==<br />
<br />
现在您的程序能够本地化了,我们接下来考虑怎样把这个重要的机能合并到您程序的Cmake系统中去。<br />
首先我们“理论”上解释用于安装.po文件时解压缩信息字符串所需要的步骤。然后我们来看怎么实现这些步骤([[#Theory: The xgettext toolchain]])。如果您的程序书用KDE的subversion开发的,很多步骤是自动完成的(参见 [[#handling i18n in KDE's subversion repository]])。 如果不是,请参见 [[#handling i18n in third party applications]] 部分。<br />
<br />
== 理论: xgettext 工具 ==<br />
<br />
翻译需要以下步骤:<br />
# 提取出要翻译的字符串<br />
# 将新翻译的字串和已有的翻译合并在一起<br />
# 将翻译编译进消息目录<br />
# 安装消息目录<br />
# 在程序中使用消息目录<br />
<br />
=== 提取字符串 ===<br />
<br />
本步骤中,需要收集您代码中所有标记为 i18n()/ki18n()/etc. 的字串到一个临时翻译文件 (.pot) 文件中。 有些待翻译字串在.ui, .rc, or .kcfg 文件中. 此外也要把每日一帖搜集到.pot文件中.<br />
<br />
这个步骤是由 {{path|xgettext}}, {{path|extractrc}}, 和 {{path|preparetips}} 这些程序分别完成的。有些情况下,您也会用到 {{path|extractattr}}.<br />
<br />
=== 合并翻译结果 ===<br />
<br />
一般来讲,一次改动只需要更改少部分的可翻译字串:有些要移除,有些要添加,有些要替换,有些要改变在代码中的位置。这些改变需要在翻译中得到体现。但显然每次(更新)都重做所有的翻译是一件耗力的工作,把原有的翻译和那些改变的东西合并在一起会更好。这时需要 {{path|msgmerge}} 工具。<br />
<br />
=== 编译翻译结果 ===<br />
<br />
为了更快查找信息,需要编译.po文件成所谓的 "消息目录" (.mo / .gmo)。这可由 {{path|msgfmt}} 工具完成.<br />
<br />
=== 安装消息目录 ===<br />
<br />
编译好的信息目录需和程序一起安装。在KDE系统中,标准的消息目录的路径是 {{path|$KDEDIR/share/locale/xx/LC_MESSAGES/}}。<br />
<br />
=== 使用消息目录 ===<br />
<br />
最后,当程序能够运行,程序会载入消息目录来查找和显示翻译的字串。 在大多数情形,对KDE程序而言,这是由{{class|KLocale}} 类自动完成的。<br />
<br />
一些特殊的情形,比如说插件,请参看 [[#Runtime Loading Of Catalogs]].<br />
<br />
== 在KDE的 subversion库中处理==<br />
<br />
如果您使用KDE subversion库做开发,上述大部分的步骤都是自动完成的。此时,您只需要提供一个{{path|Messages.sh}}脚本。我们下面会提到这个脚本。<br />
<br />
此外,如果您的根目录和.pot文件重名,当您对代码打包时,svn2dist脚本会自动包含.po文件<br />
<br />
当然,进行这一步骤所做的详细幕后信息会被提供。<br />
<br />
<br />
=== 编辑 Messages.sh 脚本 ===<br />
<br />
通常地,准备和安装一个KDE subversion 库程序的翻译只需要提供“信息”。包括了需要翻译的代码, ui文件和提示。就此而言,您只要写一小段 {{path|Messages.sh}} 代码,并把他放置到您的代码中就好了。下面是一个带注释的例子:<br />
<br />
<code bash n><br />
#!bin/sh<br />
<br />
# invoke the extractrc script on all .ui, .rc, and .kcfg files in the sources<br />
# the results are stored in a pseudo .cpp file to be picked up by xgettext.<br />
$EXTRACTRC `find . -name \*.rc -o -name \*.ui -o -name \*.kcfg` >> rc.cpp<br />
# if your application contains tips-of-the-day, call preparetips as well.<br />
$PREPARETIPS > tips.cpp<br />
# call xgettext on all source files. If your sources have other filename<br />
# extensions besides .cc, .cpp, and .h, just add them in the find call.<br />
$XGETTEXT `find . -name \*.cc -o -name \*.cpp -o -name \*.h` -o $podir/APPNAME.pot<br />
</code><br />
<br />
可以发现,这段脚本实际上只含有三行代码,而且这三段并不都是必要的。$XGETTEXT, $PREPARETIPS, $EXTRACTRC 和 $podir 环境变量是预先定义好的,不需要考虑。您只需要将 "APPNAME" 替换成您的程序的名字 (参见 [[#Naming .pot Files]] 描述了例外的情形)。<br />
<br />
请确定您的Messages.sh 脚本概括了所有需要的信息。如有疑问,请查看其它KDE subversion库中程序的示例,或者,询问。<br />
<br />
=== 这些步骤做了什么 ===<br />
<br />
{{Tip|如果你使用KDE code repository管理代码,这些都是自动完成的。如果您没有使用KDE repository,您就要自己手动完成相关步骤,参见[[#handling i18n in third party applications]].}}<br />
<br />
每隔一段时间, KDE 服务器会运行{{path|extract-messages.sh}} (又称为scripty) 脚本。这个脚本会使用适当的参数调用库中所有的Messages.sh。 提取所得的信息会储存在一个l10n模块的一个临时文件夹的临时的 (.pot) 文件。参见 [[What Is Scripty]]。<br />
<br />
KDE翻译组会翻译这些信息并将其放在相应语言的文件夹中。这些文件夹会依模块细分。例如,德语翻译会被放置在{{path|l10n/de/messages/kdebase/konqueror.po}}中. <br />
<br />
当l10n模块构建完成, 相应的.po文件会被编译成二进制形式的.mo文件以供更快的查询和显示。.mo files 放置在 {{path|$KDEDIR/share/locale/xx/LC_MESSAGES/}}中,其中 xx 是个两字符的 ISO 639 相对于该语言的编码。这被称为消息目录。 <br />
<br />
运行时 <tt>i18n(...)</tt> 函数会查询用户桌面所使用的语言,并使用您代码中原有的字串寻找消息目录中的相应部分替换成用户相应的语言。 如果消息目录缺失,或者指定的字串没有找到,<tt>i18n(...)</tt> 会使用您代码中原有的字串。<br />
<br />
您项目中的.desktop文档会被单独处理。{{path|makemessages}}提取字串,比如说将.desktop文件中的名字和注释放置在临时文件夹一个名为{{path|desktop_mmmm.pot}}的文件中,其中 mmmm 是模块的名字。翻译者完成翻译了文档,要将翻译的文本插入回到.desktop文件中。提取的字串列在{{path|l10n/scripts/apply.cc}}中。下面的代码用于检查这些字串:<br />
<br />
<code cppqt n>if (checkTag("Name", in, argc, argv, newFile))<br />
continue;<br />
if (checkTag("Comment", in, argc, argv, newFile))<br />
continue;<br />
if (checkTag("Language", in, argc, argv, newFile))<br />
continue;<br />
if (checkTag("Keywords", in, argc, argv, newFile))<br />
continue;<br />
if (checkTag("About", in, argc, argv, newFile))<br />
continue;<br />
if (checkTag("Description", in, argc, argv, newFile))<br />
continue;<br />
if (checkTag("GenericName", in, argc, argv, newFile))<br />
continue;<br />
if (checkTag("Query", in, argc, argv, newFile))<br />
continue;<br />
if (checkTag("ExtraNames", in, argc, argv, newFile))<br />
continue;</code></div>
Yinfan.ustc
https://techbase.kde.org/index.php?title=Archive:Development/Tutorials/Localization/i18n_Build_Systems_(zh_CN)&diff=52186
Archive:Development/Tutorials/Localization/i18n Build Systems (zh CN)
2010-06-21T07:51:43Z
<p>Yinfan.ustc: /* 理论: xgettext 工具 */</p>
<hr />
<div><br />
== 摘要 ==<br />
<br />
现在您的程序能够本地化了,我们接下来考虑怎样把这个重要的机能合并到您程序的Cmake系统中去。<br />
首先我们“理论”上解释用于安装.po文件时解压缩信息字符串所需要的步骤。然后我们来看怎么实现这些步骤([[#Theory: The xgettext toolchain]])。如果您的程序书用KDE的subversion开发的,很多步骤是自动完成的(参见 [[#handling i18n in KDE's subversion repository]])。 如果不是,请参见 [[#handling i18n in third party applications]] 部分。<br />
<br />
== 理论: xgettext 工具 ==<br />
<br />
翻译需要以下步骤:<br />
# 提取出要翻译的字符串<br />
# 将新翻译的字串和已有的翻译合并在一起<br />
# 将翻译编译进消息目录<br />
# 安装消息目录<br />
# 在程序中使用消息目录<br />
<br />
=== 提取字符串 ===<br />
<br />
本步骤中,需要收集您代码中所有标记为 i18n()/ki18n()/etc. 的字串到一个临时翻译文件 (.pot) 文件中。 有些待翻译字串在.ui, .rc, or .kcfg 文件中. 此外也要把每日一帖搜集到.pot文件中.<br />
<br />
这个步骤是由 {{path|xgettext}}, {{path|extractrc}}, 和 {{path|preparetips}} 这些程序分别完成的。有些情况下,您也会用到 {{path|extractattr}}.<br />
<br />
=== 合并翻译结果 ===<br />
<br />
一般来讲,一次改动只需要更改少部分的可翻译字串:有些要移除,有些要添加,有些要替换,有些要改变在代码中的位置。这些改变需要在翻译中得到体现。但显然每次(更新)都重做所有的翻译是一件耗力的工作,把原有的翻译和那些改变的东西合并在一起会更好。这时需要 {{path|msgmerge}} 工具。<br />
<br />
=== 编译翻译结果 ===<br />
<br />
为了更快查找信息,需要编译.po文件成所谓的 "消息目录" (.mo / .gmo)。这可由 {{path|msgfmt}} 工具完成.<br />
<br />
=== 安装消息目录 ===<br />
<br />
编译好的信息目录需和程序一起安装。在KDE系统中,标准的消息目录的路径是 {{path|$KDEDIR/share/locale/xx/LC_MESSAGES/}}。<br />
<br />
=== 使用消息目录 ===<br />
<br />
最后,当程序能够运行,程序会载入消息目录来查找和显示翻译的字串。 在大多数情形,对KDE程序而言,这是由{{class|KLocale}} 类自动完成的。<br />
<br />
一些特殊的情形,比如说插件,请参看 [[#Runtime Loading Of Catalogs]].<br />
<br />
== 在KDE的 subversion库中处理==<br />
<br />
如果您使用KDE subversion库做开发,上述大部分的步骤都是自动完成的。此时,您只需要提供一个{{path|Messages.sh}}脚本。我们下面会提到这个脚本。<br />
<br />
此外,如果您的根目录和.pot文件重名,当您对代码打包时,svn2dist脚本会自动包含.po文件<br />
<br />
当然,进行这一步骤所做的详细幕后信息会被提供。<br />
<br />
<br />
=== 编辑 Messages.sh 脚本 ===<br />
<br />
通常地,准备和安装一个KDE subversion 库程序的翻译只需要提供“信息”。包括了需要翻译的代码, ui文件和提示。就此而言,您只要写一小段 {{path|Messages.sh}} 代码,并把他放置到您的代码中就好了。下面是一个带注释的例子:<br />
<br />
<code bash n><br />
#!bin/sh<br />
<br />
# invoke the extractrc script on all .ui, .rc, and .kcfg files in the sources<br />
# the results are stored in a pseudo .cpp file to be picked up by xgettext.<br />
$EXTRACTRC `find . -name \*.rc -o -name \*.ui -o -name \*.kcfg` >> rc.cpp<br />
# if your application contains tips-of-the-day, call preparetips as well.<br />
$PREPARETIPS > tips.cpp<br />
# call xgettext on all source files. If your sources have other filename<br />
# extensions besides .cc, .cpp, and .h, just add them in the find call.<br />
$XGETTEXT `find . -name \*.cc -o -name \*.cpp -o -name \*.h` -o $podir/APPNAME.pot<br />
</code><br />
<br />
可以发现,这段脚本实际上只含有三行代码,而且这三段并不都是必要的。$XGETTEXT, $PREPARETIPS, $EXTRACTRC 和 $podir 环境变量是预先定义好的,不需要考虑。您只需要将 "APPNAME" 替换成您的程序的名字 (参见 [[#Naming .pot Files]] 描述了例外的情形)。<br />
<br />
请确定您的Messages.sh 脚本概括了所有需要的信息。如有疑问,请查看其它KDE subversion库中程序的示例,或者,询问。<br />
<br />
=== 幕后的故事 ===<br />
<br />
{{Tip|如果你使用KDE code repository管理代码,这些都是自动完成的。如果您没有使用KDE repository,您就要自己手动完成相关步骤,参见[[#handling i18n in third party applications]].}}<br />
<br />
每隔一段时间, KDE 服务器会运行{{path|extract-messages.sh}} (又称为scripty) 脚本。这个脚本会使用适当的参数调用库中所有的Messages.sh。 提取所得的信息胡储存在一个l10n模块的一个临时文件夹的临时的 (.pot) 文件。参见 [[What Is Scripty]]。<br />
<br />
KDE翻译组会翻译这些信息将其并放在相应语言的文件夹中。这些文件夹会由模块细分。例如,德语翻译会被放置在{{path|l10n/de/messages/kdebase/konqueror.po}}中. <br />
<br />
当l10n模块构建完成, 相应的.po文件会被编译成二进制形式的.mo文件以供更快的查询和显示。.mo files 在 {{path|$KDEDIR/share/locale/xx/LC_MESSAGES/}}中,其中 xx 是个两字符的 ISO 639 相对于该语言的编码。这被称为消息目录。 <br />
<br />
运行时 <tt>i18n(...)</tt> 函数会使用您代码中原有的字串,并查询用户桌面所使用的语言,从而查询消息目录并替换成用户相应的语言。 如果消息目录缺失,或者指定的字串没有找到,<tt>i18n(...)</tt> 会使用您程序中原有的字串。<br />
<br />
您项目中的.desktop文档会被单独处理。{{path|makemessages}}提取字串,比如说将,desktop文件中的名字和注释放置在临时文件夹一个名为{{path|desktop_mmmm.pot}}的文件中,其中 mmmm 是模块的名字。翻译者完成翻译了文档,要将翻译的文本插入回到.desktop文件中。提取的字串列在{{path|l10n/scripts/apply.cc}}中. Here's the code that checks for them:<br />
<br />
<code cppqt n>if (checkTag("Name", in, argc, argv, newFile))<br />
continue;<br />
if (checkTag("Comment", in, argc, argv, newFile))<br />
continue;<br />
if (checkTag("Language", in, argc, argv, newFile))<br />
continue;<br />
if (checkTag("Keywords", in, argc, argv, newFile))<br />
continue;<br />
if (checkTag("About", in, argc, argv, newFile))<br />
continue;<br />
if (checkTag("Description", in, argc, argv, newFile))<br />
continue;<br />
if (checkTag("GenericName", in, argc, argv, newFile))<br />
continue;<br />
if (checkTag("Query", in, argc, argv, newFile))<br />
continue;<br />
if (checkTag("ExtraNames", in, argc, argv, newFile))<br />
continue;</code></div>
Yinfan.ustc
https://techbase.kde.org/index.php?title=Archive:Development/Tutorials/Localization/i18n_Build_Systems_(zh_CN)&diff=52185
Archive:Development/Tutorials/Localization/i18n Build Systems (zh CN)
2010-06-21T07:46:11Z
<p>Yinfan.ustc: /* 幕后的故事 */</p>
<hr />
<div><br />
== 摘要 ==<br />
<br />
现在您的程序能够本地化了,我们接下来考虑怎样把这个重要的机能合并到您程序的Cmake系统中去。<br />
首先我们“理论”上解释用于安装.po文件时解压缩信息字符串所需要的步骤。然后我们来看怎么实现这些步骤([[#Theory: The xgettext toolchain]])。如果您的程序书用KDE的subversion开发的,很多步骤是自动完成的(参见 [[#handling i18n in KDE's subversion repository]])。 如果不是,请参见 [[#handling i18n in third party applications]] 部分。<br />
<br />
== 理论: xgettext 工具 ==<br />
<br />
翻译需要以下步骤:<br />
# 提取出要翻译的字符串<br />
# 将新翻译的字串和已有的翻译合并在一起<br />
# 将翻译编译进消息目录<br />
# 安装消息目录<br />
# 在程序中使用消息目录<br />
<br />
=== 提取字符串 ===<br />
<br />
本步骤中,所有您代码中标记为 i18n()/ki18n()/etc. 的字串需要被收集到一个临时翻译文件 (.pot) 文件中。 有些待翻译字串在.ui, .rc, or .kcfg 文件中. 此外也要把每日一帖搜集到.pot文件中.<br />
<br />
这个步骤是由 {{path|xgettext}}, {{path|extractrc}}, 和 {{path|preparetips}} 这些程序分别完成的。有些情况下,您也会用到 {{path|extractattr}}.<br />
<br />
=== 合并翻译结果 ===<br />
<br />
一般来讲,某次只有少部分的可翻译字串需要更改:有些需要被移除,有些需要被添加,有些要被替换,有些要改变在代码中的位置。这些改变需要在翻译中得到体现,但显然每次(更新)都重做所有的翻译是一件耗力的工作。 把原有的翻译和那些改变的东西合并在一起会更好。这时需要 {{path|msgmerge}} 工具。<br />
<br />
=== 编译翻译结果 ===<br />
<br />
为了让信息查找更快,.po文件需要编译成所谓的 "消息目录" (.mo / .gmo)。这可由 {{path|msgfmt}} 工具完成.<br />
<br />
=== 安装消息目录 ===<br />
<br />
编译好的信息目录需和程序一起安装。KDE系统中,标准的消息目录的路径是 {{path|$KDEDIR/share/locale/xx/LC_MESSAGES/}}。<br />
<br />
=== 使用消息目录 ===<br />
<br />
最后,但程序能够运行,程序需要载入消息目录来查找和显示翻译的字串。 对KDE程序而言,在大多数情形,这是由{{class|KLocale}} 类自动完成的。<br />
<br />
一些特殊的情形,比如说插件,请参看 [[#Runtime Loading Of Catalogs]].<br />
<br />
== 在KDE的 subversion库中处理==<br />
<br />
如果您使用KDE subversion库做开发,上述大部分的步骤都是自动完成的。此时,您只需要提供一个{{path|Messages.sh}}脚本。我们下面会提到这个脚本。<br />
<br />
此外,如果您的根目录和.pot文件重名,当您对代码打包时,svn2dist脚本会自动包含.po文件<br />
<br />
当然,进行这一步骤所做的详细幕后信息会被提供。<br />
<br />
<br />
=== 编辑 Messages.sh 脚本 ===<br />
<br />
通常地,准备和安装一个KDE subversion 库程序的翻译只需要提供“信息”。包括了需要翻译的代码, ui文件和提示。就此而言,您只要写一小段 {{path|Messages.sh}} 代码,并把他放置到您的代码中就好了。下面是一个带注释的例子:<br />
<br />
<code bash n><br />
#!bin/sh<br />
<br />
# invoke the extractrc script on all .ui, .rc, and .kcfg files in the sources<br />
# the results are stored in a pseudo .cpp file to be picked up by xgettext.<br />
$EXTRACTRC `find . -name \*.rc -o -name \*.ui -o -name \*.kcfg` >> rc.cpp<br />
# if your application contains tips-of-the-day, call preparetips as well.<br />
$PREPARETIPS > tips.cpp<br />
# call xgettext on all source files. If your sources have other filename<br />
# extensions besides .cc, .cpp, and .h, just add them in the find call.<br />
$XGETTEXT `find . -name \*.cc -o -name \*.cpp -o -name \*.h` -o $podir/APPNAME.pot<br />
</code><br />
<br />
可以发现,这段脚本实际上只含有三行代码,而且这三段并不都是必要的。$XGETTEXT, $PREPARETIPS, $EXTRACTRC 和 $podir 环境变量是预先定义好的,不需要考虑。您只需要将 "APPNAME" 替换成您的程序的名字 (参见 [[#Naming .pot Files]] 描述了例外的情形)。<br />
<br />
请确定您的Messages.sh 脚本概括了所有需要的信息。如有疑问,请查看其它KDE subversion库中程序的示例,或者,询问。<br />
<br />
=== 幕后的故事 ===<br />
<br />
{{Tip|如果你使用KDE code repository管理代码,这些都是自动完成的。如果您没有使用KDE repository,您就要自己手动完成相关步骤,参见[[#handling i18n in third party applications]].}}<br />
<br />
每隔一段时间, KDE 服务器会运行{{path|extract-messages.sh}} (又称为scripty) 脚本。这个脚本会使用适当的参数调用库中所有的Messages.sh。 提取所得的信息胡储存在一个l10n模块的一个临时文件夹的临时的 (.pot) 文件。参见 [[What Is Scripty]]。<br />
<br />
KDE翻译组会翻译这些信息将其并放在相应语言的文件夹中。这些文件夹会由模块细分。例如,德语翻译会被放置在{{path|l10n/de/messages/kdebase/konqueror.po}}中. <br />
<br />
当l10n模块构建完成, 相应的.po文件会被编译成二进制形式的.mo文件以供更快的查询和显示。.mo files 在 {{path|$KDEDIR/share/locale/xx/LC_MESSAGES/}}中,其中 xx 是个两字符的 ISO 639 相对于该语言的编码。这被称为消息目录。 <br />
<br />
运行时 <tt>i18n(...)</tt> 函数会使用您代码中原有的字串,并查询用户桌面所使用的语言,从而查询消息目录并替换成用户相应的语言。 如果消息目录缺失,或者指定的字串没有找到,<tt>i18n(...)</tt> 会使用您程序中原有的字串。<br />
<br />
您项目中的.desktop文档会被单独处理。{{path|makemessages}}提取字串,比如说将,desktop文件中的名字和注释放置在临时文件夹一个名为{{path|desktop_mmmm.pot}}的文件中,其中 mmmm 是模块的名字。翻译者完成翻译了文档,要将翻译的文本插入回到.desktop文件中。提取的字串列在{{path|l10n/scripts/apply.cc}}中. Here's the code that checks for them:<br />
<br />
<code cppqt n>if (checkTag("Name", in, argc, argv, newFile))<br />
continue;<br />
if (checkTag("Comment", in, argc, argv, newFile))<br />
continue;<br />
if (checkTag("Language", in, argc, argv, newFile))<br />
continue;<br />
if (checkTag("Keywords", in, argc, argv, newFile))<br />
continue;<br />
if (checkTag("About", in, argc, argv, newFile))<br />
continue;<br />
if (checkTag("Description", in, argc, argv, newFile))<br />
continue;<br />
if (checkTag("GenericName", in, argc, argv, newFile))<br />
continue;<br />
if (checkTag("Query", in, argc, argv, newFile))<br />
continue;<br />
if (checkTag("ExtraNames", in, argc, argv, newFile))<br />
continue;</code></div>
Yinfan.ustc
https://techbase.kde.org/index.php?title=Archive:Development/Tutorials/Localization/i18n_Build_Systems_(zh_CN)&diff=52184
Archive:Development/Tutorials/Localization/i18n Build Systems (zh CN)
2010-06-21T07:43:55Z
<p>Yinfan.ustc: /* 幕后的故事 */</p>
<hr />
<div><br />
== 摘要 ==<br />
<br />
现在您的程序能够本地化了,我们接下来考虑怎样把这个重要的机能合并到您程序的Cmake系统中去。<br />
首先我们“理论”上解释用于安装.po文件时解压缩信息字符串所需要的步骤。然后我们来看怎么实现这些步骤([[#Theory: The xgettext toolchain]])。如果您的程序书用KDE的subversion开发的,很多步骤是自动完成的(参见 [[#handling i18n in KDE's subversion repository]])。 如果不是,请参见 [[#handling i18n in third party applications]] 部分。<br />
<br />
== 理论: xgettext 工具 ==<br />
<br />
翻译需要以下步骤:<br />
# 提取出要翻译的字符串<br />
# 将新翻译的字串和已有的翻译合并在一起<br />
# 将翻译编译进消息目录<br />
# 安装消息目录<br />
# 在程序中使用消息目录<br />
<br />
=== 提取字符串 ===<br />
<br />
本步骤中,所有您代码中标记为 i18n()/ki18n()/etc. 的字串需要被收集到一个临时翻译文件 (.pot) 文件中。 有些待翻译字串在.ui, .rc, or .kcfg 文件中. 此外也要把每日一帖搜集到.pot文件中.<br />
<br />
这个步骤是由 {{path|xgettext}}, {{path|extractrc}}, 和 {{path|preparetips}} 这些程序分别完成的。有些情况下,您也会用到 {{path|extractattr}}.<br />
<br />
=== 合并翻译结果 ===<br />
<br />
一般来讲,某次只有少部分的可翻译字串需要更改:有些需要被移除,有些需要被添加,有些要被替换,有些要改变在代码中的位置。这些改变需要在翻译中得到体现,但显然每次(更新)都重做所有的翻译是一件耗力的工作。 把原有的翻译和那些改变的东西合并在一起会更好。这时需要 {{path|msgmerge}} 工具。<br />
<br />
=== 编译翻译结果 ===<br />
<br />
为了让信息查找更快,.po文件需要编译成所谓的 "消息目录" (.mo / .gmo)。这可由 {{path|msgfmt}} 工具完成.<br />
<br />
=== 安装消息目录 ===<br />
<br />
编译好的信息目录需和程序一起安装。KDE系统中,标准的消息目录的路径是 {{path|$KDEDIR/share/locale/xx/LC_MESSAGES/}}。<br />
<br />
=== 使用消息目录 ===<br />
<br />
最后,但程序能够运行,程序需要载入消息目录来查找和显示翻译的字串。 对KDE程序而言,在大多数情形,这是由{{class|KLocale}} 类自动完成的。<br />
<br />
一些特殊的情形,比如说插件,请参看 [[#Runtime Loading Of Catalogs]].<br />
<br />
== 在KDE的 subversion库中处理==<br />
<br />
如果您使用KDE subversion库做开发,上述大部分的步骤都是自动完成的。此时,您只需要提供一个{{path|Messages.sh}}脚本。我们下面会提到这个脚本。<br />
<br />
此外,如果您的根目录和.pot文件重名,当您对代码打包时,svn2dist脚本会自动包含.po文件<br />
<br />
当然,进行这一步骤所做的详细幕后信息会被提供。<br />
<br />
<br />
=== 编辑 Messages.sh 脚本 ===<br />
<br />
通常地,准备和安装一个KDE subversion 库程序的翻译只需要提供“信息”。包括了需要翻译的代码, ui文件和提示。就此而言,您只要写一小段 {{path|Messages.sh}} 代码,并把他放置到您的代码中就好了。下面是一个带注释的例子:<br />
<br />
<code bash n><br />
#!bin/sh<br />
<br />
# invoke the extractrc script on all .ui, .rc, and .kcfg files in the sources<br />
# the results are stored in a pseudo .cpp file to be picked up by xgettext.<br />
$EXTRACTRC `find . -name \*.rc -o -name \*.ui -o -name \*.kcfg` >> rc.cpp<br />
# if your application contains tips-of-the-day, call preparetips as well.<br />
$PREPARETIPS > tips.cpp<br />
# call xgettext on all source files. If your sources have other filename<br />
# extensions besides .cc, .cpp, and .h, just add them in the find call.<br />
$XGETTEXT `find . -name \*.cc -o -name \*.cpp -o -name \*.h` -o $podir/APPNAME.pot<br />
</code><br />
<br />
可以发现,这段脚本实际上只含有三行代码,而且这三段并不都是必要的。$XGETTEXT, $PREPARETIPS, $EXTRACTRC 和 $podir 环境变量是预先定义好的,不需要考虑。您只需要将 "APPNAME" 替换成您的程序的名字 (参见 [[#Naming .pot Files]] 描述了例外的情形)。<br />
<br />
请确定您的Messages.sh 脚本概括了所有需要的信息。如有疑问,请查看其它KDE subversion库中程序的示例,或者,询问。<br />
<br />
=== 幕后的故事 ===<br />
<br />
{{附注|如果你使用KDE code repository管理代码,这些都是自动完成的。如果您没有使用KDE repository,您就要自己手动完成相关步骤,参见[[#handling i18n in third party applications]].}}<br />
<br />
每隔一段时间, KDE 服务器会运行{{path|extract-messages.sh}} (又称为scripty) 脚本。这个脚本会使用适当的参数调用库中所有的Messages.sh。 提取所得的信息胡储存在一个l10n模块的一个临时文件夹的临时的 (.pot) 文件。参见 [[What Is Scripty]]。<br />
<br />
KDE翻译组会翻译这些信息将其并放在相应语言的文件夹中。这些文件夹会由模块细分。例如,德语翻译会被放置在{{path|l10n/de/messages/kdebase/konqueror.po}}中. <br />
<br />
当l10n模块构建完成, 相应的.po文件会被编译成二进制形式的.mo文件以供更快的查询和显示。.mo files 在 {{path|$KDEDIR/share/locale/xx/LC_MESSAGES/}}中,其中 xx 是个两字符的 ISO 639 相对于该语言的编码。这被称为消息目录。 <br />
<br />
运行时 <tt>i18n(...)</tt> 函数会使用您代码中原有的字串,并查询用户桌面所使用的语言,从而查询消息目录并替换成用户相应的语言。 如果消息目录缺失,或者指定的字串没有找到,<tt>i18n(...)</tt> 会使用您程序中原有的字串。<br />
<br />
您项目中的.desktop文档会被单独处理。{{path|makemessages}}提取字串,比如说将,desktop文件中的名字和注释放置在临时文件夹一个名为{{path|desktop_mmmm.pot}}的文件中,其中 mmmm 是模块的名字。翻译者完成翻译了文档,要将翻译的文本插入回到.desktop文件中。提取的字串列在{{path|l10n/scripts/apply.cc}}中. Here's the code that checks for them:<br />
<br />
<code cppqt n>if (checkTag("Name", in, argc, argv, newFile))<br />
continue;<br />
if (checkTag("Comment", in, argc, argv, newFile))<br />
continue;<br />
if (checkTag("Language", in, argc, argv, newFile))<br />
continue;<br />
if (checkTag("Keywords", in, argc, argv, newFile))<br />
continue;<br />
if (checkTag("About", in, argc, argv, newFile))<br />
continue;<br />
if (checkTag("Description", in, argc, argv, newFile))<br />
continue;<br />
if (checkTag("GenericName", in, argc, argv, newFile))<br />
continue;<br />
if (checkTag("Query", in, argc, argv, newFile))<br />
continue;<br />
if (checkTag("ExtraNames", in, argc, argv, newFile))<br />
continue;</code></div>
Yinfan.ustc
https://techbase.kde.org/index.php?title=KDE_TechBase:Contributors&diff=52183
KDE TechBase:Contributors
2010-06-21T07:15:57Z
<p>Yinfan.ustc: /* Chinese(simplified) Team */</p>
<hr />
<div>Welcome to the contributors page.<br />
<br />
'''This site contains a list of ''active'' contributors. It should help to build teams which maintain KDE TechBase's content. If you have questions about KDE TechBase you can ask/email the corresponding person.'''<br />
<br />
Please add yourself to the list where appropriate. If you are inactive, please remove yourself again.<br />
<br />
== Administrators ==<br />
<br />
This is a list of KDE TechBase administrators.<br />
<br />
* [[User:Danimo|Danimo]], <danimo at kde dot org><br />
* [[User:Dhaumann|Dhaumann]], <dhaumann at kde dot org><br />
* [[User:Tstaerk|Tstaerk]], <thorsten at staerk dot de><br />
<br />
== Reviewers and Article Writers ==<br />
<br />
If you are continuously reviewing KDE TechBase changes or writing articles add yourself to the list.<br />
<br />
* [[User:Dhaumann|Dhaumann]], <dhaumann at kde dot org><br />
* [[User:Milliams|Milliams]]<br />
* [[User:JRT|James Tyrer]], <tyrerj at acm dot org> [[Getting_Started/Build/KDE4.x|author of KDE 4.x ]]<br />
* name, <email><br />
<br />
== Translation Teams ==<br />
<br />
KDE TechBase is [[Help:Wiki Translation|translated]] into many languages. If you translate pages please add yourself to the right translation team.<br />
<br />
=== Chinese(simplified) Team ===<br />
* [[User:Liangqi|Liangqi]], cavendish.qi at gmail dot com<br />
* [[User:HualiangM|HualiangM]], hualiang.miao at googlemail dot com<br />
* [[User:Yinfan.ustc|Yifan]], enthumelon at gmail dot com<br />
* name, <email><br />
<br />
=== Spanish Team ===<br />
* [[User:Martin J. Ponce|Martin J. Ponce]], mjp dot ttc at gmail dot com<br />
* [[User:edumardo| Eduardo Delgado Díaz (edumardo)]], aesalemolo at gmail dot com<br />
* name, <email><br />
<br />
=== German Team ===<br />
* [[User:DrSlowDecay|DrSlowDecay]], kde at metalhorde dot de<br />
* [[User:Rememberme|rememberme]] redict dot info at gmx dot net<br />
* [[User:sschloenvoigt|Steffen Schloenvoigt]], steffen at schloenvoigt dot de <br />
* name, <email><br />
<br />
=== Italian Team ===<br />
* [[User:Thunder Teaser|Thunder Teaser]], totokid at gmail dot com<br />
* [[User:Panda84|Panda84]], panda84 at inwind dot it<br />
* [[User:Fresbeeplayer|Fresbeeplayer]], fresbeeplayer at gmail dot com<br />
* name, <email><br />
<br />
=== Tamil Team ===<br />
* [[User:Shriramadhas|Shriramadhas]], shriramadhas at gmail dot com<br />
* name, <email><br />
<br />
=== ... Kerala Amrita ===<br />
* Name Arun v Pillai, <email>arun.avp134@gmail.com<br />
* Name Arun Jyothi S, <ninakkayiajs@gmil.com></div>
Yinfan.ustc
https://techbase.kde.org/index.php?title=KDE_TechBase:Contributors&diff=52182
KDE TechBase:Contributors
2010-06-21T07:15:02Z
<p>Yinfan.ustc: /* Chinese(simplified) Team */</p>
<hr />
<div>Welcome to the contributors page.<br />
<br />
'''This site contains a list of ''active'' contributors. It should help to build teams which maintain KDE TechBase's content. If you have questions about KDE TechBase you can ask/email the corresponding person.'''<br />
<br />
Please add yourself to the list where appropriate. If you are inactive, please remove yourself again.<br />
<br />
== Administrators ==<br />
<br />
This is a list of KDE TechBase administrators.<br />
<br />
* [[User:Danimo|Danimo]], <danimo at kde dot org><br />
* [[User:Dhaumann|Dhaumann]], <dhaumann at kde dot org><br />
* [[User:Tstaerk|Tstaerk]], <thorsten at staerk dot de><br />
<br />
== Reviewers and Article Writers ==<br />
<br />
If you are continuously reviewing KDE TechBase changes or writing articles add yourself to the list.<br />
<br />
* [[User:Dhaumann|Dhaumann]], <dhaumann at kde dot org><br />
* [[User:Milliams|Milliams]]<br />
* [[User:JRT|James Tyrer]], <tyrerj at acm dot org> [[Getting_Started/Build/KDE4.x|author of KDE 4.x ]]<br />
* name, <email><br />
<br />
== Translation Teams ==<br />
<br />
KDE TechBase is [[Help:Wiki Translation|translated]] into many languages. If you translate pages please add yourself to the right translation team.<br />
<br />
=== Chinese(simplified) Team ===<br />
* [[User:Liangqi|Liangqi]], cavendish.qi at gmail dot com<br />
* [[User:HualiangM|HualiangM]], hualiang.miao at googlemail dot com<br />
* [[User:Yifan.ustc|Yifan]], enthumelon at gmail dot com<br />
* name, <email><br />
<br />
=== Spanish Team ===<br />
* [[User:Martin J. Ponce|Martin J. Ponce]], mjp dot ttc at gmail dot com<br />
* [[User:edumardo| Eduardo Delgado Díaz (edumardo)]], aesalemolo at gmail dot com<br />
* name, <email><br />
<br />
=== German Team ===<br />
* [[User:DrSlowDecay|DrSlowDecay]], kde at metalhorde dot de<br />
* [[User:Rememberme|rememberme]] redict dot info at gmx dot net<br />
* [[User:sschloenvoigt|Steffen Schloenvoigt]], steffen at schloenvoigt dot de <br />
* name, <email><br />
<br />
=== Italian Team ===<br />
* [[User:Thunder Teaser|Thunder Teaser]], totokid at gmail dot com<br />
* [[User:Panda84|Panda84]], panda84 at inwind dot it<br />
* [[User:Fresbeeplayer|Fresbeeplayer]], fresbeeplayer at gmail dot com<br />
* name, <email><br />
<br />
=== Tamil Team ===<br />
* [[User:Shriramadhas|Shriramadhas]], shriramadhas at gmail dot com<br />
* name, <email><br />
<br />
=== ... Kerala Amrita ===<br />
* Name Arun v Pillai, <email>arun.avp134@gmail.com<br />
* Name Arun Jyothi S, <ninakkayiajs@gmil.com></div>
Yinfan.ustc
https://techbase.kde.org/index.php?title=KDE_TechBase:Contributors&diff=52181
KDE TechBase:Contributors
2010-06-21T07:14:14Z
<p>Yinfan.ustc: /* Chinese(simplified) Team */</p>
<hr />
<div>Welcome to the contributors page.<br />
<br />
'''This site contains a list of ''active'' contributors. It should help to build teams which maintain KDE TechBase's content. If you have questions about KDE TechBase you can ask/email the corresponding person.'''<br />
<br />
Please add yourself to the list where appropriate. If you are inactive, please remove yourself again.<br />
<br />
== Administrators ==<br />
<br />
This is a list of KDE TechBase administrators.<br />
<br />
* [[User:Danimo|Danimo]], <danimo at kde dot org><br />
* [[User:Dhaumann|Dhaumann]], <dhaumann at kde dot org><br />
* [[User:Tstaerk|Tstaerk]], <thorsten at staerk dot de><br />
<br />
== Reviewers and Article Writers ==<br />
<br />
If you are continuously reviewing KDE TechBase changes or writing articles add yourself to the list.<br />
<br />
* [[User:Dhaumann|Dhaumann]], <dhaumann at kde dot org><br />
* [[User:Milliams|Milliams]]<br />
* [[User:JRT|James Tyrer]], <tyrerj at acm dot org> [[Getting_Started/Build/KDE4.x|author of KDE 4.x ]]<br />
* name, <email><br />
<br />
== Translation Teams ==<br />
<br />
KDE TechBase is [[Help:Wiki Translation|translated]] into many languages. If you translate pages please add yourself to the right translation team.<br />
<br />
=== Chinese(simplified) Team ===<br />
* [[User:Liangqi|Liangqi]], cavendish.qi at gmail dot com<br />
* [[User:HualiangM|HualiangM]], hualiang.miao at googlemail dot com<br />
* [[User:Yifan|Yifan.ustc]], enthumelon at gmail dot com<br />
* name, <email><br />
<br />
=== Spanish Team ===<br />
* [[User:Martin J. Ponce|Martin J. Ponce]], mjp dot ttc at gmail dot com<br />
* [[User:edumardo| Eduardo Delgado Díaz (edumardo)]], aesalemolo at gmail dot com<br />
* name, <email><br />
<br />
=== German Team ===<br />
* [[User:DrSlowDecay|DrSlowDecay]], kde at metalhorde dot de<br />
* [[User:Rememberme|rememberme]] redict dot info at gmx dot net<br />
* [[User:sschloenvoigt|Steffen Schloenvoigt]], steffen at schloenvoigt dot de <br />
* name, <email><br />
<br />
=== Italian Team ===<br />
* [[User:Thunder Teaser|Thunder Teaser]], totokid at gmail dot com<br />
* [[User:Panda84|Panda84]], panda84 at inwind dot it<br />
* [[User:Fresbeeplayer|Fresbeeplayer]], fresbeeplayer at gmail dot com<br />
* name, <email><br />
<br />
=== Tamil Team ===<br />
* [[User:Shriramadhas|Shriramadhas]], shriramadhas at gmail dot com<br />
* name, <email><br />
<br />
=== ... Kerala Amrita ===<br />
* Name Arun v Pillai, <email>arun.avp134@gmail.com<br />
* Name Arun Jyothi S, <ninakkayiajs@gmil.com></div>
Yinfan.ustc
https://techbase.kde.org/index.php?title=User:Yinfan.ustc&diff=52180
User:Yinfan.ustc
2010-06-21T07:13:56Z
<p>Yinfan.ustc: Created page with 'Concentrating on translating statistical/mathematical applications into simple/tranditional Chinese, neither KDE or Gnome ones.'</p>
<hr />
<div>Concentrating on translating statistical/mathematical applications into simple/tranditional Chinese, neither KDE or Gnome ones.</div>
Yinfan.ustc
https://techbase.kde.org/index.php?title=Archive:Development/Tutorials/Localization/i18n_Build_Systems_(zh_CN)&diff=52179
Archive:Development/Tutorials/Localization/i18n Build Systems (zh CN)
2010-06-21T07:03:27Z
<p>Yinfan.ustc: /* 使用消息目录 */</p>
<hr />
<div><br />
== 摘要 ==<br />
<br />
现在您的程序能够本地化了,我们接下来考虑怎样把这个重要的机能合并到您程序的Cmake系统中去。<br />
首先我们“理论”上解释用于安装.po文件时解压缩信息字符串所需要的步骤。然后我们来看怎么实现这些步骤([[#Theory: The xgettext toolchain]])。如果您的程序书用KDE的subversion开发的,很多步骤是自动完成的(参见 [[#handling i18n in KDE's subversion repository]])。 如果不是,请参见 [[#handling i18n in third party applications]] 部分。<br />
<br />
== 理论: xgettext 工具 ==<br />
<br />
翻译需要以下步骤:<br />
# 提取出要翻译的字符串<br />
# 将新翻译的字串和已有的翻译合并在一起<br />
# 将翻译编译进消息目录<br />
# 安装消息目录<br />
# 在程序中使用消息目录<br />
<br />
=== 提取字符串 ===<br />
<br />
本步骤中,所有您代码中标记为 i18n()/ki18n()/etc. 的字串需要被收集到一个临时翻译文件 (.pot) 文件中。 有些待翻译字串在.ui, .rc, or .kcfg 文件中. 此外也要把每日一帖搜集到.pot文件中.<br />
<br />
这个步骤是由 {{path|xgettext}}, {{path|extractrc}}, 和 {{path|preparetips}} 这些程序分别完成的。有些情况下,您也会用到 {{path|extractattr}}.<br />
<br />
=== 合并翻译结果 ===<br />
<br />
一般来讲,某次只有少部分的可翻译字串需要更改:有些需要被移除,有些需要被添加,有些要被替换,有些要改变在代码中的位置。这些改变需要在翻译中得到体现,但显然每次(更新)都重做所有的翻译是一件耗力的工作。 把原有的翻译和那些改变的东西合并在一起会更好。这时需要 {{path|msgmerge}} 工具。<br />
<br />
=== 编译翻译结果 ===<br />
<br />
为了让信息查找更快,.po文件需要编译成所谓的 "消息目录" (.mo / .gmo)。这可由 {{path|msgfmt}} 工具完成.<br />
<br />
=== 安装消息目录 ===<br />
<br />
编译好的信息目录需和程序一起安装。KDE系统中,标准的消息目录的路径是 {{path|$KDEDIR/share/locale/xx/LC_MESSAGES/}}。<br />
<br />
=== 使用消息目录 ===<br />
<br />
最后,但程序能够运行,程序需要载入消息目录来查找和显示翻译的字串。 对KDE程序而言,在大多数情形,这是由{{class|KLocale}} 类自动完成的。<br />
<br />
一些特殊的情形,比如说插件,请参看 [[#Runtime Loading Of Catalogs]].<br />
<br />
== 在KDE的 subversion库中处理==<br />
<br />
如果您使用KDE subversion库做开发,上述大部分的步骤都是自动完成的。此时,您只需要提供一个{{path|Messages.sh}}脚本。我们下面会提到这个脚本。<br />
<br />
此外,如果您的根目录和.pot文件重名,当您对代码打包时,svn2dist脚本会自动包含.po文件<br />
<br />
当然,进行这一步骤所做的详细幕后信息会被提供。<br />
<br />
<br />
=== 编辑 Messages.sh 脚本 ===<br />
<br />
通常地,准备和安装一个KDE subversion 库程序的翻译只需要提供“信息”。包括了需要翻译的代码, ui文件和提示。就此而言,您只要写一小段 {{path|Messages.sh}} 代码,并把他放置到您的代码中就好了。下面是一个带注释的例子:<br />
<br />
<code bash n><br />
#!bin/sh<br />
<br />
# invoke the extractrc script on all .ui, .rc, and .kcfg files in the sources<br />
# the results are stored in a pseudo .cpp file to be picked up by xgettext.<br />
$EXTRACTRC `find . -name \*.rc -o -name \*.ui -o -name \*.kcfg` >> rc.cpp<br />
# if your application contains tips-of-the-day, call preparetips as well.<br />
$PREPARETIPS > tips.cpp<br />
# call xgettext on all source files. If your sources have other filename<br />
# extensions besides .cc, .cpp, and .h, just add them in the find call.<br />
$XGETTEXT `find . -name \*.cc -o -name \*.cpp -o -name \*.h` -o $podir/APPNAME.pot<br />
</code><br />
<br />
可以发现,这段脚本实际上只含有三行代码,而且这三段并不都是必要的。$XGETTEXT, $PREPARETIPS, $EXTRACTRC 和 $podir 环境变量是预先定义好的,不需要考虑。您只需要将 "APPNAME" 替换成您的程序的名字 (参见 [[#Naming .pot Files]] 描述了例外的情形)。<br />
<br />
请确定您的Messages.sh 脚本概括了所有需要的信息。如有疑问,请查看其它KDE subversion库中程序的示例,或者,询问。<br />
<br />
=== 幕后的故事 ===<br />
<br />
{{tip|如果你使用KDE code repository管理代码,这些都是自动完成的。如果您没有使用KDE repository,您就要自己手动完成相关步骤,参见[[#handling i18n in third party applications]].}}<br />
<br />
每隔一段时间, KDE 服务器会运行{{path|extract-messages.sh}} (又称为scripty) 脚本。这个脚本会使用适当的参数调用库中所有的Messages.sh。 提取所得的信息胡储存在一个l10n模块的一个临时文件夹的临时的 (.pot) 文件。参见 [[What Is Scripty]]。<br />
The KDE translation teams translate the messages and commit them into a messages folder corresponding to the language, which is further broken down by module. For example, German translated messages for konqueror are committed to {{path|l10n/de/messages/kdebase/konqueror.po}}. <br />
<br />
When the l10n module is built, the .po files are compiled into a binary format for fast lookup and installed as .mo files to {{path|$KDEDIR/share/locale/xx/LC_MESSAGES/}}, where xx is the two-letter ISO 639 code for the language. These are called the message catalogs. <br />
<br />
At runtime, the <tt>i18n(...)</tt> function, using the original string you coded, looks up the string in the message catalog of the user's desktop language and returns the translated string. If the message catalog is missing, or the specific string is not found, <tt>i18n(...)</tt> falls back to the original string in your code. <br />
<br />
.desktop files in your project are handled separately. {{path|makemessages}} extracts strings, such as Name and Comment from the .desktop files and places them into a file named {{path|desktop_mmmm.pot}}, where mmmm is the module name, in the templates folder. Once translators have translated this file, makemessages inserts the translated strings back into the .desktop files. The list of strings extracted is in {{path|l10n/scripts/apply.cc}}. Here's the code that checks for them:<br />
<br />
<code cppqt n>if (checkTag("Name", in, argc, argv, newFile))<br />
continue;<br />
if (checkTag("Comment", in, argc, argv, newFile))<br />
continue;<br />
if (checkTag("Language", in, argc, argv, newFile))<br />
continue;<br />
if (checkTag("Keywords", in, argc, argv, newFile))<br />
continue;<br />
if (checkTag("About", in, argc, argv, newFile))<br />
continue;<br />
if (checkTag("Description", in, argc, argv, newFile))<br />
continue;<br />
if (checkTag("GenericName", in, argc, argv, newFile))<br />
continue;<br />
if (checkTag("Query", in, argc, argv, newFile))<br />
continue;<br />
if (checkTag("ExtraNames", in, argc, argv, newFile))<br />
continue;</code></div>
Yinfan.ustc
https://techbase.kde.org/index.php?title=Archive:Development/Tutorials/Localization/i18n_Build_Systems_(zh_CN)&diff=52178
Archive:Development/Tutorials/Localization/i18n Build Systems (zh CN)
2010-06-21T06:36:53Z
<p>Yinfan.ustc: /* 摘要 */</p>
<hr />
<div><br />
== 摘要 ==<br />
<br />
现在您的程序能够本地化了,我们接下来考虑怎样把这个重要的机能合并到您程序的Cmake系统中去。<br />
首先我们“理论”上解释用于安装.po文件时解压缩信息字符串所需要的步骤。然后我们来看怎么实现这些步骤([[#Theory: The xgettext toolchain]])。如果您的程序书用KDE的subversion开发的,很多步骤是自动完成的(参见 [[#handling i18n in KDE's subversion repository]])。 如果不是,请参见 [[#handling i18n in third party applications]] 部分。<br />
<br />
== 理论: xgettext 工具 ==<br />
<br />
翻译需要以下步骤:<br />
# 提取出要翻译的字符串<br />
# 将新翻译的字串和已有的翻译合并在一起<br />
# 将翻译编译进消息目录<br />
# 安装消息目录<br />
# 在程序中使用消息目录<br />
<br />
=== 提取字符串 ===<br />
<br />
本步骤中,所有您代码中标记为 i18n()/ki18n()/etc. 的字串需要被收集到一个临时翻译文件 (.pot) 文件中。 有些待翻译字串在.ui, .rc, or .kcfg 文件中. 此外也要把每日一帖搜集到.pot文件中.<br />
<br />
这个步骤是由 {{path|xgettext}}, {{path|extractrc}}, 和 {{path|preparetips}} 这些程序分别完成的。有些情况下,您也会用到 {{path|extractattr}}.<br />
<br />
=== 合并翻译结果 ===<br />
<br />
一般来讲,某次只有少部分的可翻译字串需要更改:有些需要被移除,有些需要被添加,有些要被替换,有些要改变在代码中的位置。这些改变需要在翻译中得到体现,但显然每次(更新)都重做所有的翻译是一件耗力的工作。 把原有的翻译和那些改变的东西合并在一起会更好。这时需要 {{path|msgmerge}} 工具。<br />
<br />
=== 编译翻译结果 ===<br />
<br />
为了让信息查找更快,.po文件需要编译成所谓的 "消息目录" (.mo / .gmo)。这可由 {{path|msgfmt}} 工具完成.<br />
<br />
=== 安装消息目录 ===<br />
<br />
编译好的信息目录需和程序一起安装。KDE系统中,标准的消息目录的路径是 {{path|$KDEDIR/share/locale/xx/LC_MESSAGES/}}。<br />
<br />
=== 使用消息目录 ===<br />
<br />
最后,但程序能够运行,程序需要载入消息目录来查找和显示翻译的字串。 对KDE程序而言,在大多数情形,这是由{{class|KLocale}} 类自动完成的。<br />
<br />
一些特殊的情形,比如说插件,请参看 [[#Runtime Loading Of Catalogs]].</div>
Yinfan.ustc
https://techbase.kde.org/index.php?title=Archive:Development/Tutorials/Localization/i18n_Build_Systems_(zh_CN)&diff=52177
Archive:Development/Tutorials/Localization/i18n Build Systems (zh CN)
2010-06-21T06:36:02Z
<p>Yinfan.ustc: Created page with ' == 摘要 == 现在您的程序能够哦本地化了,我们接下来考虑怎样把这个重要的机能合并到您的程序的Now that your Cmake系统中去。 首先我...'</p>
<hr />
<div><br />
== 摘要 ==<br />
<br />
现在您的程序能够哦本地化了,我们接下来考虑怎样把这个重要的机能合并到您的程序的Now that your Cmake系统中去。<br />
首先我们“理论”上解释用于安装.po文件时解压缩信息字符串所需要的步骤。然后我们来看怎么实现这些步骤([[#Theory: The xgettext toolchain]])。如果您的程序书用KDE的subversion开发的,很多步骤是自动完成的(参见 [[#handling i18n in KDE's subversion repository]])。 如果不是,请参见 [[#handling i18n in third party applications]] 部分。<br />
<br />
== 理论: xgettext 工具 ==<br />
<br />
翻译需要以下步骤:<br />
# 提取出要翻译的字符串<br />
# 将新翻译的字串和已有的翻译合并在一起<br />
# 将翻译编译进消息目录<br />
# 安装消息目录<br />
# 在程序中使用消息目录<br />
<br />
=== 提取字符串 ===<br />
<br />
本步骤中,所有您代码中标记为 i18n()/ki18n()/etc. 的字串需要被收集到一个临时翻译文件 (.pot) 文件中。 有些待翻译字串在.ui, .rc, or .kcfg 文件中. 此外也要把每日一帖搜集到.pot文件中.<br />
<br />
这个步骤是由 {{path|xgettext}}, {{path|extractrc}}, 和 {{path|preparetips}} 这些程序分别完成的。有些情况下,您也会用到 {{path|extractattr}}.<br />
<br />
=== 合并翻译结果 ===<br />
<br />
一般来讲,某次只有少部分的可翻译字串需要更改:有些需要被移除,有些需要被添加,有些要被替换,有些要改变在代码中的位置。这些改变需要在翻译中得到体现,但显然每次(更新)都重做所有的翻译是一件耗力的工作。 把原有的翻译和那些改变的东西合并在一起会更好。这时需要 {{path|msgmerge}} 工具。<br />
<br />
=== 编译翻译结果 ===<br />
<br />
为了让信息查找更快,.po文件需要编译成所谓的 "消息目录" (.mo / .gmo)。这可由 {{path|msgfmt}} 工具完成.<br />
<br />
=== 安装消息目录 ===<br />
<br />
编译好的信息目录需和程序一起安装。KDE系统中,标准的消息目录的路径是 {{path|$KDEDIR/share/locale/xx/LC_MESSAGES/}}。<br />
<br />
=== 使用消息目录 ===<br />
<br />
最后,但程序能够运行,程序需要载入消息目录来查找和显示翻译的字串。 对KDE程序而言,在大多数情形,这是由{{class|KLocale}} 类自动完成的。<br />
<br />
一些特殊的情形,比如说插件,请参看 [[#Runtime Loading Of Catalogs]].</div>
Yinfan.ustc
https://techbase.kde.org/index.php?title=Archive:Development/Tutorials_(zh_CN)&diff=52176
Archive:Development/Tutorials (zh CN)
2010-06-21T06:00:14Z
<p>Yinfan.ustc: /* Porting an application from KSystemTrayIcon to KStatusNotifierItem */</p>
<hr />
<div>{{Template:I18n/Language Navigation Bar (zh_CN)|Development/Tutorials}}<br />
<br />
教程是学习KDE,发现KDE都能为你做哪些事以及如何做的捷径。下面是当前可用的'''KDE4'''教程列表。关于KDE3和KDE2的材料可以在本页的底部找到。<br />
<br />
== KDE4编程介绍 ==<br />
你是否对用KDE4写程序感兴趣呢?这个系列教程的目的是让那些对KDE编程没有任何概念的新手能够入门。<br />
<br />
;[[Development/Tutorials/First program (zh_CN)|世界你好]]<br />
:''本教程介绍了KDE4编程的最基本的知识''<br />
<br />
;[[Development/Tutorials/Using KXmlGuiWindow (zh_CN)|创建主窗口]]<br />
:''本教程将向你展示关于应用程序最重要的部分──主窗口──的魔术。''<br />
<br />
;[[Development/Tutorials/Using KActions (zh_CN)|使用KActions]]<br />
:''如何向菜单和工具栏中添加动作。''<br />
<br />
;[[Development/Tutorials/Saving and loading (zh_CN)|保存与载入]]<br />
:''介绍KIO类库,为应用程序增加加载,存储的功能。''<br />
<br />
;[[Development/Tutorials/KCmdLineArgs (zh_CN)|命令行参数]]<br />
:''在命令行用文字编辑器打开指定文件。''<br />
<br />
<br />
== 基础知识 ==<br />
;[[Development/Tutorials/KDE4 Porting Guide|移植你的程序]]<br />
:''帮助你将应用程序从Qt3/KDE3移植到Qt4/KDE4''<br />
<br />
;[[Development/Tutorials/CMake_(zh_CN)|CMake介绍]]<br />
:''介绍如何使用KDE4的构建系统CMake。''<br />
<br />
;[[Development/Tutorials/Common Programming Mistakes|常见编程错误]]<br />
:''介绍各种在开发Qt和KDE应用程序时常见的错误,以及如何避免它们。''<br />
<br />
;[[Development/Tutorials/Using Qt Designer|使用Qt Designer构建用户界面]]<br />
:''如何使用designer创建UI文件,以及如何将它们集成到KDE程序中。''<br />
<br />
;[[Development/Tutorials/Creating Libraries_(zh_CN)|把代码加到库中]]<br />
:''如何把类库加到联编系统以及如何准备源代码。''<br />
<br />
;[[Development/Tutorials/Session_Management_(zh_CN)|会话管理]]<br />
:''让程序了解X会话''<br />
<br />
<br />
== 测试与调试 ==<br />
<br />
;[[Development/Tutorials/Debugging_(zh_CN)|调试你的应用程序]]<br />
:''介绍在你调试KDE应用程序时可以采用的工具、技术和技巧。''<br />
<br />
;[[Development/Tutorials/Unittests|使用QTestLib为Qt4与KDE4编写单元测试]] ([http://developer.kde.org/documentation/tutorials/writingunittests/writingunittests.html 原始出处])<br />
:''[mailto:bradh@frogmouth.net Brad Hards]的教程,介绍了如何使用QTestLib编写单元测试。它是一个基于例子的教程,仍在开发中。''<br />
<br />
;[[Development/Tutorials/Code_Checking|检测错误代码的半自动方法]]<br />
:''介绍了一些在KDE代码中检测错误代码的技术''<br />
<br />
== 使用KConfig管理配置数据 ==<br />
;[[Development/Tutorials/KConfig|KConfig介绍]]<br />
:''概要介绍了KConfig相关的类,以及如何在你的应用程序代码中使用它们''<br />
<br />
;[[Development/Tutorials/Using KConfig XT|使用KConfig XT]]<br />
:''关于如何有效使用KConfig XT框架的教程''<br />
<br />
;[[Development/Tutorials/Updating KConfig Files|更新KConfig文件]]<br />
:''关于如何编写一个更新脚本,以保证你程序的配置文件格式与用户已使用的现有配置文件一致的教程''<br />
<br />
== 服务:应用程序和插件 ==<br />
;[[Development/Tutorials/Services/Introduction|服务框架介绍]]<br />
:''关于KDE中的服务框架,以及它们向开发人员提供了哪些功能的概述。覆盖了对系统配置文件缓存(SyCoCa)、源数据文件以及用索引信息可以做哪些事情的介绍''<br />
<br />
;[[Development/Tutorials/Services/Traders|使用Trader查询来查找服务]]<br />
:''如何使用Trader查询语法来查找那些在SyCoCa中被索引了的服务,如插件或者mime类型等''<br />
<br />
;[[Development/Tutorials/Services/Plugins|使用KService创建和载入模块]]<br />
:''学习如何使用KService,以一种方便且易于扩展方式来完成诸如定义自定义插件类型、查找已安装的插件(包括第三方插件)、以及载入插件等任务。''<br />
<br />
== 本地化 ==<br />
见 [[Localization|本地化入口]].<br />
<br />
;[[Development/Tutorials/Localization/Unicode|Unicode介绍]]<br />
:''对Unicode和如何在KDE应用程序中处理Unicode的一个简要说明。''<br />
<br />
; [[Development/Tutorials/Localization/i18n|编写考虑到本地化需要的应用程序]]<br />
:''这篇教程内容涵盖了什么是本地化、为什么本地化很重要和如何确定您的应用程序已经为本地化做好准备。这是一份所有应用程序开发者的必读说明。''<br />
<br />
; [[Development/Tutorials/Localization/i18n Mistakes|避免常见的本地化陷阱]]<br />
:''通常有许多普遍易犯的错误阻碍应用程序被正确地本地化。这篇教程阐述了什么是错误的方式,并告诉您如何简单地避免这些错误。''<br />
<br />
; [[Development/Tutorials/Localization/Building KDE's l10n Module|构建KDE本地化模块]]<br />
:''对那些开发KDE主应用库的人来说,联编和安装支持KDE的本地化的语言( l10n )模块是一个好主意。这样做可以让您测试您的应用程序在另一种语言并且迅速发现什么地方出问题了。本教程告诉我们如何做到这一点。<br />
''<br />
<br />
; [[Development/Tutorials/Localization/i18n Build Systems|将i18n合并到构建系统中]]<br />
:''一旦您已准备好进行本地化工作,下一步是确保翻译文件是自动创建并且是不断更新的。本教程涵盖了必要CMakeFiles.txt流程 以及您的应用程序中所产生的信息在发布时的流程。<br />
''<br />
<br />
; [[Development/Tutorials/Localization/i18n Challenges|常见的i18n挑战和解决方案]]<br />
:''本教程涵盖你所可能遇到的各种挑战,诸如陷入如翻译手册时存在源代码以外的资料,合并和处理独立PO文件,处理冻结的文件,处理英语以外的语言和创建独立发布版本或者在KDE模块间转移一些应用。<br />
''<br />
<br />
; [[Development/Tutorials/Localization/i18n_Semantics|消息的语义标记]]<br />
:''为了应用程序中保证一贯的表述,并使得消息更有意义,用于标示语义标记翻译可使用KUIT系统。此教程说明本系统如何工作的。<br />
''<br />
<br />
; [[Development/Tutorials/Localization/i18n Krazy|自动化i18n代码检查]]<br />
:''Krazy代码检查器扫描KDE的代码并报告常见的i18n错误。''<br />
<br />
== 文档 ==<br />
<br />
;[[Development/Tutorials/API_Documentation|API文档]]<br />
:''本教程告诉我们如何正确对应用程序接口(API)进行建档''<br />
<br />
;[[Development/Tutorials/Man_Pages|Man Pages]]<br />
:''编写产生参考手册。''<br />
<br />
== 应用程序自动化及脚本 ==<br />
<br />
=== D-Bus ===<br />
<br />
; [[Development/Tutorials/D-Bus/Introduction|D-Bus介绍]]<br />
:''从一个程序开发员的角度对D-Bus作一个单刀直入的介绍,教程里讲述了D-Bus是什么以及如何人在应用程序中使用。''<br />
<br />
; [[Development/Tutorials/D-Bus/Accessing Interfaces|访问D-Bus接口]]<br />
:''手把手指导如何用QtDBus调用D-Bus并连接到D-Bus信号。''<br />
<br />
; [[Development/Tutorials/D-Bus/Intermediate_D-Bus|中级D-Bus编程]]<br />
:''利用QtBus的一些技巧,可以用来解决现实生活中的一些问题。''<br />
<br />
; [[Development/Tutorials/D-Bus/Creating Interfaces|创建D-Bus接口]]<br />
:''如何创建和定制D-Bus的接口来增强你的应用程序。教程包含了产生XML描述,运行时实例化接口,用CMake建立联编系统。''<br />
<br />
; [[Development/Tutorials/D-Bus/Autostart Services|D-Bus自动启动服务]]<br />
:''如何把你的程序改装为一个D-Bus自启动的服务。D-Bus的这个功能也被成为"D-Bus自启动服", 他将确保即便你没有启动你的程序,D-Bus后台程序也会在需要时把它起起来。''<br />
<br />
; [[Development/Tutorials/Porting_to_D-Bus|从DCOP移植到D-Bus]]<br />
: ''从DCOP向D-BUS 移植指导手册。''<br />
<br />
=== Konqueror ===<br />
; [[Development/Tutorials/Creating Konqueror Service Menus|创建Konqueror服务菜单]]<br />
:''本教程将讲述如何在Konqueror's浮动菜单中创建特定mimetype的动作 (aka "servicemenus").''<br />
<br />
=== Kross ===<br />
; [[Development/Tutorials/Kross/Introduction|Kross介绍]]<br />
:''介绍Kross脚本框架.''<br />
<br />
; [[Development/Tutorials/Kross/Hello_World|世界你好]]<br />
:''Kross的第一段代码。''<br />
<br />
; [[Development/Tutorials/Kross/Call_Functions_in_Kross|在Kross调用其它功能]]<br />
:''简单演示如何调用脚本功能''<br />
<br />
; [[Development/Tutorials/Kross/Connecting_Signals_and_slots_in_Kross|链接Kross中的信号和槽]]<br />
:''简单演示如何把对象信号和脚本的槽相连。''<br />
<br />
; [[Development/Tutorials/Kross/Scripts-as-Plugins|使用Kross脚本编写插件]]<br />
:''本教程将手把手的讲述如何把脚本作为插件集成到KDE应用程序中。''<br />
<br />
; [[Development/Tutorials/Kross/Scripts-as-KPlugins|以KPlugins方式加载Kross脚本]]<br />
:''本教程将手把手的讲述如何以KPlugins方式加载Kross脚本。''<br />
<br />
; [[Development/Tutorials/Kross/Script-Actions|为程序菜单添加脚本动作 ]]<br />
:''简单演示如何在程序菜单中执行脚本。''<br />
<br />
=== KOffice Plugin Tutorials===<br />
; [[Development/Tutorials/KOffice Overview|KOffice概览]]<br />
:''本文介绍不同KOffice的插件类型并且讲述了各自的用途和强项。'' 对KOffice插件的新手来说,这是个很好的切入点。<br />
<br />
; [[Development/Tutorials/Write a Flake Plugin|创建KOffice Flake插件]]<br />
:''讲述如何创建一个KOffice的插件,同时用Flake把你的内容嵌入到ODF文档里去。''<br />
<br />
; [[Development/Tutorials/KWord Scripting|编写KWord脚本]]<br />
:''在KRoss框架内使用Python,Ruby或JavaScript为KWord写插件等。''<br />
<br />
; [[Development/Tutorials/KSpread Scripting|编写KSpread脚本]]<br />
:''在KRoss框架内使用Python,Ruby或JavaScript为KSpread写插件等。''<br />
<br />
; [[Development/Tutorials/Krita Scripting|编写Krita脚本]]<br />
:''在KRoss框架内使用Python,Ruby或JavaScript为Krita写插件等。''<br />
<br />
=== SuperKaramba ===<br />
; [[Development/Tutorials/SuperKaramba|SuperKaramba教程]]<br />
:''全面介绍SuperKaramba,主题文件和Python, Ruby和JavaScript脚本.''<br />
<br />
=== System Activity ===<br />
<br />
: [[Development/Tutorials/SystemActivity/Scripting|Writing script actions for the process's context menu]]<br />
:''This tutorial shows how to add a context menu action to show custom information about a process.<br />
<br />
== 插件和KParts ==<br />
<br />
; [[Development/Tutorials/Writing kontact plugins|开发Kontact插件]]:<br />
''Kontact 插件就是KParts. 此教程说明如何您可以开发一个。''<br />
<br />
; [[Development/Tutorials/Using KParts|使用KParts]]:''如何在应用窗口中加载KPart。''<br />
<br />
== 搜索与元数据 ==<br />
<br />
=== Strigi ===<br />
<br />
; [[Development/Tutorials/Writing file analyzers|编写文件分析器]]<br />
:''文件分析器从文件或对话框抽取信息。这样产生的数据也会被用于文件搜索。KDE4允许对一个文件使用多个分析器。本教程讲述如何编写一个新的分析器。''<br />
<br />
=== [http://nepomuk.kde.org Nepomuk] ===<br />
<br />
; [[Development/Tutorials/Metadata/Nepomuk/Quickstart|Nepomuk 快速入门]]<br />
:''如何快速上手使用Nepomuk。''<br />
<br />
; [[Development/Tutorials/Metadata/Nepomuk/RDFIntroduction|Nepomuk中的RDF和本体]]<br />
:''介绍RDF和本体在Nepomuk的应用。''<br />
<br />
; [[Development/Tutorials/Metadata/Nepomuk/Resources|用Nepomuk处理资源]]<br />
:''Nepomuk是KDE的一套类库,用它可以方便的存取Nepomuk系统中的元数据。教授如何在程序中创建和读取Nepomuk系统中的元数据。''<br />
<br />
; [[Development/Tutorials/Metadata/Nepomuk/ResourceGenerator|使用Nepomuk资源产生器]]<br />
:''Nepomuk包括一个资源产生器,用于处理元数据 。''<br />
<br />
; [[Development/Tutorials/Metadata/Nepomuk/AdvancedQueries|高级查询]]<br />
:''Nepomuk的真正用途在于对数据源的查询结果的掌控。本教程介绍如何用Nepomuk进行语意查询和全文查询。''<br />
<br />
; [[Development/Tutorials/Metadata/Nepomuk/NepomukServer|Nepomuk服务器和Nepomuk系统架构]]<br />
:''Nepomuk服务器在有Nepomuk主要数据仓库并且可以通过Soprano API直接存取。''<br />
<br />
; [[Development/Tutorials/Metadata/Nepomuk/NepomukServices|Nepomuk服务]]<br />
:''Nepomuk服务器管理一系列Nepomuk服务。''<br />
<br />
:* [[Development/Tutorials/Metadata/Nepomuk/StorageService|存储服务]] ''这也许是它最重要的服务了,采用[http://soprano.sourceforge.net Soprano]装载Nepomuk的数据仓库。''<br />
<br />
:* [[Development/Tutorials/Metadata/Nepomuk/OntologyLoaderService|本体加载]] ''确保安装的本体信息如RDF, RDFS, NRL, 或Xesam都已加载到存储仓库里了。''<br />
<br />
:* [[Development/Tutorials/Metadata/Nepomuk/FileWatchService|文件监视服务]] ''监视文件系统,一旦有变化,即时更新Nepomuk的文件资源路径和URI''<br />
<br />
:* [[Development/Tutorials/Metadata/Nepomuk/StrigiService|Strigi服务]] ''控制Strigi,文件索引工具,它从文件中抽取元数据并把它存储到数据仓库中。''<br />
<br />
:* [[Development/Tutorials/Metadata/Nepomuk/QueryService|查询服务]] ''提供持久查询文件夹。''<br />
<br />
; [[Development/Tutorials/Metadata/Nepomuk/TipsAndTricks|Nepomuk Tips and Tricks]]<br />
:''A set of tips and tricks for development with Nepomuk and Soprano. This is a must-read if you intend to use Nepomuk in your application or hack on it directly.''<br />
<br />
== 硬件发现(Solid) ==<br />
<br />
;[[Development/Tutorials/Solid_Tutorials|Solid介绍]]<br />
:''介绍使用Solid发现硬件以及如何与KDE程序交互。''<br />
<br />
;[[Development/Tutorials/Solid_Network_Tutorial|访问网络信息]]<br />
:''如何用Solid系统获取网络信息''<br />
<br />
== 特权程序(PolicyKit) ==<br />
; [[Development/Tutorials/PolicyKit/Introduction|Introduction to PolicyKit]]<br />
:''简单介绍PolicyKit是什么,它是如何在程序需要超级用户权限或其它认证时起作用的。''<br />
; [[Development/Tutorials/PolicyKit/Helper_HowTo|利用caller-helper模式以root用户权限操作]]<br />
:''本教程讲述如何在程序中方便的以root用户执行一些操作(用户有相应授权)。PolicyKit和caller-helper的使用是由一定技巧的。''<br />
; [[Development/Tutorials/PolicyKit/KCM_HowTo|在KCM模块中获取root权限]]<br />
:''本教程讲述如何以root用户来创建一个可以保存设置的KCModules。''<br />
<br />
== 多媒体(Phonon) ==<br />
<br />
;[[Development/Tutorials/Phonon/Introduction|Phonon]]<br />
:''如何使用多媒体的应用程序接口(API)''<br />
<br />
== Plasma ==<br />
<br />
请见[[Development/Tutorials/Plasma_(zh_CN)|Plasma 教学]]<br />
<br />
== 通讯 (Decibel) ==<br />
<br />
;[[Development/Tutorials/Decibel/GettingStarted|Decibel入门]]<br />
:''如何设置Decibel.''<br />
<br />
;[[Development/Tutorials/Decibel/Handling_TextChannels|处理文字通道(TextChannels)]]<br />
:''本教程通过如何编写一个简单的聊天程序介绍文字通道(TextChannels)的处理方法。''<br />
<br />
== 个人信息管理(Akonadi) ==<br />
<br />
;[[Development/Tutorials/Akonadi/Resources|开发Akonadi 资源]]<br />
:''Akonadi Resources是一个代理程序,在Akonadi和后台程序间(文件,服务器,等)传送PIM数据。''<br />
<br />
== Kate / Kwrite ==<br />
<br />
;[[Development/Tutorials/Kate/KTextEditor Plugins|KTextEditor插件入门]]<br />
:''创建你第一个插件''<br />
<br />
== KDevelop ==<br />
<br />
;[[Development/KDevelop-PG-Qt_Introduction|KDevelop-PG-Qt Introduction]]<br />
:''Information on the KDevelop parser generator, useful for language plugins.''<br />
<br />
== 打印 ==<br />
<br />
;[[Development/Tutorials/Printing Hello World|世界你好]]<br />
:''介绍KDE打印系统''<br />
<br />
;TODO 打印对话框<br />
:''使用KDE打印对话框''<br />
<br />
== kioslaves ==<br />
* [[Development/Tutorials/KIO Slaves/Using KIO Slaves in your Program|应用 kioslaves]]<br />
* [[Development/Tutorials/KIO Slaves/Hello World|kioslave简单例程]]<br />
<br />
== 获取热点新材料 ==<br />
<br />
; [[Development/Tutorials/K_Hot_New_Stuff2|获取热点新材料 2]]<br />
:''如何使用KHotNewStuff2。''<br />
<br />
; [[Development/Tutorials/Introduction to Get Hot New Stuff|获取热点新材料入门]]<br />
:''介绍一个对开发员友好的网络更新系统,KDE程序可以在运行时以一种友好的方式获取最新运行数据。''<br />
<br />
;[[Development/Tutorials/KNewStuffSecure|KNewStuff安全项]] ([http://developer.kde.org/documentation/tutorials/knewstuffsecure/index.html 原文链接])<br />
:''如何以另一种方法使用资源(KDE 3.4 及更新).'' 由 Andr&#225;s Mantia &lt;amantia@kde.org&gt;开发.<br />
<br />
== Goya ==<br />
; [[Development/Tutorials/Introduction to Goya usage|Goya使用简介]]<br />
:''介绍Goya子系统应用, 让你轻易的为物品视图添加图形并把他们产生的时间链接到你得处理代码上,从而使它们成为真正的图形应用。''<br />
<br />
; [[Development/Tutorials/Introduction to Goya usage 2|Goya的使用(第二部分)]]<br />
:''教程第二部分,加了些复杂的例程。''<br />
<br />
== 快速应用程序开发(RAD) ==<br />
<br />
=== Python ===<br />
<br />
;[http://www.learningpython.com/2008/09/20/an-introduction-to-pyqt/ PyQt介绍]<br />
:''初学者''<br />
<br />
;[http://lateral.netmanagers.com.ar/stories/BBS47.html PyQt by Example]<br />
:''介绍PyQt''<br />
<br />
;[[Development/Languages/Python/PyKDE_WebKit_Tutorial|PyKDE WebKit Tutorial]]<br />
:''PyKDE的浏览器''<br />
<br />
;[[Development/Tutorials/Python introduction to signals and slots|101 signals 与slots介绍]]<br />
:''对QT信号与槽架构的简单介绍''<br />
<br />
;[[Development/Languages/Python/PyKDE_DBus_Tutorial|PyKDE DBus Tutorial]]<br />
:''介绍如何使用PyKDE来链接D-BUS通讯。''<br />
<br />
=== Ruby ===<br />
<br />
;[http://developer.kde.org/language-bindings/ruby/kde3tutorial/index.html KDE Ruby Korundum教程]<br />
:''Ruby版的Antonio Larrosa Jim&eacute;nez's KDE教程,由Richard Dale开发。详见[[Development/Languages/Ruby (zh CN)|Ruby开发者]],内有Qt教程和其它信息。''<br />
<br />
;[[Development/Tutorials/Qt4_Ruby_Tutorial_(zh_CN)|Qt4 Ruby教程]]<br />
:''Nokia的Ruby Qt教程。''<br />
<br />
;[[Development/Tutorials/Plasma/RubyApplet|用Ruby创建Plasma小程序]]<br />
:''介绍如何利用Ruby创建Plasma小程序。''<br />
<br />
;[[Development/Tutorials/Developing_Qt4_Applications_using_Qt_Designer_and_Ruby_on_Kubuntu|在 Kubuntu 使用Qt Designer 和 Ruby 开发 Qt4 应用程序]]<br />
:''本教学从头开始展示如何使用 Qt Designer 设计一个简单的用户接口,然后把产生的 widget 使用在 Qt Ruby 应用程序。''<br />
<br />
;[[Development/Languages/Ruby/Ruby-Qt/KDE_Book|Ruby-Qt/KDE Book]]<br />
:''There is also an approach to create an Ruby-Qt/KDE Book under a free license. The content will be created in this wiki.''<br />
<br />
=== Shell ===<br />
<br />
;[[Development/Tutorials/Shell_Scripting_with_KDE_Dialogs|使用KDE对话框进行脚本编程]] ([http://developer.kde.org/documentation/tutorials/kdialog/t1.html 原文链接]) <br />
:''[mailto:bradh@frogmouth.net Brad Hards]介绍如何在脚本中使用KDE对话框Kdialog。其中有实例和教程。''<br />
<br />
== 图形编程 ==<br />
<br />
;[[Development/Tutorials/Graphics/Performance|QPainter性能]]<br />
:''对使用QPainter导致性能影响的一些常见错误进行介绍''<br />
<br />
== 使用KDE游戏库 ==<br />
;[[Development/Tutorials/Games/KStandardGameAction| KStandardGameAction]]<br />
:''用libkdegames开发符合KDE游戏标准的游戏。''<br />
;[[Development/Tutorials/Games/Highscores| 排行榜]]<br />
:''在程序中实现一个简单的排行榜''<br />
;[[Development/Tutorials/Games/Theme Selector| 主题选择器]]<br />
:''使用libkdegames主题选择对话框。''<br />
;[[Development/Tutorials/Games/Palapeli Patterns| Palapeli模式]]<br />
:''为Palapeli创建一种模式''<br />
<br />
=== KGLEngine ===<br />
;[[Development/Tutorials/Games/kglengine/kglengine-simpleBox| 安装和开发首个KGLItem]]<br />
:''开始使用kglengine''<br />
;[[Development/Tutorials/Games/kglengine/kglengine-motion| 物品移动]]<br />
:''如何移动kglitem''<br />
;[[Development/Tutorials/Games/kglengine/kglengine-collision| 冲突发现]]<br />
:''如何发现冲突和交互。''<br />
;[[Development/Tutorials/Games/kglengine/kglengine-texture| 材质和色彩]]<br />
:''为你的创作添加材质和色彩。''<br />
;[[Development/Tutorials/Games/kglengine/kglengine-effects| 颗粒和阴影效果]]<br />
:''添加特效''<br />
;[[Development/Tutorials/Games/KGLEngine2d| kglpong]]<br />
:''创建一个pong''<br />
<br />
=== KALEngine ===<br />
;[[Development/Tutorials/Games/KALEngine| 播放声音]]<br />
:''在KALEngine中用openAL开发游戏中的声响效果。''<br />
<br />
;[[Development/Tutorials/Games/KALEngine-music| 播放音乐]]<br />
:''利用KALEngine播放流音乐''<br />
<br />
== 使用KDE PIM类库==<br />
;[[Development/Tutorials/PIM/ical| iCalendar功能]]<br />
:''利用kcal来操作iCalendar文件。''<br />
<br />
<br />
== 其它教程 ==<br />
<br />
=== 2D绘图(KPlotWidget) ===<br />
;[[Development/Tutorials/KPlotWidget|使用KDE数据绘制widget]]<br />
:''本教程介绍了KPlotWidget, 它可以被用来开发二维数据打印。他介绍了一些简单应用(包括添加修改数据集,定制打印坐标和标签),以及一些高级定制化(包括如何通过扩展子类来扩展图形界面)。''<br />
<br />
=== 拼写与语法检查 ===<br />
;[[Development/Tutorials/Sonnet/SonnetTutorial|在KDE应用程序中添加拼写或语法检查]]<br />
:''本教程介绍了Sonnet,以及如何使用它来为你的KDE程序添加语言检查. Sonnet的辅助功能将在另外一个教程中介绍。''<br />
<br />
=== 像素图缓存(KPixmapCache) ===<br />
;[[Development/Tutorials/KPixmapCache|使用KDE像素图缓存]]<br />
:''本教程讲述如何用KPixmapCache来缓存从矢量数据(SVG)或其他数据源产生的点阵图。''<br />
<br />
=== 使用MarbleWidget (Marble) ===<br />
;[[Development/Tutorials/MarbleWidget|Using MarbleWidget]]<br />
:''本教程告诉我们如何在我们的程序中使用Marble Widget。''<br />
<br />
=== 用本地SCM开发KDE ===<br />
;[[Development/Tutorials/Git|Using Git to develop for KDE]]<br />
:''本教程告诉我们如何用GIT作KDE开发。''<br />
<br />
=== 实现KSysGuard探测器并添加绑定 ===<br />
;[[Development/Tutorials/Sensors]]<br />
:''本教程讲述如何编写KSysGuard探测器并如何把它链接到SysTray。''<br />
Runners<br />
<br />
=== 将一个程序从 KSystemTrayIcon 转换到 KStatusNotifierItem ===<br />
;[[Development/Tutorials/PortToKStatusNotifierItem]]<br />
:''本教程展示了如何将一个使用KSystemTrayIcon的程序转换到使用KStatusNotifierItem''<br />
<br />
== KDE2和KDE3相关材料 ==<br />
<br />
;[[Development/Tutorials/KDE3|KDE3教程]]<br />
:''KDE3 相关教程''<br />
<br />
;[[Development/Tutorials/KDE2|KDE2教程]]<br />
:''KDE2 相关教程''<br />
<br />
[[Category:KDE4]]</div>
Yinfan.ustc