mirror of
https://github.com/Hopiu/django-model-utils.git
synced 2026-03-16 20:00:23 +00:00
commit
d29f7b573e
7 changed files with 126 additions and 1 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -8,3 +8,4 @@ Django-*.egg
|
|||
htmlcov/
|
||||
docs/_build/
|
||||
.idea/
|
||||
*.mo
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ Michael van Tellingen <michaelvantellingen@gmail.com>
|
|||
Mikhail Silonov <silonov.pro>
|
||||
Patryk Zawadzki <patrys@room-303.com>
|
||||
Paul McLanahan <paul@mclanahan.net>
|
||||
Philipp Steinhardt <steinhardt@myvision.de>
|
||||
Rinat Shigapov <rinatshigapov@gmail.com>
|
||||
Rodney Folz <rodney@rodneyfolz.com>
|
||||
rsenkbeil <github.com/rsenkbeil>
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ master (unreleased)
|
|||
|
||||
* Fix Django 1.7 migrations compatibility for SplitField. Thanks ad-m. Merge of
|
||||
GH-157; fixes GH-156.
|
||||
|
||||
* Add German translations.
|
||||
|
||||
|
||||
2.2 (2014.07.31)
|
||||
|
|
|
|||
|
|
@ -22,11 +22,29 @@ When creating a pull request, try to:
|
|||
- Note important changes in the `CHANGES`_ file
|
||||
- Update the documentation if needed
|
||||
- Add yourself to the `AUTHORS`_ file
|
||||
- If you have added or changed translation strings, update translations
|
||||
of languages you are able to do so. Also mention that translations need
|
||||
to be updated in your pull request and commit message.
|
||||
|
||||
.. _AUTHORS: AUTHORS.rst
|
||||
.. _CHANGES: CHANGES.rst
|
||||
|
||||
|
||||
Translations
|
||||
------------
|
||||
|
||||
If you are able to provide translations for a new language or to update an
|
||||
existing translation file, make sure to run makemessages beforehand::
|
||||
|
||||
python django-admin.py makemessages -l ISO_LANGUAGE_CODE
|
||||
|
||||
This command will collect all translation strings from the source directory
|
||||
and create or update the translation file for the given language. Now open the
|
||||
translation file (.po) with a text-editor and start editing.
|
||||
After you finished editing add yourself to the list of translators.
|
||||
If you have created a new translation, make sure to copy the header from one
|
||||
of the existing translation files.
|
||||
|
||||
Testing
|
||||
-------
|
||||
|
||||
|
|
|
|||
|
|
@ -4,3 +4,4 @@ include LICENSE.txt
|
|||
include MANIFEST.in
|
||||
include README.rst
|
||||
include TODO.rst
|
||||
locale/*/LC_MESSAGES/django.po
|
||||
53
model_utils/locale/de/LC_MESSAGES/django.po
Normal file
53
model_utils/locale/de/LC_MESSAGES/django.po
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
# This file is distributed under the same license as the django-model-utils package.
|
||||
#
|
||||
# Translators:
|
||||
# Philipp Steinhardt <steinhardt@myvision.de>, 2015.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: django-model-utils\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2015-07-01 10:03+0200\n"
|
||||
"PO-Revision-Date: 2015-07-01 10:12+0200\n"
|
||||
"Language: de\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"Last-Translator: Philipp Steinhardt <steinhardt@myvision.de>\n"
|
||||
"Language-Team: \n"
|
||||
|
||||
#: .\models.py:20
|
||||
msgid "created"
|
||||
msgstr "erstellt"
|
||||
|
||||
#: .\models.py:21
|
||||
msgid "modified"
|
||||
msgstr "bearbeitet"
|
||||
|
||||
#: .\models.py:33
|
||||
msgid "start"
|
||||
msgstr "Beginn"
|
||||
|
||||
#: .\models.py:34
|
||||
msgid "end"
|
||||
msgstr "Ende"
|
||||
|
||||
#: .\models.py:49
|
||||
msgid "status"
|
||||
msgstr "Status"
|
||||
|
||||
#: .\models.py:50
|
||||
msgid "status changed"
|
||||
msgstr "Status geändert"
|
||||
|
||||
#: .\tests\models.py:106 .\tests\models.py:115 .\tests\models.py:124
|
||||
msgid "active"
|
||||
msgstr "aktiv"
|
||||
|
||||
#: .\tests\models.py:107 .\tests\models.py:116 .\tests\models.py:125
|
||||
msgid "deleted"
|
||||
msgstr "gelöscht"
|
||||
|
||||
#: .\tests\models.py:108 .\tests\models.py:117 .\tests\models.py:126
|
||||
msgid "on hold"
|
||||
msgstr "wartend"
|
||||
51
setup.py
51
setup.py
|
|
@ -1,5 +1,8 @@
|
|||
from os.path import join
|
||||
from setuptools import setup, find_packages
|
||||
from setuptools.command.install_lib import install_lib as _install_lib
|
||||
from distutils.command.build import build as _build
|
||||
from distutils.cmd import Command
|
||||
|
||||
|
||||
long_description = (open('README.rst').read() +
|
||||
|
|
@ -14,6 +17,46 @@ def get_version():
|
|||
return line.split('=')[1].strip().strip('"\'')
|
||||
|
||||
|
||||
class compile_translations(Command):
|
||||
"""command tries to compile messages via django compilemessages, does not
|
||||
interrupt setup if gettext is not installed"""
|
||||
|
||||
description = 'compile message catalogs to MO files via django compilemessages'
|
||||
user_options = []
|
||||
|
||||
def initialize_options(self):
|
||||
pass
|
||||
|
||||
def finalize_options(self):
|
||||
pass
|
||||
|
||||
def run(self):
|
||||
import os
|
||||
import sys
|
||||
|
||||
from django.core.management import execute_from_command_line, CommandError
|
||||
|
||||
curdir = os.getcwd()
|
||||
os.chdir(os.path.realpath('model_utils'))
|
||||
|
||||
try:
|
||||
execute_from_command_line(['django-admin', 'compilemessages'])
|
||||
except CommandError:
|
||||
# raised if gettext pkg is not installed
|
||||
pass
|
||||
finally:
|
||||
os.chdir(curdir)
|
||||
|
||||
|
||||
class build(_build):
|
||||
sub_commands = [('compile_translations', None)] + _build.sub_commands
|
||||
|
||||
|
||||
class install_lib(_install_lib):
|
||||
def run(self):
|
||||
self.run_command('compile_translations')
|
||||
_install_lib.run(self)
|
||||
|
||||
setup(
|
||||
name='django-model-utils',
|
||||
version=get_version(),
|
||||
|
|
@ -40,5 +83,11 @@ setup(
|
|||
],
|
||||
zip_safe=False,
|
||||
tests_require=["Django>=1.4.2"],
|
||||
test_suite='runtests.runtests'
|
||||
test_suite='runtests.runtests',
|
||||
setup_requires=['Django>=1.4.2'],
|
||||
package_data = {
|
||||
'model_utils': ['locale/*/LC_MESSAGES/django.po','locale/*/LC_MESSAGES/django.mo'],
|
||||
},
|
||||
cmdclass={'build': build, 'install_lib': install_lib,
|
||||
'compile_translations': compile_translations}
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue