Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
cbd936d0
Kaydet (Commit)
cbd936d0
authored
Eki 29, 2014
tarafından
Berker Peksag
Kaydeden (comit)
Tim Graham
Eki 30, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #18731 -- Added an example about customizing "makemessages" command.
Thanks claudp for the suggestion and review.
üst
aac594f6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
0 deletions
+41
-0
django-admin.txt
docs/ref/django-admin.txt
+5
-0
translation.txt
docs/topics/i18n/translation.txt
+36
-0
No files found.
docs/ref/django-admin.txt
Dosyayı görüntüle @
cbd936d0
...
...
@@ -666,6 +666,11 @@ Use the ``--keep-pot`` option to prevent Django from deleting the temporary
.pot files it generates before creating the .po file. This is useful for
debugging errors which may prevent the final language files from being created.
.. seealso::
See :ref:`customizing-makemessages` for instructions on how to customize
the keywords that :djadmin:`makemessages` passes to ``xgettext``.
makemigrations [<app_label>]
----------------------------
...
...
docs/topics/i18n/translation.txt
Dosyayı görüntüle @
cbd936d0
...
...
@@ -1455,6 +1455,42 @@ translation utilities with a ``gettext`` package if the command ``xgettext
--version`` entered at a Windows command prompt causes a popup window saying
"xgettext.exe has generated errors and will be closed by Windows".
.. _customizing-makemessages:
Customizing the ``makemessages`` command
----------------------------------------
.. highlightlang:: python
If you want to pass additional parameters to ``xgettext``, you need to create a
custom :djadmin:`makemessages` command and override its ``xgettext_options``
attribute::
from django.core.management.commands import makemessages
class Command(makemessages.Command):
xgettext_options = makemessages.Command.xgettext_options + ['--keyword=mytrans']
If you need more flexibility, you could also add a new argument to your custom
:djadmin:`makemessages` command::
from django.core.management.commands import makemessages
class Command(makemessages.Command):
def add_arguments(self, parser):
super(Command, self).add_arguments(parser)
parser.add_argument('--extra-keyword', dest='xgettext_keywords',
action='append')
def handle(self, *args, **options):
xgettext_keywords = options.pop('xgettext_keywords')
if xgettext_keywords:
self.xgettext_options = (
makemessages.Command.xgettext_options[:] +
['--keyword=%s' % kwd for kwd in xgettext_keywords]
)
super(Command, self).handle(*args, **options)
Miscellaneous
=============
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment