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
ce27fb19
Kaydet (Commit)
ce27fb19
authored
Ock 25, 2013
tarafından
Ramiro Morales
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Revert "Patch by Claude for #16084."
This reverts commit
2babab0b
.
üst
5b99d5a3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
20 additions
and
61 deletions
+20
-61
makemessages.py
django/core/management/commands/makemessages.py
+0
-0
django-admin.1
docs/man/django-admin.1
+1
-2
django-admin.txt
docs/ref/django-admin.txt
+2
-2
translation.txt
docs/topics/i18n/translation.txt
+16
-1
extraction.py
tests/regressiontests/i18n/commands/extraction.py
+0
-44
__init__.py
tests/regressiontests/i18n/commands/project_dir/__init__.py
+0
-3
models.py
...ontests/i18n/commands/project_dir/app_no_locale/models.py
+0
-4
models.py
...tests/i18n/commands/project_dir/app_with_locale/models.py
+0
-4
tests.py
tests/regressiontests/i18n/tests.py
+1
-1
No files found.
django/core/management/commands/makemessages.py
Dosyayı görüntüle @
ce27fb19
This diff is collapsed.
Click to expand it.
docs/man/django-admin.1
Dosyayı görüntüle @
ce27fb19
...
...
@@ -193,8 +193,7 @@ Ignore files or directories matching this glob-style pattern. Use multiple
times
to
ignore
more
(
makemessages
command
).
.
TP
.
I
\-\-
no
\-
default
\-
ignore
Don
't ignore the common private glob-style patterns '
CVS
', '
.*
', '
*~
' and '
*.
pyc
'
(makemessages command).
Don
't ignore the common private glob-style patterns '
CVS
', '
.*
' and '
*~
' (makemessages command).
.TP
.I \-\-no\-wrap
Don'
t
break
long
message
lines
into
several
lines
(
makemessages
command
).
...
...
docs/ref/django-admin.txt
Dosyayı görüntüle @
ce27fb19
...
...
@@ -472,7 +472,7 @@ Example usage::
Use the ``--ignore`` or ``-i`` option to ignore files or directories matching
the given :mod:`glob`-style pattern. Use multiple times to ignore more.
These patterns are used by default: ``'CVS'``, ``'.*'``, ``'*~'``
, ``'*.pyc'``
These patterns are used by default: ``'CVS'``, ``'.*'``, ``'*~'``
Example usage::
...
...
@@ -499,7 +499,7 @@ for technically skilled translators to understand each message's context.
.. versionadded:: 1.6
Use the ``--keep-pot`` option to prevent django from deleting the temporary
.pot file
s
it generates before creating the .po file. This is useful for
.pot file it generates before creating the .po file. This is useful for
debugging errors which may prevent the final language files from being created.
runfcgi [options]
...
...
docs/topics/i18n/translation.txt
Dosyayı görüntüle @
ce27fb19
...
...
@@ -1543,9 +1543,24 @@ All message file repositories are structured the same way. They are:
* ``$PYTHONPATH/django/conf/locale/<language>/LC_MESSAGES/django.(po|mo)``
To create message files, you use the :djadmin:`django-admin.py makemessages <makemessages>`
tool. And you use :djadmin:`django-admin.py compilemessages <compilemessages>`
tool. You only need to be in the same directory where the ``locale/`` directory
is located. And you use :djadmin:`django-admin.py compilemessages <compilemessages>`
to produce the binary ``.mo`` files that are used by ``gettext``.
You can also run :djadmin:`django-admin.py compilemessages
--settings=path.to.settings <compilemessages>` to make the compiler process all
the directories in your :setting:`LOCALE_PATHS` setting.
Finally, you should give some thought to the structure of your translation
files. If your applications need to be delivered to other users and will be used
in other projects, you might want to use app-specific translations. But using
app-specific translations and project-specific translations could produce weird
problems with :djadmin:`makemessages`: it will traverse all directories below
the current path and so might put message IDs into a unified, common message
file for the current project that are already in application message files.
The easiest way out is to store applications that are not part of the project
(and so carry their own translations) outside the project tree. That way,
:djadmin:`django-admin.py makemessages <makemessages>`, when ran on a project
level will only extract strings that are connected to your explicit project and
not strings that are distributed independently.
tests/regressiontests/i18n/commands/extraction.py
Dosyayı görüntüle @
ce27fb19
...
...
@@ -5,13 +5,10 @@ import os
import
re
import
shutil
from
django.conf
import
settings
from
django.core
import
management
from
django.test
import
SimpleTestCase
from
django.test.utils
import
override_settings
from
django.utils.encoding
import
force_text
from
django.utils._os
import
upath
from
django.utils
import
six
from
django.utils.six
import
StringIO
...
...
@@ -355,44 +352,3 @@ class MultipleLocaleExtractionTests(ExtractorTests):
management
.
call_command
(
'makemessages'
,
locale
=
'pt,de,ch'
,
verbosity
=
0
)
self
.
assertTrue
(
os
.
path
.
exists
(
self
.
PO_FILE_PT
))
self
.
assertTrue
(
os
.
path
.
exists
(
self
.
PO_FILE_DE
))
class
CustomLayoutExtractionTests
(
ExtractorTests
):
def
setUp
(
self
):
self
.
_cwd
=
os
.
getcwd
()
self
.
test_dir
=
os
.
path
.
join
(
os
.
path
.
dirname
(
upath
(
__file__
)),
'project_dir'
)
def
test_no_locale_raises
(
self
):
os
.
chdir
(
self
.
test_dir
)
with
six
.
assertRaisesRegex
(
self
,
management
.
CommandError
,
"Unable to find a locale path to store translations for file"
):
management
.
call_command
(
'makemessages'
,
locale
=
LOCALE
,
verbosity
=
0
)
@override_settings
(
LOCALE_PATHS
=
(
os
.
path
.
join
(
os
.
path
.
dirname
(
upath
(
__file__
)),
'project_dir/project_locale'
),)
)
def
test_project_locale_paths
(
self
):
"""
Test that:
* translations for app containing locale folder are stored in that folder
* translations outside of that app are in LOCALE_PATHS[0]
"""
os
.
chdir
(
self
.
test_dir
)
self
.
addCleanup
(
shutil
.
rmtree
,
os
.
path
.
join
(
settings
.
LOCALE_PATHS
[
0
],
LOCALE
))
self
.
addCleanup
(
shutil
.
rmtree
,
os
.
path
.
join
(
self
.
test_dir
,
'app_with_locale/locale'
,
LOCALE
))
management
.
call_command
(
'makemessages'
,
locale
=
LOCALE
,
verbosity
=
0
)
project_de_locale
=
os
.
path
.
join
(
self
.
test_dir
,
'project_locale/de/LC_MESSAGES/django.po'
,)
app_de_locale
=
os
.
path
.
join
(
self
.
test_dir
,
'app_with_locale/locale/de/LC_MESSAGES/django.po'
,)
self
.
assertTrue
(
os
.
path
.
exists
(
project_de_locale
))
self
.
assertTrue
(
os
.
path
.
exists
(
app_de_locale
))
with
open
(
project_de_locale
,
'r'
)
as
fp
:
po_contents
=
force_text
(
fp
.
read
())
self
.
assertMsgId
(
'This app has no locale directory'
,
po_contents
)
self
.
assertMsgId
(
'This is a project-level string'
,
po_contents
)
with
open
(
app_de_locale
,
'r'
)
as
fp
:
po_contents
=
force_text
(
fp
.
read
())
self
.
assertMsgId
(
'This app has a locale directory'
,
po_contents
)
tests/regressiontests/i18n/commands/project_dir/__init__.py
deleted
100644 → 0
Dosyayı görüntüle @
5b99d5a3
from
django.utils.translation
import
ugettext
as
_
string
=
_
(
"This is a project-level string"
)
tests/regressiontests/i18n/commands/project_dir/app_no_locale/models.py
deleted
100644 → 0
Dosyayı görüntüle @
5b99d5a3
from
django.utils.translation
import
ugettext
as
_
string
=
_
(
"This app has no locale directory"
)
tests/regressiontests/i18n/commands/project_dir/app_with_locale/models.py
deleted
100644 → 0
Dosyayı görüntüle @
5b99d5a3
from
django.utils.translation
import
ugettext
as
_
string
=
_
(
"This app has a locale directory"
)
tests/regressiontests/i18n/tests.py
Dosyayı görüntüle @
ce27fb19
...
...
@@ -33,7 +33,7 @@ if can_run_extraction_tests:
JavascriptExtractorTests
,
IgnoredExtractorTests
,
SymlinkExtractorTests
,
CopyPluralFormsExtractorTests
,
NoWrapExtractorTests
,
NoLocationExtractorTests
,
KeepPotFileExtractorTests
,
MultipleLocaleExtractionTests
,
CustomLayoutExtractionTests
)
MultipleLocaleExtractionTests
)
if
can_run_compilation_tests
:
from
.commands.compilation
import
(
PoFileTests
,
PoFileContentsTests
,
PercentRenderingTests
,
MultipleLocaleCompilationTests
)
...
...
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