Skip to content

Commit

Permalink
locales
Browse files Browse the repository at this point in the history
  • Loading branch information
mamico committed Nov 11, 2024
1 parent 4fb9c2b commit a8b0140
Show file tree
Hide file tree
Showing 6 changed files with 122 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ report.html
reports/
venv/
# excludes
.python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#--- PLEASE EDIT THE LINES BELOW CORRECTLY ---
#SOME DESCRIPTIVE TITLE.
#FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2024-11-11 15:20+0000\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"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0\n"
"Language-Code: en\n"
"Language-Name: English\n"
"Preferred-Encodings: utf-8 latin1\n"
"Domain: collective.formsupport.counter\n"

#: ../adapters/post.py:50
#: ../restapi/services/form_data/csv.py:12
msgid "Form counter"
msgstr ""

#: ../configure.zcml:32
msgid "Installs the collective.formsupport.counter add-on."
msgstr ""

#: ../configure.zcml:41
msgid "Uninstalls the collective.formsupport.counter add-on."
msgstr ""

#: ../configure.zcml:32
msgid "collective.formsupport.counter"
msgstr ""

#: ../configure.zcml:41
msgid "collective.formsupport.counter (uninstall)"
msgstr ""
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2024-11-11 15:20+0000\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"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0\n"
"Language-Code: en\n"
"Language-Name: English\n"
"Preferred-Encodings: utf-8 latin1\n"
"Domain: DOMAIN\n"

#: ../adapters/post.py:50
#: ../restapi/services/form_data/csv.py:12
msgid "Form counter"
msgstr ""

#: ../configure.zcml:32
msgid "Installs the collective.formsupport.counter add-on."
msgstr ""

#: ../configure.zcml:41
msgid "Uninstalls the collective.formsupport.counter add-on."
msgstr ""

#: ../configure.zcml:32
msgid "collective.formsupport.counter"
msgstr ""

#: ../configure.zcml:41
msgid "collective.formsupport.counter (uninstall)"
msgstr ""
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2024-11-11 15:20+0000\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"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0\n"
"Language-Code: it\n"
"Language-Name: Italian\n"
"Preferred-Encodings: utf-8 latin1\n"
"Domain: DOMAIN\n"

#: ../adapters/post.py:50
#: ../restapi/services/form_data/csv.py:12
msgid "Form counter"
msgstr "Progressivo"

#: ../configure.zcml:32
msgid "Installs the collective.formsupport.counter add-on."
msgstr ""

#: ../configure.zcml:41
msgid "Uninstalls the collective.formsupport.counter add-on."
msgstr ""

#: ../configure.zcml:32
msgid "collective.formsupport.counter"
msgstr ""

#: ../configure.zcml:41
msgid "collective.formsupport.counter (uninstall)"
msgstr ""
4 changes: 2 additions & 2 deletions src/collective/formsupport/counter/locales/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@

domain=collective.formsupport.counter

i18ndude rebuild-pot --pot $domain.pot --create $domain ../
i18ndude sync --pot $domain.pot */LC_MESSAGES/$domain.po
pipx run i18ndude rebuild-pot --pot $domain.pot --create $domain ../
pipx run i18ndude sync --pot $domain.pot */LC_MESSAGES/$domain.po
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
from collective.formsupport.counter import _
from collective.formsupport.counter.config import COUNTER_BLOCKS_FIELD_ID
from collective.formsupport.counter.config import COUNTER_ENABLED_FORM_FLAG_NAME
from collective.volto.formsupport.restapi.services.form_data.csv import (
FormDataExportGet,
)
from collective.volto.formsupport.restapi.services.form_data.csv import FormDataExportGet
from collective.volto.formsupport.restapi.services.form_data.csv import SKIP_ATTRS
from zope.i18n import translate


class FormDataExportGetCounter(FormDataExportGet):
def get_fields_labels(self, item):
fields_labels = super().get_fields_labels(item)
fields_labels[COUNTER_BLOCKS_FIELD_ID] = translate(_("Form counter"), context=self.request)
return fields_labels

def get_ordered_keys(self, record):
"""
We need this method because we want to maintain the fields order set in the form.
Expand Down

0 comments on commit a8b0140

Please sign in to comment.