... が簡単になります。翻訳者がメッセージファイルの中身を書き終わったら、それをコンパイルしなければなりません。このプロセスは GNU gettext ツー ルキットに依存しています。 これが済めば、 Django はユーザの言語設定に従って、オンザフライでアプリケーションを利用可能 ... はどうやって言語の優先順位を検出するのか? を参照してください。 Python コードでの国際化 標準的な翻訳 翻訳対象の文字列を関数 gettext() で指定します。入力の手間を省くため、この関数は短い別名 _ としてインポートするのが慣例です。 注釈 Python の標準ライブラリ ... gettext モジュールは、グローバルの名前空間に _() という名前で gettext() をインストールします。 Django ではこの方法に従っていません ... ... aluated django.utils.csp.LazyNonce instance ( #36810 ). Fixed a regression in Django 6.0 where path() routes defined using gettext_lazy() failed to resolve correctly ( #36796 ). Fixed a regression in Django 6.0 where the Widget.use_fieldset attribute of ... ... e = "article-section" ), path ( "blog/" , include ( "blog.urls" )), ... , ] route The route argument should be a string or gettext_lazy() (see URL パターンを翻訳する ) that contains a URL pattern. The string may contain angle brackets (like <username> a ... . bio , name = "bio" ), re_path ( r "^blog/" , include ( "blog.urls" )), ... , ] The route argument should be a string or gettext_lazy() (see URL パターンを翻訳する ) that contains a regular expression compatible with Python's re module. Strings typica ... ... data loss possibility with Prefetch if to_attr is set to a ManyToManyField ( #25693 ). Fixed a regression in 1.8 by making gettext() once again return UTF-8 bytestrings on Python 2 if the input is a bytestring ( #25720 ). Fixed serialization of DateRang ... ... that they're aliases for: urllib.parse.quote() , quote_plus() , unquote() , and unquote_plus() . django.utils.translation.ugettext() , ugettext_lazy() , ugettext_noop() , ungettext() , and ungettext_lazy() are deprecated in favor of the functions that t ... hey're aliases for: django.utils.translation.gettext() , gettext_lazy() , gettext_noop() , ngettext() , and ngettext_lazy() . To limit creation of sessions and hence favor som ... ... textual markers and comments for translatable strings For translation strings with ambiguous meaning, you can now use the pgettext function to specify the context of the string. And if you just want to add some information for translators, you can also ... the different translations found on disk, namely: For translatable literals found in Python code and templates ( 'django' gettext domain): Priorities of translations included with applications listed in the INSTALLED_APPS setting were changed. To provi ... orresponding deprecated features section of this document. For translatable literals found in JavaScript code ( 'djangojs' gettext domain): Similarly to the 'django' domain translations: Overriding of translations shipped with applications by using the ... ... リケーション設定やモデルモジュールのインポートが、アプリレジストリに依存するコードをトリガした場合に発生します。 たとえば、 gettext() はアプリケーションの翻訳カタログを検索するためにアプリレジストリを使います。インポート時に翻訳するには、代わりに gettext ... _lazy() が必要です。( gettext() を使うと、アクティブな言語に応じてリクエストごとに翻訳が行われるのではなく、インポート時に翻訳が行われるのでバグになりま ... ... 数は、フォーマットされる文字列です。例えば: from django.utils.text import format_lazy from django.utils.translation import pgettext_lazy urlpatterns = [ path ( format_lazy ( " {person} /<int:pk>/" , person = pgettext_lazy ( "URL" , "person" )), PersonDet ... トタイムゾーン に設定されます。 django.utils.translation 以下の使い方の完全な説明は、 翻訳ドキュメント を参照してください。 gettext ( message ) [ソース] message を翻訳し、文字列として返します。 pgettext ( context , message ) [ソース] context を考慮して m ... essage を翻訳し、文字列として返します。 詳しくは 文脈マーカー を参照してください。 gettext_lazy ( message ) pgettext_lazy ( context , message ) 上述の lazy ではないものと同じですが、遅延処理を使用します。 遅延翻訳 ... ... nja2 2.11+ numpy 1.26.0+ Pillow 10.1.0+ PyYAML 6.0.2+ pywatchman redis 5.1.0+ pymemcache , plus a supported Python binding gettext ( Windows での gettext ) selenium 4.23.0+ sqlparse 0.5.0+ (required) tblib 3.0.0+ You can find these dependencies in pip r ... ... 述することです。通常、翻訳者によって行われます。 より詳しくは、 W3C Web Internationalization FAQ 、 Wikipedia article 、 GNU gettext documentation をご覧ください。 警告 翻訳は USE_I18N 設定によって制御されます。しかし、これは国際化とローカライズを含んでい ... 2026年10月08日