{"title":"国際化とローカル化","version":"4.0","locale":"ja","docname":"topics/i18n/index","url":"/ja/4.0/topics/i18n/","canonical":"https://djangodocs.dev/ja/4.0/topics/i18n/","summary":"概要 Link to this heading # The goal of internationalization and localization is to allow a single web application to offer its content in languages and formats…","html":"<h1>国際化とローカル化<a class=\"heading-anchor\" href=\"#internationalization-and-localization\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<div class=\"toctree-wrapper compound\">\n</div>\n<section id=\"overview\">\n<h2>概要<a class=\"heading-anchor\" href=\"#overview\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>The goal of internationalization and localization is to allow a single web\napplication to offer its content in languages and formats tailored to the\naudience.</p>\n<p>Django は <a class=\"reference internal\" href=\"/ja/4.0/topics/i18n/translation/\"><span class=\"doc\">テキスト翻訳</span></a> 、<a class=\"reference internal\" href=\"/ja/4.0/topics/i18n/formatting/\"><span class=\"doc\">日時と数字の表示形式</span></a> 、<a class=\"reference internal\" href=\"/ja/4.0/topics/i18n/timezones/\"><span class=\"doc\">タイムゾーン</span></a> をフルサポートしています。</p>\n<p>Django は、本質的には以下の2つを行います:</p>\n<ul class=\"simple\">\n<li><p>開発者やテンプレート作成者に、アプリケーションのどの部分がローカルな言語や文化に合わせて翻訳や表示形式の設定がされるべきかを指定できるようにします。</p></li>\n<li><p>It uses these hooks to localize web apps for particular users according to\ntheir preferences.</p></li>\n</ul>\n<p>翻訳は対象の言語により、表示形式は対象の国によります。これらの情報は、ブラウザによって <code class=\"docutils literal notranslate\"><span class=\"pre\">Accept-Language</span></code> ヘッダにて提供されます。ただし、タイムゾーンは簡単には利用できません。</p>\n</section>\n<section id=\"definitions\">\n<h2>定義<a class=\"heading-anchor\" href=\"#definitions\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>「国際化 (internationalization) 」と「ローカル化 (localization) 」という言葉は混乱を招くことがあるため、ここで簡単に定義しておきます:</p>\n<dl class=\"simple glossary\">\n<dt id=\"term-internationalization\">国際化 (internationalization)<a class=\"heading-anchor\" href=\"#term-internationalization\"><span class=\"visually-hidden\">Link to this term</span><span aria-hidden=\"true\">#</span></a></dt><dd><p>ソフトウェアをローカル化に備えさせることです。通常、開発者によって行われます。</p>\n</dd>\n<dt id=\"term-localization\">ローカル化 (localization)<a class=\"heading-anchor\" href=\"#term-localization\"><span class=\"visually-hidden\">Link to this term</span><span aria-hidden=\"true\">#</span></a></dt><dd><p>翻訳およびローカルな表示形式を記述することです。通常、翻訳者によって行われます。</p>\n</dd>\n</dl>\n<p>より詳しくは、<a class=\"reference external\" href=\"https://www.w3.org/International/questions/qa-i18n\">W3C Web Internationalization FAQ</a>、<a class=\"reference external\" href=\"https://en.wikipedia.org/wiki/Internationalization_and_localization\">Wikipedia article</a>、<a class=\"reference external\" href=\"https://www.gnu.org/software/gettext/manual/gettext.html#Concepts\">GNU gettext documentation</a> をご覧ください。</p>\n<aside class=\"admonition admonition-warning\" role=\"note\">\n<p class=\"admonition-title\">警告</p>\n<p>翻訳と表示形式は、それぞれ <a class=\"reference internal\" href=\"/ja/4.0/ref/settings/#std-setting-USE_I18N\"><code class=\"xref std std-setting docutils literal notranslate\"><span class=\"pre\">USE_I18N</span></code></a> と <a class=\"reference internal\" href=\"/ja/4.0/ref/settings/#std-setting-USE_L10N\"><code class=\"xref std std-setting docutils literal notranslate\"><span class=\"pre\">USE_L10N</span></code></a> 設定によって制御されますが、どちらも国際化とローカル化を含んでいます。この設定名は Django の歴史における不幸な出来事の 1 つです。</p>\n</aside>\n<p>その他、私たちが共通の言葉を使うにあたり、いくつかの専門用語が手助けとなるでしょう:</p>\n<dl class=\"simple glossary\">\n<dt id=\"term-locale-name\">ロケール名<a class=\"heading-anchor\" href=\"#term-locale-name\"><span class=\"visually-hidden\">Link to this term</span><span aria-hidden=\"true\">#</span></a></dt><dd><p>A locale name, either a language specification of the form <code class=\"docutils literal notranslate\"><span class=\"pre\">ll</span></code> or a\ncombined language and country specification of the form <code class=\"docutils literal notranslate\"><span class=\"pre\">ll_CC</span></code>.\nExamples: <code class=\"docutils literal notranslate\"><span class=\"pre\">it</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">de_AT</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">es</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">pt_BR</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">sr_Latn</span></code>. The language\npart is always in lowercase. The country part is in titlecase if it has\nmore than 2 characters, otherwise it's in uppercase. The separator is an\nunderscore.</p>\n</dd>\n<dt id=\"term-language-code\">言語コード<a class=\"heading-anchor\" href=\"#term-language-code\"><span class=\"visually-hidden\">Link to this term</span><span aria-hidden=\"true\">#</span></a></dt><dd><p>言語名を表します。ブラウザは <code class=\"docutils literal notranslate\"><span class=\"pre\">Accept-Language</span></code> HTTPヘッダの中でこの表示形式を使って表示可能な言語名を通知します。 例えば <code class=\"docutils literal notranslate\"><span class=\"pre\">it</span></code>、 <code class=\"docutils literal notranslate\"><span class=\"pre\">de-at</span></code>、 <code class=\"docutils literal notranslate\"><span class=\"pre\">es</span></code>、 <code class=\"docutils literal notranslate\"><span class=\"pre\">pt-br</span></code> が該当します。言語コードは、一般的に小文字で表されますが、HTTP の <code class=\"docutils literal notranslate\"><span class=\"pre\">Accept-Language</span></code> ヘッダーは大文字・小文字を区別しません。区切り文字はダッシュ (-) です。</p>\n</dd>\n<dt id=\"term-message-file\">メッセージファイル<a class=\"heading-anchor\" href=\"#term-message-file\"><span class=\"visually-hidden\">Link to this term</span><span aria-hidden=\"true\">#</span></a></dt><dd><p>メッセージファイルは一つの言語を表すプレーンテキストファイルです。この中では、利用可能な全ての <a class=\"reference internal\" href=\"#term-translation-string\"><span class=\"xref std std-term\">翻訳文字列</span></a> と、それらがその言語でどのように表されるかが記述されます。ファイル拡張子は <code class=\"docutils literal notranslate\"><span class=\"pre\">.po</span></code> です。</p>\n</dd>\n<dt id=\"term-translation-string\">翻訳文字列<a class=\"heading-anchor\" href=\"#term-translation-string\"><span class=\"visually-hidden\">Link to this term</span><span aria-hidden=\"true\">#</span></a></dt><dd><p>翻訳可能なリテラル文字列です。</p>\n</dd>\n<dt id=\"term-format-file\">表示形式ファイル<a class=\"heading-anchor\" href=\"#term-format-file\"><span class=\"visually-hidden\">Link to this term</span><span aria-hidden=\"true\">#</span></a></dt><dd><p>書式設定ファイルは Python モジュールで、対象のロケールに対するデータの表示形式を定義します。</p>\n</dd>\n</dl>\n</section>","rootId":"internationalization-and-localization","toc":[{"title":"概要","anchor":"overview","children":[]},{"title":"定義","anchor":"definitions","children":[]}],"breadcrumbs":[{"docname":"topics/index","title":"Django を使う","url":"/ja/4.0/topics/"}],"prev":{"docname":"topics/email","title":"メールを送信する","url":"/ja/4.0/topics/email/"},"next":{"docname":"topics/i18n/translation","title":"翻訳","url":"/ja/4.0/topics/i18n/translation/"},"formats":{"html":"/ja/4.0/topics/i18n/","markdown":"/ja/4.0/topics/i18n.md","json":"/ja/4.0/topics/i18n.json"},"source":"https://github.com/django/django/blob/stable/4.0.x/docs/topics/i18n/index.txt","official":"https://docs.djangoproject.com/ja/4.0/topics/i18n/","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","1.11","1.10","1.9"],"inLocales":["en","zh-hans","fr","ja","id","it","pt-br","ko","es","el","pl"]}