Example #1
0
    def parse(cls, string, locale):
        for match in STRING_KEY_VALUE.finditer(string):
            key, value = match.groups()
            TranslatedItem.get_or_create_from_text(key, value, system=ANDROID, locale=locale)

        for match in ITEM_VALUE.finditer(string):
            value = match.groups()[0]
            TranslatedItem.get_or_create_from_text(value, value, system=ANDROID, locale=locale)
Example #2
0
    def parse(cls, string, locale):
        po = polib.pofile(string)
        for entry in po:
            if not entry.msgstr:
                msgstr = entry.msgid
            else:
                msgstr = entry.msgstr

            TranslatedItem.get_or_create_from_text(force_unicode(entry.msgid), force_unicode(msgstr), system=PO,
                                                   locale=locale)
Example #3
0
 def parse(cls, string, locale):
     TranslatedItem.get_or_create_from_text(string, string, system=TEXT, locale=locale)
Example #4
0
 def parse(cls, string, locale):
     for match in IOS_KEY_VALUE.finditer(string):
         key, value = match.groups()
         TranslatedItem.get_or_create_from_text(key, value, system=IOS, locale=locale)