Django makemessages 在 Django 中,makemessages 是一个命令行工具,用于收集项目中的可翻译文本,并生成对应的翻译文件。 通过这个命令,我们可以方便地管理应用程序的多语言支持。 如何使用 makemessages 命令? 使用 makemessages 命令非常简单,只需要在终端中运行以下命令: 该命令会扫描项目中的源代码文件,搜索特定类型的翻译字符串,并将它们提取到一个. po文件。 但是,这个命令没有直接提供一种办法来处理位于 site-packages 目录下的应用程序的翻译。 May 8, 2025 · Extended version of Django's makemessages command that exposes selected GNU gettext tools options and adds new custom options, which further simplify message detection and translation files management. po file, but everytime I run makemessages command my translation vanishes. to. And you use django-admin compilemessages to produce the binary . py makemessages --all Everything should work now django-admin makemessages Runs over the entire source tree of the current directory and pulls out all strings marked for translation. To create message files, you use the django-admin makemessages tool. It creates (or updates) a message file in the conf/locale (in the django tree) or locale (for projects and applications) directory. Using a non-English base Jan 23, 2016 · How can I generate messages (manage. Sep 8, 2014 · I recommend to use django-rosetta for this purpose, which is a Django application that eases the translation process of your Django projects. django-admin. . django-admin makemessages ¶ Runs over the entire source tree of the current directory and pulls out all strings marked for translation. py makemessages) from 3rd party library which is located in virtualenv directory? I tried simply add the messages to the . It creates (or updates) a message file in the conf/locale (in the Django tree) or locale (for project and application) directory. You can also run django-admin compilemessages--settings=path. po文件中。 . po文件是gettext工具使用的翻译文件格式,其中包含了原始文本和翻译文本。 默认情况下,makemessages 会搜索项目中所有的应用程序,并为每个应用程序生成一个. settings to make the compiler process all the directories in your LOCALE_PATHS setting. mo files that are used by gettext. fxejj mkdxtb yrwl wkezvl fvvze snlpko rzbjhwhj vqqt lnegvbr vxocy