Skip to content

Commit

Permalink
Fixed #51 -- Fixed validation msg and added DE translation
Browse files Browse the repository at this point in the history
  • Loading branch information
codingjoe committed Aug 6, 2015
1 parent 53a4313 commit 8ad5e2f
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*.pyc
*.mo
django_stdimage.egg-info
build/
dist/
Expand Down
13 changes: 12 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from setuptools import setup, Command, find_packages
import sys


class PyTest(Command):
Expand All @@ -20,9 +22,18 @@ def run(self):
raise SystemExit(errno)


if 'sdist' in sys.argv or 'develop' in sys.argv:
try:
os.chdir('stdimage')
from django.core import management
management.call_command('compilemessages')
finally:
os.chdir('..')


setup(
name='django-stdimage',
version='2.0.2',
version='2.0.3',
description='Django Standarized Image Field',
author='codingjoe',
url='https://github.com/codingjoe/django-stdimage',
Expand Down
37 changes: 37 additions & 0 deletions stdimage/locale/de/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-08-06 12:13+0200\n"
"PO-Revision-Date: 2015-08-06 12:15+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: \n"
"Language-Team: \n"
"X-Generator: Poedit 1.8.3\n"

#: validators.py:48
#, python-format
msgid ""
"The image you uploaded is too large. The required maximum resolution is: "
"%(with)sx%(height)s px."
msgstr ""
"Das hochgeladene Bild ist zu groß. Die maximale erlaube Größe ist: "
"%(with)sx%(height)s px."

#: validators.py:64
#, python-format
msgid ""
"The image you uploaded is too small. The required minimum resolution is: "
"%(with)sx%(height)s px."
msgstr ""
"Das hochgeladene Bild ist zu klein. Die minimale erlaube Größe ist: "
"%(with)sx%(height)s px."
4 changes: 2 additions & 2 deletions stdimage/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class MaxSizeValidator(BaseSizeValidator):
compare = lambda self, img_size, max_size:\
img_size[0] > max_size[0] or img_size[1] > max_size[1]
message = _('The image you uploaded is too large.'
' The required minimal resolution is:'
' The required maximum resolution is:'
' %(with)sx%(height)s px.')
code = 'max_resolution'

Expand All @@ -62,5 +62,5 @@ class MinSizeValidator(BaseSizeValidator):
compare = lambda self, img_size, min_size:\
img_size[0] < min_size[0] or img_size[1] < min_size[1]
message = _('The image you uploaded is too small.'
' The required minimal resolution is:'
' The required minimum resolution is:'
' %(with)sx%(height)s px.')

0 comments on commit 8ad5e2f

Please sign in to comment.