====== 本地化 DokuWiki (软件) ====== [[DokuWiki]] 可[[config:lang|配置]]用户界面为任何语言。 您可以访问 [[https://translate.dokuwiki.org/|DokuWiki 本地化Hub]] 将 DokuWiki 翻译成自己使用的语言。我们推荐您参与 [[mailinglist#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 [[https://download.dokuwiki.org/|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 ''%%%s%%'' and ''%%Update:%%''. The word ''Update:'' should be translated but the word ''%%%%'' **not**. ==== 如何添加一个新的翻译语言 ==== 为了阻止垃圾信息,https://translate.dokuwiki.org/ 仅启用源代码中已经存在的语言。要启动新语言,您可以发送带有一些翻译行的拉取请求,或者,如果您不会编程,则可以在我们的错误追踪器中打开一个新话题。请使用 ISO 639-1 (2字符)和 ISO 639-3 (3字符)语言代码格式,然后……当语言被接受后,就可以使用翻译工具翻译了。 ==== 翻译一致性 ==== 在[[zh:teams:i18n:consistenttranslations|翻译一致性]]页面您会看到: * 常用词的预置翻译 * 在非英语句子中如何处理占位符 ==== 插件 ==== 插件作者会在 [[https://translate.dokuwiki.org/|DokuWiki 本地化 Hub]] 注册插件,您就可以在那里帮助作者翻译插件了。 如果插件不能通过 [[https://translate.dokuwiki.org/|DokuWiki 本地化 Hub]] 翻译,您可以手动进行: * 复制 ''lib/plugins//lang/en/'' 内容到 \\ ''lib/plugins//lang//'' * 在支持 [[utf-8|UTF-8]] 的编辑器中编辑 ''.php'' 和 ''.txt'' 文件 * 压缩新语言文件夹发送给作者,可能下一个版本发布时就会有新语言了 想要更多相关问题和帮助,您可以给 [[mailinglist#i18n 邮件列表|I18N-邮件列表]]发送邮件或者在 [[irc|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 ''.txt'' files or copying some strings from ''lang.php'': * from ''inc/lang/<[[https://www.loc.gov/standards/iso639-2/php/English_list.php|ISO 639-1]]-lang-code>/'' * to ''**conf/lang/**/'' and editing the copied content. You can do the same thing for plugins and templates by copying ''.txt'' or some strings from ''lang.php'': * from ''lib/plugins//lang//'' * to ''**conf/plugin_lang/**//'' * from ''lib/tpl/