{"title":"使 Django 本地化","version":"3.0","locale":"zh-hans","docname":"internals/contributing/localizing","url":"/zh-hans/3.0/internals/contributing/localizing/","canonical":"https://djangodocs.dev/zh-hans/3.0/internals/contributing/localizing/","summary":"Django 的很多部分，比如后台站点和认证错误提示都是国际化的。这意味着它们根据使用者的语言展示不同的信息。","html":"<h1>使 Django 本地化<a class=\"heading-anchor\" href=\"#localizing-django\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<p>Django 的很多部分，比如后台站点和认证错误提示都是国际化的。这意味着它们根据使用者的语言展示不同的信息。为此，Django 使用了和 Django 应用相同的国际化和本地化基础设施，在 <a class=\"reference internal\" href=\"/zh-hans/3.0/topics/i18n/\"><span class=\"doc\">i18n documentation</span></a> 中介绍。</p>\n<section id=\"translations\">\n<h2>翻译<a class=\"heading-anchor\" href=\"#translations\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>翻译内容由全球的 Django 用户提供。协调工作由 <a class=\"reference external\" href=\"https://www.transifex.com/\">Transifex</a> 负责。</p>\n<p>如果你发现了一个错误翻译，或是想探讨某部分的翻译，前往 <a class=\"reference external\" href=\"https://www.transifex.com/django/django/\">Django project page</a>。如果你想帮助翻译，或是添加一个未被收录的语言，以下是如何做的方式：</p>\n<ul>\n<li><p>加入 <a class=\"reference internal\" href=\"/zh-hans/3.0/internals/mailing-lists/#django-i18n-mailing-list\"><span class=\"std std-ref\">Django i18n mailing list</span></a> 并介绍你自己。</p></li>\n<li><p>确保你已经阅读了 <a class=\"reference internal\" href=\"/zh-hans/3.0/topics/i18n/translation/#specialties-of-django-i18n\"><span class=\"std std-ref\">Specialties of Django translation</span></a> 的注意点。</p></li>\n<li><p>在 <a class=\"reference external\" href=\"https://www.transifex.com/\">Transifex</a> 注册并访问 <a class=\"reference external\" href=\"https://www.transifex.com/django/django/\">Django project page</a>。</p></li>\n<li><p>在 <a class=\"reference external\" href=\"https://www.transifex.com/django/django/\">Django project page</a>，选择你期望翻译的语言， <strong>或</strong> ——如果该语言不存在——点击“Request language”链接，选择合适的语言，请求创建一个新的语言团队。</p></li>\n<li><p>接着，点击“加入团队”按钮成为团队的一员。每个团队至少拥有一位协调员，负责管理团队。你可以联系团队协调员，了解程序性问题或翻译进度。</p></li>\n<li><p>一旦你成为团队的一员，你就可以在团队页选择你要翻译的文档。例如，“核心”资源是指包含所有非 contrib 翻译的翻译目录。 每个 contrib 应用程序也有一个资源（前缀为“contrib”）。</p>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Note</p>\n<p>更多关于如何使用 Transifex 的信息，阅读 <a class=\"reference external\" href=\"https://docs.transifex.com/\">Transifex User Guide</a>。</p>\n</aside>\n</li>\n</ul>\n<p>Translations from Transifex are only integrated into the Django repository at\nthe time of a new <a class=\"reference internal\" href=\"/zh-hans/3.0/internals/release-process/#term-Feature-release\"><span class=\"xref std std-term\">feature release</span></a>. We try to update\nthem a second time during one of the following <a class=\"reference internal\" href=\"/zh-hans/3.0/internals/release-process/#term-Patch-release\"><span class=\"xref std std-term\">patch release</span></a>s, but that depends on the translation manager's availability.\nSo don't miss the string freeze period (between the release candidate and the\nfeature release) to take the opportunity to complete and fix the translations\nfor your language!</p>\n</section>\n<section id=\"formats\">\n<h2>格式<a class=\"heading-anchor\" href=\"#formats\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>你页可以阅读 <code class=\"docutils literal notranslate\">conf/locale/&lt;locale&gt;/formats.py</code>。该文件介绍了基于你所在地的日期，时间和数字的格式。参考 <a class=\"reference internal\" href=\"/zh-hans/3.0/topics/i18n/formatting/\"><span class=\"doc\">本地格式化</span></a> 获得更多信息。</p>\n<p>格式文件并不由 Transifex 管理。要修改它们的话，你必须对比当前 Django 代码 <a class=\"reference internal\" href=\"/zh-hans/3.0/internals/contributing/writing-code/submitting-patches/\"><span class=\"doc\">创建一个补丁</span></a> ，就像修改其它代码一样：</p>\n<ul class=\"simple\">\n<li><p>针对当前的 Git 主分支创建一个 diff。</p></li>\n<li><p>在 Django 的工单系统创建一个工单，设置其 <code class=\"docutils literal notranslate\">Component</code> 字段为 <code class=\"docutils literal notranslate\">Translations</code>，并附上补丁。</p></li>\n</ul>\n</section>\n<section id=\"documentation\">\n<span id=\"translating-documentation\"></span><h2>文档<a class=\"heading-anchor\" href=\"#documentation\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>还有翻译文档的机会，虽然这是一项浩大的工程（事先提醒！）。同样，我们使用 <a class=\"reference external\" href=\"https://www.transifex.com/django/django-docs/\">Transifex tool</a>。只要 <code class=\"docutils literal notranslate\">docs/intro/*</code> 部分的全部文档被翻译，你就能在 <code class=\"docutils literal notranslate\">https://docs.djangoproject.com/&lt;language_code&gt;/</code> 见到该语言的版本。中文翻译团队官网：<a class=\"reference external\" href=\"https://www.djangodocs.com/\">https://www.djangodocs.com/</a>。</p>\n<p>Once translations are published, updated versions from Transifex will be\nirregularly ported to the <a class=\"reference external\" href=\"https://github.com/django/django-docs-translations\">django/django-docs-translations</a> repository and to the\ndocumentation website. Only translations for the latest stable Django release\nare updated.</p>\n</section>","rootId":"localizing-django","toc":[{"title":"翻译","anchor":"translations","children":[]},{"title":"格式","anchor":"formats","children":[]},{"title":"文档","anchor":"documentation","children":[]}],"breadcrumbs":[{"docname":"internals/index","title":"Django internals","url":"/zh-hans/3.0/internals/"},{"docname":"internals/contributing/index","title":"为 Django 做贡献","url":"/zh-hans/3.0/internals/contributing/"}],"prev":{"docname":"internals/contributing/writing-documentation","title":"编写文档","url":"/zh-hans/3.0/internals/contributing/writing-documentation/"},"next":{"docname":"internals/contributing/committing-code","title":"提交代码","url":"/zh-hans/3.0/internals/contributing/committing-code/"},"formats":{"html":"/zh-hans/3.0/internals/contributing/localizing/","markdown":"/zh-hans/3.0/internals/contributing/localizing.md","json":"/zh-hans/3.0/internals/contributing/localizing.json"},"source":"https://github.com/django/django/blob/stable/3.0.x/docs/internals/contributing/localizing.txt","official":"https://docs.djangoproject.com/zh-hans/3.0/internals/contributing/localizing/","inVersions":["6.1","6.0","5.2","5.1","5.0","4.2","4.1","4.0","3.2","3.1","3.0","2.2","2.1","2.0"],"inLocales":["en","zh-hans","fr","ja","id","pt-br","ko","es","el","pl"]}