Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
idIndex = {}
for entry in self:
idIndex[entry.msgid] = entry
self.idIndex = idIndex
return idIndex
##
# looks up a msgid in the POFile, using the .idIndex index generated by .getIdIndex()
def pofileIndexFind(self, msgid):
return self.idIndex.get(msgid, None)
# Attach the new methods to the POFile class
polib.POFile.getIdIndex = pofileGetIdIndex
polib.POFile.indexFind = pofileIndexFind
class Locale(object):
def __init__(self, context, classesObj, translation, cache, console):
self._context = context
self._classesObj = classesObj
self._translation = translation
self._cache = cache
self._console = console
def getLocalizationData(self, classList, targetLocales, ):
self._console.debug("Generating localization data...")
data = {}
# check need for cldr data in this classlist
idIndex = {}
for entry in self:
idIndex[entry.msgid] = entry
self.idIndex = idIndex
return idIndex
##
# looks up a msgid in the POFile, using the .idIndex index generated by .getIdIndex()
def pofileIndexFind(self, msgid):
return self.idIndex.get(msgid, None)
# Attach the new methods to the POFile class
polib.POFile.getIdIndex = pofileGetIdIndex
polib.POFile.indexFind = pofileIndexFind
class Locale(object):
def __init__(self, context, classesObj, translation, cache, console):
self._context = context
self._classesObj = classesObj
self._translation = translation
self._cache = cache
self._console = console
def getLocalizationData(self, classList, targetLocales, ):
self._console.debug("Generating localization data...")
data = {}
# check need for cldr data in this classlist