Added months translation mapping ZTK-1.1
authorThierry Florac <tflorac@ulthar.net>
Wed, 24 Jan 2024 14:41:56 +0100
branchZTK-1.1
changeset 287 e72a0ac7b1b9
parent 286 5b6eccca3541
child 288 c2aa64a7a694
Added months translation mapping
src/ztfy.utils.egg-info/PKG-INFO
src/ztfy/utils/date.py
src/ztfy/utils/locales/en/LC_MESSAGES/ztfy.utils.mo
src/ztfy/utils/locales/en/LC_MESSAGES/ztfy.utils.po
src/ztfy/utils/locales/fr/LC_MESSAGES/ztfy.utils.mo
src/ztfy/utils/locales/fr/LC_MESSAGES/ztfy.utils.po
src/ztfy/utils/locales/ztfy.utils.pot
--- a/src/ztfy.utils.egg-info/PKG-INFO	Wed Jan 24 13:56:03 2024 +0100
+++ b/src/ztfy.utils.egg-info/PKG-INFO	Wed Jan 24 14:41:56 2024 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: ztfy.utils
-Version: 0.4.18
+Version: 0.4.19
 Summary: ZTFY utility functions and classes for Zope3
 Home-page: http://www.ztfy.org
 Author: Thierry Florac
@@ -41,6 +41,10 @@
         Changelog
         =========
         
+        0.4.19
+        ------
+         - updated dates formatting
+        
         0.4.18
         ------
          - updated XML-RPC error status check
--- a/src/ztfy/utils/date.py	Wed Jan 24 13:56:03 2024 +0100
+++ b/src/ztfy/utils/date.py	Wed Jan 24 14:41:56 2024 +0100
@@ -32,6 +32,22 @@
 from ztfy.utils import _
 
 
+MONTHS = {
+     1: _("january"),
+     2: _("february"),
+     3: _("march"),
+     4: _("april"),
+     5: _("may"),
+     6: _("june"),
+     7: _("july"),
+     8: _("august"),
+     9: _("september"),
+    10: _("october"),
+    11: _("november"),
+    12: _("december")
+}
+
+
 def unidate(value):
     """Get specified date converted to unicode ISO format
     
@@ -93,6 +109,7 @@
                                  translate(format, context=request).encode('utf-8')).decode('utf-8')
     else:
         return format.replace('%d', str(value.day)) \
+                     .replace('%B', translate(MONTHS[value.month])) \
                      .replace('%m', str(value.month)) \
                      .replace('%Y', str(value.year))
 
Binary file src/ztfy/utils/locales/en/LC_MESSAGES/ztfy.utils.mo has changed
--- a/src/ztfy/utils/locales/en/LC_MESSAGES/ztfy.utils.po	Wed Jan 24 13:56:03 2024 +0100
+++ b/src/ztfy/utils/locales/en/LC_MESSAGES/ztfy.utils.po	Wed Jan 24 14:41:56 2024 +0100
@@ -14,7 +14,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: ZTFY.utils\n"
-"POT-Creation-Date: Sat Jan 15 00:17:16 2022\n"
+"POT-Creation-Date: Wed Jan 24 14:38:53 2024\n"
 "PO-Revision-Date: 2009-08-14 18:14+0200\n"
 "Last-Translator: Thierry Florac <tflorac@ulthar.net>\n"
 "Language-Team: French <traduc@traduc.org>\n"
@@ -33,79 +33,127 @@
 msgid "ZEO connection properties"
 msgstr ""
 
-#: ztfy/utils/date.py:112
+#: ztfy/utils/date.py:132
 msgid "%d months ago"
 msgstr ""
 
-#: ztfy/utils/date.py:114
+#: ztfy/utils/date.py:134
 msgid "%d weeks ago"
 msgstr ""
 
-#: ztfy/utils/date.py:116
+#: ztfy/utils/date.py:136
 msgid "%d days ago"
 msgstr ""
 
-#: ztfy/utils/date.py:118
+#: ztfy/utils/date.py:138
 msgid "the day before yesterday"
 msgstr ""
 
-#: ztfy/utils/date.py:120
+#: ztfy/utils/date.py:140
 msgid "yesterday"
 msgstr ""
 
-#: ztfy/utils/date.py:124
+#: ztfy/utils/date.py:144
 msgid "%d hours ago"
 msgstr ""
 
-#: ztfy/utils/date.py:126
+#: ztfy/utils/date.py:146
 msgid "%d minutes ago"
 msgstr ""
 
-#: ztfy/utils/date.py:128
+#: ztfy/utils/date.py:148
 msgid "less than 5 minutes ago"
 msgstr ""
 
-#: ztfy/utils/date.py:139
+#: ztfy/utils/date.py:159
 msgid "%d months"
 msgstr ""
 
-#: ztfy/utils/date.py:141
+#: ztfy/utils/date.py:161
 msgid "%d weeks"
 msgstr ""
 
-#: ztfy/utils/date.py:143
+#: ztfy/utils/date.py:163
 msgid "%d days"
 msgstr ""
 
-#: ztfy/utils/date.py:147
+#: ztfy/utils/date.py:167
 msgid "%d day and %d hours"
 msgstr ""
 
-#: ztfy/utils/date.py:150
+#: ztfy/utils/date.py:170
 msgid "%d hours"
 msgstr ""
 
-#: ztfy/utils/date.py:154
+#: ztfy/utils/date.py:174
 msgid "%d minutes"
 msgstr ""
 
-#: ztfy/utils/date.py:156
+#: ztfy/utils/date.py:176
 msgid "%d seconds"
 msgstr ""
 
-#: ztfy/utils/date.py:79
+#: ztfy/utils/date.py:36
+msgid "january"
+msgstr ""
+
+#: ztfy/utils/date.py:37
+msgid "february"
+msgstr ""
+
+#: ztfy/utils/date.py:38
+msgid "march"
+msgstr ""
+
+#: ztfy/utils/date.py:39
+msgid "april"
+msgstr ""
+
+#: ztfy/utils/date.py:40
+msgid "may"
+msgstr ""
+
+#: ztfy/utils/date.py:41
+msgid "june"
+msgstr ""
+
+#: ztfy/utils/date.py:42
+msgid "july"
+msgstr ""
+
+#: ztfy/utils/date.py:43
+msgid "august"
+msgstr ""
+
+#: ztfy/utils/date.py:44
+msgid "september"
+msgstr ""
+
+#: ztfy/utils/date.py:45
+msgid "october"
+msgstr ""
+
+#: ztfy/utils/date.py:46
+msgid "november"
+msgstr ""
+
+#: ztfy/utils/date.py:47
+msgid "december"
+msgstr ""
+
+#: ztfy/utils/date.py:95
 msgid "%d/%m/%Y"
 msgstr ""
 
-#: ztfy/utils/date.py:80
+#: ztfy/utils/date.py:96
 msgid "%d/%m/%Y - %H:%M"
 msgstr ""
 
-#: ztfy/utils/date.py:82
+#: ztfy/utils/date.py:98
 msgid "on %d/%m/%Y"
 msgstr ""
 
-#: ztfy/utils/date.py:83
+#: ztfy/utils/date.py:99
 msgid "on %d/%m/%Y at %H:%M"
 msgstr ""
 
Binary file src/ztfy/utils/locales/fr/LC_MESSAGES/ztfy.utils.mo has changed
--- a/src/ztfy/utils/locales/fr/LC_MESSAGES/ztfy.utils.po	Wed Jan 24 13:56:03 2024 +0100
+++ b/src/ztfy/utils/locales/fr/LC_MESSAGES/ztfy.utils.po	Wed Jan 24 14:41:56 2024 +0100
@@ -16,7 +16,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: ZTFY.utils\n"
-"POT-Creation-Date: Sat Jan 15 00:17:16 2022\n"
+"POT-Creation-Date: Wed Jan 24 14:38:53 2024\n"
 "PO-Revision-Date: 2012-03-26 14:18+0200\n"
 "Last-Translator: Thierry Florac <thierry.florac@onf.fr>\n"
 "Language-Team: français <>\n"
@@ -35,79 +35,127 @@
 msgid "ZEO connection properties"
 msgstr "Propriétés de la connexion ZEO"
 
-#: ztfy/utils/date.py:112
+#: ztfy/utils/date.py:132
 msgid "%d months ago"
 msgstr "il y a %d mois"
 
-#: ztfy/utils/date.py:114
+#: ztfy/utils/date.py:134
 msgid "%d weeks ago"
 msgstr "il y a %d semaines"
 
-#: ztfy/utils/date.py:116
+#: ztfy/utils/date.py:136
 msgid "%d days ago"
 msgstr "il y a %d jours"
 
-#: ztfy/utils/date.py:118
+#: ztfy/utils/date.py:138
 msgid "the day before yesterday"
 msgstr "avant-hier"
 
-#: ztfy/utils/date.py:120
+#: ztfy/utils/date.py:140
 msgid "yesterday"
 msgstr "hier"
 
-#: ztfy/utils/date.py:124
+#: ztfy/utils/date.py:144
 msgid "%d hours ago"
 msgstr "il y a %d heures"
 
-#: ztfy/utils/date.py:126
+#: ztfy/utils/date.py:146
 msgid "%d minutes ago"
 msgstr "il y a %d minutes"
 
-#: ztfy/utils/date.py:128
+#: ztfy/utils/date.py:148
 msgid "less than 5 minutes ago"
 msgstr "il y a moins de 5 minutes"
 
-#: ztfy/utils/date.py:139
+#: ztfy/utils/date.py:159
 msgid "%d months"
 msgstr "%d mois"
 
-#: ztfy/utils/date.py:141
+#: ztfy/utils/date.py:161
 msgid "%d weeks"
 msgstr "%d semaines"
 
-#: ztfy/utils/date.py:143
+#: ztfy/utils/date.py:163
 msgid "%d days"
 msgstr "%d jours"
 
-#: ztfy/utils/date.py:147
+#: ztfy/utils/date.py:167
 msgid "%d day and %d hours"
 msgstr "%d jours et %d heures"
 
-#: ztfy/utils/date.py:150
+#: ztfy/utils/date.py:170
 msgid "%d hours"
 msgstr "%d heures"
 
-#: ztfy/utils/date.py:154
+#: ztfy/utils/date.py:174
 msgid "%d minutes"
 msgstr "%d minutes"
 
-#: ztfy/utils/date.py:156
+#: ztfy/utils/date.py:176
 msgid "%d seconds"
 msgstr "%d secondes"
 
-#: ztfy/utils/date.py:79
+#: ztfy/utils/date.py:36
+msgid "january"
+msgstr "janvier"
+
+#: ztfy/utils/date.py:37
+msgid "february"
+msgstr "février"
+
+#: ztfy/utils/date.py:38
+msgid "march"
+msgstr "mars"
+
+#: ztfy/utils/date.py:39
+msgid "april"
+msgstr "avril"
+
+#: ztfy/utils/date.py:40
+msgid "may"
+msgstr "mai"
+
+#: ztfy/utils/date.py:41
+msgid "june"
+msgstr "juin"
+
+#: ztfy/utils/date.py:42
+msgid "july"
+msgstr "juillet"
+
+#: ztfy/utils/date.py:43
+msgid "august"
+msgstr "août"
+
+#: ztfy/utils/date.py:44
+msgid "september"
+msgstr "septembre"
+
+#: ztfy/utils/date.py:45
+msgid "october"
+msgstr "octobre"
+
+#: ztfy/utils/date.py:46
+msgid "november"
+msgstr "novembre"
+
+#: ztfy/utils/date.py:47
+msgid "december"
+msgstr "décembre"
+
+#: ztfy/utils/date.py:95
 msgid "%d/%m/%Y"
 msgstr "%d/%m/%Y"
 
-#: ztfy/utils/date.py:80
+#: ztfy/utils/date.py:96
 msgid "%d/%m/%Y - %H:%M"
 msgstr "%d/%m/%Y - %H:%M"
 
-#: ztfy/utils/date.py:82
+#: ztfy/utils/date.py:98
 msgid "on %d/%m/%Y"
 msgstr "le %d/%m/%Y"
 
-#: ztfy/utils/date.py:83
+#: ztfy/utils/date.py:99
 msgid "on %d/%m/%Y at %H:%M"
 msgstr "le %d/%m/%Y à %H:%M"
 
@@ -515,7 +563,9 @@
 
 #: ztfy/utils/interfaces.py:325
 msgid "You must define configuration path or hostname"
-msgstr "Vous devez définir le chemin d'un fichier de configuration ou le nom du serveur"
+msgstr ""
+"Vous devez définir le chemin d'un fichier de configuration ou le nom du "
+"serveur"
 
 #: ztfy/utils/interfaces.py:327
 msgid "ZEO user name"
--- a/src/ztfy/utils/locales/ztfy.utils.pot	Wed Jan 24 13:56:03 2024 +0100
+++ b/src/ztfy/utils/locales/ztfy.utils.pot	Wed Jan 24 14:41:56 2024 +0100
@@ -14,7 +14,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: Meaningless\n"
-"POT-Creation-Date: Sat Jan 15 00:17:16 2022\n"
+"POT-Creation-Date: Wed Jan 24 14:38:53 2024\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: Zope 3 Developers <zope-dev@zope.org>\n"
@@ -31,79 +31,127 @@
 msgid "ZEO connection properties"
 msgstr ""
 
-#: ztfy/utils/date.py:112
+#: ztfy/utils/date.py:132
 msgid "%d months ago"
 msgstr ""
 
-#: ztfy/utils/date.py:114
+#: ztfy/utils/date.py:134
 msgid "%d weeks ago"
 msgstr ""
 
-#: ztfy/utils/date.py:116
+#: ztfy/utils/date.py:136
 msgid "%d days ago"
 msgstr ""
 
-#: ztfy/utils/date.py:118
+#: ztfy/utils/date.py:138
 msgid "the day before yesterday"
 msgstr ""
 
-#: ztfy/utils/date.py:120
+#: ztfy/utils/date.py:140
 msgid "yesterday"
 msgstr ""
 
-#: ztfy/utils/date.py:124
+#: ztfy/utils/date.py:144
 msgid "%d hours ago"
 msgstr ""
 
-#: ztfy/utils/date.py:126
+#: ztfy/utils/date.py:146
 msgid "%d minutes ago"
 msgstr ""
 
-#: ztfy/utils/date.py:128
+#: ztfy/utils/date.py:148
 msgid "less than 5 minutes ago"
 msgstr ""
 
-#: ztfy/utils/date.py:139
+#: ztfy/utils/date.py:159
 msgid "%d months"
 msgstr ""
 
-#: ztfy/utils/date.py:141
+#: ztfy/utils/date.py:161
 msgid "%d weeks"
 msgstr ""
 
-#: ztfy/utils/date.py:143
+#: ztfy/utils/date.py:163
 msgid "%d days"
 msgstr ""
 
-#: ztfy/utils/date.py:147
+#: ztfy/utils/date.py:167
 msgid "%d day and %d hours"
 msgstr ""
 
-#: ztfy/utils/date.py:150
+#: ztfy/utils/date.py:170
 msgid "%d hours"
 msgstr ""
 
-#: ztfy/utils/date.py:154
+#: ztfy/utils/date.py:174
 msgid "%d minutes"
 msgstr ""
 
-#: ztfy/utils/date.py:156
+#: ztfy/utils/date.py:176
 msgid "%d seconds"
 msgstr ""
 
-#: ztfy/utils/date.py:79
+#: ztfy/utils/date.py:36
+msgid "january"
+msgstr ""
+
+#: ztfy/utils/date.py:37
+msgid "february"
+msgstr ""
+
+#: ztfy/utils/date.py:38
+msgid "march"
+msgstr ""
+
+#: ztfy/utils/date.py:39
+msgid "april"
+msgstr ""
+
+#: ztfy/utils/date.py:40
+msgid "may"
+msgstr ""
+
+#: ztfy/utils/date.py:41
+msgid "june"
+msgstr ""
+
+#: ztfy/utils/date.py:42
+msgid "july"
+msgstr ""
+
+#: ztfy/utils/date.py:43
+msgid "august"
+msgstr ""
+
+#: ztfy/utils/date.py:44
+msgid "september"
+msgstr ""
+
+#: ztfy/utils/date.py:45
+msgid "october"
+msgstr ""
+
+#: ztfy/utils/date.py:46
+msgid "november"
+msgstr ""
+
+#: ztfy/utils/date.py:47
+msgid "december"
+msgstr ""
+
+#: ztfy/utils/date.py:95
 msgid "%d/%m/%Y"
 msgstr ""
 
-#: ztfy/utils/date.py:80
+#: ztfy/utils/date.py:96
 msgid "%d/%m/%Y - %H:%M"
 msgstr ""
 
-#: ztfy/utils/date.py:82
+#: ztfy/utils/date.py:98
 msgid "on %d/%m/%Y"
 msgstr ""
 
-#: ztfy/utils/date.py:83
+#: ztfy/utils/date.py:99
 msgid "on %d/%m/%Y at %H:%M"
 msgstr ""