DokuWiki

It's better when it's simple

用户工具

站点工具


zh:localization

本地化 DokuWiki (软件)

DokuWiki配置用户界面为任何语言。

您可以访问 DokuWiki 本地化Hub 将 DokuWiki 翻译成自己使用的语言。我们推荐您参与 I18N 邮件列表,那么当有新词汇出现并且需要翻译时就会收到通知。

本地化 DokuWiki、插件和模板

Most of DokuWiki and its plugins and templates only provide localization for English and some other languages. We encourage you to translate them into your native language.

Important things to keep in mind when translating:

  • Please try to complete your countries main official language before starting another dialect.
  • If you do major translation work it is recommended to check your translations in the development snapshot. This gives you the opportunity to correct errors and verify the layout in your language.
  • In some languages words and sentences tend to get longer than the original English words. Keep in mind that your translation needs to work on any screen size and it often looks better if words are in line with other items on the page.
  • When translating technical descriptions of external origin like the API's delivered by Github, Twitter, Google etc please read the external manual first. This is especially important for translating interfaces. Maybe a localized version of the manual or helppages is already at the external source and you can use all or part of these.
  • As DokuWiki wants to be standards-compliant, consider learning about these regarding your language first. You can learn about correct spelling and interpunction from dictionaries or webpages maintained by public institutions.
  • Always keep the format strings intact, i.e. identical. Strings like these %1$d and <i>%s</i> and <strong>Update:</strong>. The word Update: should be translated but the word <strong> not.

如何添加一个新的翻译语言

为了阻止垃圾信息,https://translate.dokuwiki.org/ 仅启用源代码中已经存在的语言。要启动新语言,您可以发送带有一些翻译行的拉取请求,或者,如果您不会编程,则可以在我们的错误追踪器中打开一个新话题。请使用 ISO 639-1 (2字符)和 ISO 639-3 (3字符)语言代码格式,然后……当语言被接受后,就可以使用翻译工具翻译了。

翻译一致性

翻译一致性页面您会看到:

  • 常用词的预置翻译
  • 在非英语句子中如何处理占位符

插件

插件作者会在 DokuWiki 本地化 Hub 注册插件,您就可以在那里帮助作者翻译插件了。

如果插件不能通过 DokuWiki 本地化 Hub 翻译,您可以手动进行:

  • 复制 lib/plugins/<pluginname>/lang/en/ 内容到
    lib/plugins/<pluginname>/lang/<ISO-lang-code>/
  • 在支持 UTF-8 的编辑器中编辑 .php.txt 文件
  • 压缩新语言文件夹发送给作者,可能下一个版本发布时就会有新语言了

想要更多相关问题和帮助,您可以给 I18N-邮件列表发送邮件或者在 IRC-Channel 寻求帮助。

在您的已安装软件里更新本地化文本

There are many localized texts in DokuWiki like emails that are sent on registration, password forgotten, the text above the edit form, and more. Also the strings used in the buttons and links are translated. You can modify these by creating custom files with your version of the texts. This way your changes aren't overwritten on upgrades.

You can change these texts by copying the <name>.txt files or copying some strings from lang.php:

  • from inc/lang/<ISO 639-1-lang-code>/
  • to conf/lang/<ISO-lang-code>/

and editing the copied content.

You can do the same thing for plugins and templates by copying <name>.txt or some strings from lang.php:

  • from lib/plugins/<plugin>/lang/<ISO-lang-code>/
  • to conf/plugin_lang/<plugin>/<ISO-lang-code>/
  • from lib/tpl/<template>/lang/<ISO-lang-code>/
  • to conf/template_lang/<template>/<ISO-lang-code>/

Copy only strings from lang.php which you will modify. The remaining strings are read from the original file.

Translating txt-files is possible since “Rincewind” 2011-04-22. Translating some strings from lang.php since Release 2014-09-29 “Hrun”.

示例

Example of an English lang.php file. This is possible for every language.

conf/lang/en/lang.php
<?php
/**
 * Customization of the english language file
 * Copy only the strings that needs to be modified
 */
 
$lang['btn_admin']             = 'Admin Panel';

翻译 DokuWiki.org (文档)

Translating the DokuWiki documentation here at dokuwiki.org is encouraged. Translated pages are to be named like their English counterparts and stored in a separate namespace based on their ISO code. To make this easier the Translation Plugin adds links to existing and missing translations in the upper left corner of every page.

Only languages manually configured by the administrator are shown in the selector. If you want to add translations for a language currently not shown, just manually create the pages in the appropriate language subnamespace and send a mail to the I18N mailing list asking for your language to be added.

翻译指南

  • 可创建任何确实的语言翻译
  • 只有顶级名称空间中的页面需要翻译
  • 翻译页面应该与原始(英文)页面使用相同的页面名称
  • 翻译页面必须存储在由ISO语言代码命名的根名称空间的子名称空间中
  • 请不要添加表明该页面不存在信息的页面
  • 请不要进行不负责任的乱翻译 – 如果想被认可为一个负责的译者,请先登录
  • 好的翻译始于手册
  • 可能您想先翻译边栏为您的语言

对于特定页关闭翻译功能

在页面插入宏命令 ~~NOTRANS~~ ,则页面不可翻译。

参见

zh/localization.txt · 最后更改: 2021-05-10 01:41 由 hfl

除额外注明的地方外,本维基上的内容按下列许可协议发布: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki