[Zope3-checkins] CVS: Zope3/src/zope/i18n - gettextmessagecatalog.py:1.8 globaltranslationservice.py:1.12 interfaces.py:1.16

Godefroid Chapelle gotcha at swing.be
Tue Aug 12 12:55:16 EDT 2003


Update of /cvs-repository/Zope3/src/zope/i18n
In directory cvs.zope.org:/tmp/cvs-serv15856

Modified Files:
	gettextmessagecatalog.py globaltranslationservice.py 
	interfaces.py 
Log Message:
added view in process manager to allow
to reload message ids catalogs
without restarting server



=== Zope3/src/zope/i18n/gettextmessagecatalog.py 1.7 => 1.8 ===
--- Zope3/src/zope/i18n/gettextmessagecatalog.py:1.7	Fri Jun  6 15:29:09 2003
+++ Zope3/src/zope/i18n/gettextmessagecatalog.py	Tue Aug 12 11:55:10 2003
@@ -36,12 +36,15 @@
         self._language = language
         self._domain = domain
         self._path_to_file = path_to_file
+        self.reload()
+
+    def reload(self):
+        'See IMessageCatalog'
         fp = open(self._path_to_file, 'r')
         try:
             self._catalog = GNUTranslations(fp)
         finally:
             fp.close()
-        self._catalog.add_fallback(_KeyErrorRaisingFallback())
 
     def getMessage(self, id):
         'See IMessageCatalog'


=== Zope3/src/zope/i18n/globaltranslationservice.py 1.11 => 1.12 ===
--- Zope3/src/zope/i18n/globaltranslationservice.py:1.11	Wed Aug  6 10:36:09 2003
+++ Zope3/src/zope/i18n/globaltranslationservice.py	Tue Aug 12 11:55:10 2003
@@ -106,6 +106,13 @@
             text = self.interpolate(text, mapping)
         return text
 
+    def getCatalogsInfo(self):
+        return self._catalogs
+
+    def reloadCatalogs(self, catalogNames):
+        for catalogName in catalogNames:
+            self._data[catalogName].reload()
+
 translationService = GlobalTranslationService()
 
 


=== Zope3/src/zope/i18n/interfaces.py 1.15 => 1.16 ===
--- Zope3/src/zope/i18n/interfaces.py:1.15	Fri Jul 11 22:47:20 2003
+++ Zope3/src/zope/i18n/interfaces.py	Tue Aug 12 11:55:10 2003
@@ -85,6 +85,8 @@
         Also, there are no restrictions on the form of the identifier.
         """
 
+    def reload():
+        """Reload and parse .po file"""
 
 class ITranslationService(Interface):
     """The Translation Service




More information about the Zope3-Checkins mailing list