Skip to content

Commit

Permalink
Merge pull request #111 from lburdzy/develop
Browse files Browse the repository at this point in the history
Added translations to export forms
  • Loading branch information
saxix committed Feb 13, 2017
2 parents ed1ea5b + c636c57 commit ceb66f2
Show file tree
Hide file tree
Showing 11 changed files with 575 additions and 215 deletions.
34 changes: 17 additions & 17 deletions src/adminactions/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from django.forms.models import ModelForm
from django.forms.widgets import SelectMultiple
from django.utils import formats
from django.utils.translation import ugettext_lazy as _

from .api import csv, delimiters, quotes

Expand Down Expand Up @@ -33,20 +34,21 @@ class CSVOptions(forms.Form):
widget=forms.HiddenInput({'class': 'select-across'}))
action = forms.CharField(label='', required=True, initial='', widget=forms.HiddenInput())

header = forms.BooleanField(required=False)
delimiter = forms.ChoiceField(choices=list(zip(delimiters, delimiters)), initial=',')
quotechar = forms.ChoiceField(choices=list(zip(quotes, quotes)), initial="'")
header = forms.BooleanField(label=_('Header'), required=False)
delimiter = forms.ChoiceField(label=_('Delimiter'), choices=list(zip(delimiters, delimiters)), initial=',')
quotechar = forms.ChoiceField(label=_('Quotechar'), choices=list(zip(quotes, quotes)), initial="'")
quoting = forms.ChoiceField(
choices=((csv.QUOTE_ALL, 'All'),
(csv.QUOTE_MINIMAL, 'Minimal'),
(csv.QUOTE_NONE, 'None'),
(csv.QUOTE_NONNUMERIC, 'Non Numeric')), initial=csv.QUOTE_ALL)
label=_('Quoting'),
choices=((csv.QUOTE_ALL, _('All')),
(csv.QUOTE_MINIMAL, _('Minimal')),
(csv.QUOTE_NONE, _('None')),
(csv.QUOTE_NONNUMERIC, _('Non Numeric'))), initial=csv.QUOTE_ALL)

escapechar = forms.ChoiceField(choices=(('', ''), ('\\', '\\')), required=False)
datetime_format = forms.CharField(initial=formats.get_format('DATETIME_FORMAT'))
date_format = forms.CharField(initial=formats.get_format('DATE_FORMAT'))
time_format = forms.CharField(initial=formats.get_format('TIME_FORMAT'))
columns = forms.MultipleChoiceField(widget=SelectMultiple(attrs={'size': 20}))
escapechar = forms.ChoiceField(label=_('Escapechar'), choices=(('', ''), ('\\', '\\')), required=False)
datetime_format = forms.CharField(label=_('Datetime format'), initial=formats.get_format('DATETIME_FORMAT'))
date_format = forms.CharField(label=_('Date format'), initial=formats.get_format('DATE_FORMAT'))
time_format = forms.CharField(label=_('Time format'), initial=formats.get_format('TIME_FORMAT'))
columns = forms.MultipleChoiceField(label=_('Columns'), widget=SelectMultiple(attrs={'size': 20}))


class XLSOptions(forms.Form):
Expand All @@ -55,8 +57,8 @@ class XLSOptions(forms.Form):
widget=forms.HiddenInput({'class': 'select-across'}))
action = forms.CharField(label='', required=True, initial='', widget=forms.HiddenInput())

header = forms.BooleanField(required=False)
use_display = forms.BooleanField(required=False)
header = forms.BooleanField(label=_('Header'), required=False)
use_display = forms.BooleanField(label=_('Use display'), required=False)
# delimiter = forms.ChoiceField(choices=zip(delimiters, delimiters), initial=',')
# quotechar = forms.ChoiceField(choices=zip(quotes, quotes), initial="'")
# quoting = forms.ChoiceField(
Expand All @@ -69,6 +71,4 @@ class XLSOptions(forms.Form):
# datetime_format = forms.CharField(initial=formats.get_format('DATETIME_FORMAT'))
# date_format = forms.CharField(initial=formats.get_format('DATE_FORMAT'))
# time_format = forms.CharField(initial=formats.get_format('TIME_FORMAT'))
columns = forms.MultipleChoiceField(widget=SelectMultiple(attrs={'size': 20}))

#
columns = forms.MultipleChoiceField(label=_('Columns'), widget=SelectMultiple(attrs={'size': 20}))
Binary file modified src/adminactions/locale/en/LC_MESSAGES/django.mo
Binary file not shown.
166 changes: 116 additions & 50 deletions src/adminactions/locale/en/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-12-29 10:54+0100\n"
"POT-Creation-Date: 2017-02-03 17:56+0700\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand All @@ -17,134 +17,200 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: export.py:30 export.py:212 export.py:289 merge.py:67
#, python-format
msgid "Sorry you do not have rights to execute this action (%s)"
#: src/adminactions/byrows_update.py:29 src/adminactions/export.py:47
#: src/adminactions/export.py:249 src/adminactions/export.py:331
#: src/adminactions/graph.py:49 src/adminactions/mass_update.py:247
#: src/adminactions/merge.py:82
msgid "Sorry you do not have rights to execute this action"
msgstr ""

#: src/adminactions/byrows_update.py:55
msgid "Updated record(s)"
msgstr ""

#: src/adminactions/byrows_update.py:89
msgid "By rows update"
msgstr ""

#: export.py:111 export.py:116
#: src/adminactions/export.py:142
msgid "Export as CSV"
msgstr ""

#: export.py:123 export.py:128
#: src/adminactions/export.py:158
msgid "Export as XLS"
msgstr ""

#: export.py:265
msgid "Export as Fixture"
#: src/adminactions/export.py:320
msgid "Export as fixture"
msgstr ""

#: export.py:278
msgid "Export as fixture"
#: src/adminactions/export.py:412
msgid "Export delete tree"
msgstr ""

#: export.py:351
msgid "Export Delete Tree"
#: src/adminactions/forms.py:37 src/adminactions/forms.py:60
msgid "Header"
msgstr ""

#: export.py:364
msgid "Export delete tree"
#: src/adminactions/forms.py:38
msgid "Delimiter"
msgstr ""

#: mass_update.py:209
msgid "Sorry you do not have rights to execute this action"
#: src/adminactions/forms.py:39
msgid "Quotechar"
msgstr ""

#: mass_update.py:276
#: src/adminactions/forms.py:41
msgid "Quoting"
msgstr ""

#: src/adminactions/forms.py:42
msgid "All"
msgstr ""

#: src/adminactions/forms.py:43
msgid "Minimal"
msgstr ""

#: src/adminactions/forms.py:44
msgid "None"
msgstr ""

#: src/adminactions/forms.py:45
msgid "Non Numeric"
msgstr ""

#: src/adminactions/forms.py:47
msgid "Escapechar"
msgstr ""

#: src/adminactions/forms.py:48
msgid "Datetime format"
msgstr ""

#: src/adminactions/forms.py:49
msgid "Date format"
msgstr ""

#: src/adminactions/forms.py:50
msgid "Time format"
msgstr ""

#: src/adminactions/forms.py:51 src/adminactions/forms.py:74
msgid "Columns"
msgstr ""

#: src/adminactions/forms.py:61
msgid "Use display"
msgstr ""

#: src/adminactions/graph.py:162
msgid "Graph selected records"
msgstr ""

#: src/adminactions/mass_update.py:231
#, python-format
msgid "Updated %s records"
msgstr ""

#: merge.py:26
#: src/adminactions/mass_update.py:371
msgid "Mass update"
msgstr ""

#: src/adminactions/merge.py:35
msgid "Dependencies"
msgstr ""

#: merge.py:27
#: src/adminactions/merge.py:36
msgid "Move"
msgstr ""

#: merge.py:27
#: src/adminactions/merge.py:36
msgid "Delete"
msgstr ""

#: merge.py:136
#: src/adminactions/merge.py:167
msgid "Please select exactly 2 records"
msgstr ""

#: merge.py:159
#: src/adminactions/merge.py:199
#, python-format
msgid "Merge selected %(verbose_name_plural)s"
msgstr ""

#: templates/adminactions/any_model.html:26
#: templates/adminactions/charts.html:18
#: templates/adminactions/export_csv.html:46
#: templates/adminactions/export_fixture.html:6
#: templates/adminactions/export_xls.html:19
#: templates/adminactions/mass_update.html:26
#: templates/adminactions/merge.html:5
#: templates/adminactions/merge_preview.html:5
#: src/adminactions/templates/adminactions/any_model.html:26
#: src/adminactions/templates/adminactions/byrows_update.html:20
#: src/adminactions/templates/adminactions/charts.html:18
#: src/adminactions/templates/adminactions/export_csv.html:46
#: src/adminactions/templates/adminactions/export_fixture.html:6
#: src/adminactions/templates/adminactions/export_xls.html:19
#: src/adminactions/templates/adminactions/mass_update.html:26
#: src/adminactions/templates/adminactions/merge.html:5
#: src/adminactions/templates/adminactions/merge_preview.html:5
msgid "Home"
msgstr ""

#: templates/adminactions/export_csv.html:50
msgid "CSV Export Options"
#: src/adminactions/templates/adminactions/byrows_update.html:30
msgid "Please correct the error below."
msgstr ""

#: templates/adminactions/export_csv.html:69
msgid "Export"
#: src/adminactions/templates/adminactions/byrows_update.html:30
msgid "Please correct the errors below."
msgstr ""

#: templates/adminactions/merge.html:8
#: templates/adminactions/merge_preview.html:8
msgid "Merge records"
#: src/adminactions/templates/adminactions/export_csv.html:69
msgid "Export"
msgstr ""

#: templates/adminactions/merge.html:34
#: src/adminactions/templates/adminactions/merge.html:35
msgid "Field"
msgstr ""

#: templates/adminactions/merge.html:35
#: src/adminactions/templates/adminactions/merge.html:36
msgid "Master"
msgstr ""

#: templates/adminactions/merge.html:35
#: src/adminactions/templates/adminactions/merge.html:36
msgid "This will be preserved"
msgstr ""

#: templates/adminactions/merge.html:37
#: src/adminactions/templates/adminactions/merge.html:38
msgid "swap"
msgstr ""

#: templates/adminactions/merge.html:38
#: src/adminactions/templates/adminactions/merge.html:39
msgid "Result"
msgstr ""

#: templates/adminactions/merge.html:40
#: src/adminactions/templates/adminactions/merge.html:41
msgid "Other"
msgstr ""

#: templates/adminactions/merge.html:40
#: src/adminactions/templates/adminactions/merge.html:41
msgid "This will be removed"
msgstr ""

#: templates/adminactions/merge.html:69
#: templates/adminactions/merge_preview.html:9
#: src/adminactions/templates/adminactions/merge.html:70
#: src/adminactions/templates/adminactions/merge_preview.html:9
msgid "Preview"
msgstr ""

#: templates/adminactions/merge_preview.html:18
#: src/adminactions/templates/adminactions/merge_preview.html:8
msgid "Merge records"
msgstr ""

#: src/adminactions/templates/adminactions/merge_preview.html:18
msgid "Key"
msgstr ""

#: templates/adminactions/merge_preview.html:23
#: src/adminactions/templates/adminactions/merge_preview.html:23
msgid "Original"
msgstr ""

#: templates/adminactions/merge_preview.html:24
#: src/adminactions/templates/adminactions/merge_preview.html:24
msgid "After Merging"
msgstr ""

#: templates/adminactions/merge_preview.html:39
#: src/adminactions/templates/adminactions/merge_preview.html:39
msgid "Merge"
msgstr ""
Binary file modified src/adminactions/locale/es/LC_MESSAGES/django.mo
Binary file not shown.

0 comments on commit ceb66f2

Please sign in to comment.