Back to index

moin  1.9.0~rc2
Public Member Functions | Private Attributes
MoinMoin.i18n.tools.check_i18n.Report Class Reference

List of all members.

Public Member Functions

def __init__
def loadLanguage
def create
def summary
def missing
def unused

Private Attributes

 __lang
 __sourceDict
 __langDict
 __missing
 __unused
 __error
 __ready

Detailed Description

Language status report

Definition at line 182 of file check_i18n.py.


Constructor & Destructor Documentation

def MoinMoin.i18n.tools.check_i18n.Report.__init__ (   self,
  lang,
  sourceDict 
)

Definition at line 184 of file check_i18n.py.

00184 
00185     def __init__(self, lang, sourceDict):
00186         self.__lang = lang
00187         self.__sourceDict = sourceDict
00188         self.__langDict = None
00189         self.__missing = {}
00190         self.__unused = {}
00191         self.__error = None
00192         self.__ready = 0
00193         self.create()


Member Function Documentation

Compare language text dict against source dict

Definition at line 198 of file check_i18n.py.

00198 
00199     def create(self):
00200         """Compare language text dict against source dict"""
00201         self.loadLanguage()
00202         if not self.__langDict:
00203             self.__error = "Language %s not found!" % self.__lang
00204             self.__ready = 1
00205             return
00206 
00207         # Collect missing texts
00208         for text in self.__sourceDict:
00209             if text not in self.__langDict:
00210                 self.__missing[text] = self.__sourceDict[text]
00211 
00212         # Collect unused texts
00213         for text in self.__langDict:
00214             if text not in self.__sourceDict:
00215                 self.__unused[text] = self.__langDict[text]
00216         self.__ready = 1

Here is the call graph for this function:

Definition at line 194 of file check_i18n.py.

00194 
00195     def loadLanguage(self):
00196         filename = i18n.filename(self.__lang)
00197         self.__langDict = pysupport.importName("MoinMoin.i18n." + filename, "text")

Here is the caller graph for this function:

Definition at line 229 of file check_i18n.py.

00229 
00230     def missing(self):
00231         return self.__missing

Return summary dict

Definition at line 217 of file check_i18n.py.

00217 
00218     def summary(self):
00219         """Return summary dict"""
00220         summary = {
00221             'name': i18n.languages[self.__lang][i18n.ENAME].encode(output_encoding),
00222             'maintainer': i18n.languages[self.__lang][i18n.MAINTAINER],
00223             'total': len(self.__langDict),
00224             'missing': len(self.__missing),
00225             'unused': len(self.__unused),
00226             'error': self.__error
00227             }
00228         return summary

Definition at line 232 of file check_i18n.py.

00232 
00233     def unused(self):
00234         return self.__unused
00235 


Member Data Documentation

Definition at line 190 of file check_i18n.py.

Definition at line 185 of file check_i18n.py.

Definition at line 187 of file check_i18n.py.

Definition at line 188 of file check_i18n.py.

Definition at line 191 of file check_i18n.py.

Definition at line 186 of file check_i18n.py.

Definition at line 189 of file check_i18n.py.


The documentation for this class was generated from the following file: