Example #1
0
    def makestoredict(self, store, includefuzzy=False):
        """make a dictionary of the translations"""
        for unit in store.units:
            if includefuzzy or not unit.isfuzzy():

                rcstring = unit.target
                if len(rcstring.strip()) == 0:
                    rcstring = unit.source

                escaped_source = rc.escape_to_rc(unit.source)

                if not escaped_source:
                    continue

                if escaped_source not in self.inputdict:
                    self.inputdict[escaped_source] = {}

                if len(unit.getlocations()) == 0:
                    self.inputdict[escaped_source][EMPTY_LOCATION] = rc.escape_to_rc(
                        rcstring
                    )
                else:
                    for location in unit.getlocations():
                        self.inputdict[escaped_source][location] = rc.escape_to_rc(
                            rcstring
                        )
Example #2
0
 def makestoredict(self, store, includefuzzy=False):
     """make a dictionary of the translations"""
     for unit in store.units:
         if includefuzzy or not unit.isfuzzy():
             for location in unit.getlocations():
                 rcstring = unit.target
                 if len(rcstring.strip()) == 0:
                     rcstring = unit.source
                 self.inputdict[location] = rc.escape_to_rc(rcstring).encode(self.charset)