Permalink
Browse files

add message compilation hair; add sequence i18n app; regen pot and po…

… files
  • Loading branch information...
1 parent 50bf35a commit 355b069256e0e15054983c49cf0870ec5a025160 @mcdonc mcdonc committed Aug 5, 2011
@@ -477,6 +477,32 @@ class Schema(colander.Schema):
form = deform.Form(schema, buttons=('submit',))
return self.render_form(form)
+ @view_config(renderer='templates/translated_form.pt',
+ name='sequence_of_i18n')
+ @demonstrate('Sequence of I18N')
+ def sequence_of_i18n(self):
+ import datetime
+ from colander import Range
+ locale_name = get_locale_name(self.request)
+ class Sequence(colander.SequenceSchema):
+ date = colander.SchemaNode(
+ colander.Date(),
+ validator=Range(
+ min=datetime.date(2010, 5, 5),
+ min_err=_('${val} is earlier than earliest date ${min}')
+ )
+ )
+ class Schema(colander.Schema):
+ dates = Sequence()
+ _LOCALE_ = colander.SchemaNode(
+ colander.String(),
+ widget = deform.widget.HiddenWidget(),
+ default=locale_name)
+ schema = Schema()
+ form = deform.Form(schema,
+ buttons=[deform.Button('submit', _('Submit'))])
+ return self.render_form(form)
+
@view_config(renderer='templates/form.pt', name='sequence_of_richtext')
@demonstrate('Sequence of Rich Text Widgets')
def sequence_of_richtext(self):
@@ -7,25 +7,46 @@ msgid ""
msgstr ""
"Project-Id-Version: deformsite 0.0\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2010-04-22 14:17+0400\n"
+"POT-Creation-Date: 2011-08-05 06:44-0400\n"
"PO-Revision-Date: 2010-09-11 01:20+0100\n"
"Last-Translator: Charlie Clark <charlie@begeistert.org>\n"
"Language-Team: de <LL@li.org>\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Generated-By: Babel 0.9.5\n"
+"Generated-By: Babel 0.9.6\n"
-#: deformsite/__init__.py:458
-msgid "Approve"
-msgstr "Genehmigen"
-
-#: deformsite/__init__.py:459
-msgid "Show approval"
-msgstr "Genehmigung zeigen"
+#: deformdemo/__init__.py:471 deformdemo/__init__.py:492
+#: deformdemo/__init__.py:680 deformdemo/__init__.py:697
+msgid "${val} is earlier than earliest date ${min}"
+msgstr ""
-#: deformsite/__init__.py:466
+#: deformdemo/__init__.py:503 deformdemo/__init__.py:953
msgid "Submit"
msgstr "Abschicken"
+#: deformdemo/__init__.py:715
+msgid "${val} is earlier than earliest time ${min}"
+msgstr ""
+
+#: deformdemo/__init__.py:734
+msgid "${val} is earlier than earliest datetime ${min}"
+msgstr ""
+
+#: deformdemo/__init__.py:939 deformdemo/__init__.py:941
+msgid "A number between ${min} and ${max}"
+msgstr ""
+
+#: deformdemo/__init__.py:1062 deformdemo/__init__.py:1065
+#: deformdemo/__init__.py:1068 deformdemo/__init__.py:1083
+#: deformdemo/__init__.py:1086 deformdemo/__init__.py:1089
+msgid "Error ${num}"
+msgstr ""
+
+#~ msgid "Approve"
+#~ msgstr "Genehmigen"
+
+#~ msgid "Show approval"
+#~ msgstr "Genehmigung zeigen"
+
@@ -1,25 +1,46 @@
-# Translations template for deform demo.
-# Copyright (C) 2010 ORGANIZATION
-# This file is distributed under the same license as the deformsite project.
-# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
+# Translations template for deformdemo.
+# Copyright (C) 2011 ORGANIZATION
+# This file is distributed under the same license as the deformdemo project.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
#
#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: deformsite 0.0\n"
+"Project-Id-Version: deformdemo 0.0\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2010-04-25 19:14-0400\n"
+"POT-Creation-Date: 2011-08-05 06:44-0400\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"
-"Generated-By: Babel 0.9.5\n"
+"Generated-By: Babel 0.9.6\n"
-msgid "A number between ${min} and ${max}"
+#: deformdemo/__init__.py:471 deformdemo/__init__.py:492 deformdemo/__init__.py:680
+#: deformdemo/__init__.py:697
+msgid "${val} is earlier than earliest date ${min}"
msgstr ""
+#: deformdemo/__init__.py:503 deformdemo/__init__.py:953
msgid "Submit"
msgstr ""
+#: deformdemo/__init__.py:715
+msgid "${val} is earlier than earliest time ${min}"
+msgstr ""
+
+#: deformdemo/__init__.py:734
+msgid "${val} is earlier than earliest datetime ${min}"
+msgstr ""
+
+#: deformdemo/__init__.py:939 deformdemo/__init__.py:941
+msgid "A number between ${min} and ${max}"
+msgstr ""
+
+#: deformdemo/__init__.py:1062 deformdemo/__init__.py:1065
+#: deformdemo/__init__.py:1068 deformdemo/__init__.py:1083
+#: deformdemo/__init__.py:1086 deformdemo/__init__.py:1089
+msgid "Error ${num}"
+msgstr ""
+
@@ -1,4 +1,4 @@
-# Translations template for deform demo.
+# Spanish translations for deform demo.
# Copyright (C) 2010 ORGANIZATION
# This file is distributed under the same license as the deformsite project.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
@@ -7,18 +7,40 @@ msgid ""
msgstr ""
"Project-Id-Version: deformsite 0.0\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2010-04-25 19:14-0400\n"
+"POT-Creation-Date: 2011-08-05 06:44-0400\n"
"PO-Revision-Date: 2010-09-09 13:53-0600\n"
"Last-Translator: Douglas Cerna <douglascerna@yahoo.com>\n"
-"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language-Team: es <LL@li.org>\n"
+"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Generated-By: Babel 0.9.5\n"
+"Generated-By: Babel 0.9.6\n"
-msgid "A number between ${min} and ${max}"
-msgstr "Un número entre ${min} y ${max}"
+#: deformdemo/__init__.py:471 deformdemo/__init__.py:492
+#: deformdemo/__init__.py:680 deformdemo/__init__.py:697
+msgid "${val} is earlier than earliest date ${min}"
+msgstr ""
+#: deformdemo/__init__.py:503 deformdemo/__init__.py:953
msgid "Submit"
msgstr "Enviar"
+#: deformdemo/__init__.py:715
+msgid "${val} is earlier than earliest time ${min}"
+msgstr ""
+
+#: deformdemo/__init__.py:734
+msgid "${val} is earlier than earliest datetime ${min}"
+msgstr ""
+
+#: deformdemo/__init__.py:939 deformdemo/__init__.py:941
+msgid "A number between ${min} and ${max}"
+msgstr "Un número entre ${min} y ${max}"
+
+#: deformdemo/__init__.py:1062 deformdemo/__init__.py:1065
+#: deformdemo/__init__.py:1068 deformdemo/__init__.py:1083
+#: deformdemo/__init__.py:1086 deformdemo/__init__.py:1089
+msgid "Error ${num}"
+msgstr ""
+
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: deformsite 0.0\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2010-04-25 19:14+0400\n"
+"POT-Creation-Date: 2011-08-05 06:44-0400\n"
"PO-Revision-Date: 2010-04-25 19:14-0400\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: ru <LL@li.org>\n"
@@ -16,13 +16,32 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Generated-By: Babel 0.9.5\n"
+"Generated-By: Babel 0.9.6\n"
-#: deformsite/__init__.py:457 deformsite/__init__.py:458
-msgid "A number between ${min} and ${max}"
-msgstr "Число между ${min} и ${max}"
+#: deformdemo/__init__.py:471 deformdemo/__init__.py:492
+#: deformdemo/__init__.py:680 deformdemo/__init__.py:697
+msgid "${val} is earlier than earliest date ${min}"
+msgstr ""
-#: deformsite/__init__.py:467
+#: deformdemo/__init__.py:503 deformdemo/__init__.py:953
msgid "Submit"
msgstr "отправить"
+#: deformdemo/__init__.py:715
+msgid "${val} is earlier than earliest time ${min}"
+msgstr ""
+
+#: deformdemo/__init__.py:734
+msgid "${val} is earlier than earliest datetime ${min}"
+msgstr ""
+
+#: deformdemo/__init__.py:939 deformdemo/__init__.py:941
+msgid "A number between ${min} and ${max}"
+msgstr "Число между ${min} и ${max}"
+
+#: deformdemo/__init__.py:1062 deformdemo/__init__.py:1065
+#: deformdemo/__init__.py:1068 deformdemo/__init__.py:1083
+#: deformdemo/__init__.py:1086 deformdemo/__init__.py:1089
+msgid "Error ${num}"
+msgstr ""
+
Binary file not shown.
@@ -1,18 +0,0 @@
-msgid ""
-msgstr ""
-"Project-Id-Version: deformdemo 0.6\n"
-"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2010-04-25 19:14-0400\n"
-"PO-Revision-Date: \n"
-"Last-Translator: Tres Seaver <tseaver@palladion.com>\n"
-"Language-Team: repoze developers <repoze-dev@lists.repoze.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-msgid "A number between ${min} and ${max}"
-msgstr "Pick a number between ${min} and ${max}, dammit!"
-
-msgid "Submit"
-msgstr "Send in the damned form!"
-
View
@@ -1,2 +1,23 @@
[easy_install]
zip_ok = false
+
+[compile_catalog]
+directory = deformdemo/locale
+domain = deform
+statistics = true
+
+[extract_messages]
+add_comments = TRANSLATORS:
+output_file = deformdemo/locale/deform.pot
+width = 80
+
+[init_catalog]
+domain = deformdemo
+input_file = deformdemo/locale/deform.pot
+output_dir = deformdemo/locale
+
+[update_catalog]
+domain = deform
+input_file = deformdemo/locale/deform.pot
+output_dir = deformdemo/locale
+previous = true
View
@@ -29,7 +29,8 @@
requires = ['deform',
'pyramid',
'pygments',
- 'Babel']
+ 'Babel',
+ 'lingua']
setupkw = dict(
name='deformdemo',
@@ -53,6 +54,10 @@
[paste.app_factory]
demo = deformdemo:main
""",
+ message_extractors = { '.': [
+ ('**.py', 'lingua_python', None ),
+ ('**.pt', 'lingua_xml', None ),
+ ]},
)
setup(**setupkw)

0 comments on commit 355b069

Please sign in to comment.