Changeset 5105


Ignore:
Timestamp:
Jun 6, 2017, 6:25:33 PM (23 months ago)
Author:
Juanma
Message:

added fix xml option

File:
1 edited

Legend:

Unmodified
Added
Removed
  • devtools/metadata_extract_locale2po/metadata_xml2po.py

    r5104 r5105  
    7070#def get_package_dirs
    7171
    72 def generate_tmp_po(candidatePaths,outputFile):
     72def generate_tmp_po(candidatePaths):
    7373        global xmlFix
    7474        for path in candidatePaths:
     
    100100                                                        else:
    101101                                                                save_locale(element.attrib['{http://www.w3.org/XML/1998/namespace}lang'],msgid,element.text)
    102                                 #Corrects the xml replacing " with ' and \n with spaces
     102                                #Fixes the xml replacing " with ' and \n with spaces
    103103                                if xmlFix:
    104104                                        _debug(("Attempting to fix the xmlFile %s")%(xmlFile))
     
    121121#def save_locale
    122122
    123 def print_locale():
     123def print_locale(outputFile):
    124124        global suffix
    125125        for msgId in msgIdList:
     
    137137#def print_locale
    138138
    139 ##IMPORT
    140139def get_locale_from_po(poFile):
    141140        locale=os.path.basename(poFile)
     
    247246parse_arguments()
    248247print(("Analyzing %s for action %s") % (wrkDir,mode))
    249 localeSet=[]
    250 msgIdList=[]
    251248poDict={}
    252249pathList=get_package_dirs(wrkDir)
    253250if mode=='export':
     251        localeSet=[]
     252        msgIdList=[]
    254253        outputFile="catalogue"
    255         generate_tmp_po(pathList,outputFile)
     254        generate_tmp_po(pathList)
    256255        localeSet=set(localeSet)
    257         print_locale()
     256        print_locale(outputFile)
    258257        print("Po files generated for "+str(localeSet))
    259258else:
Note: See TracChangeset for help on using the changeset viewer.