build/buildutils/extractJavaLocFiles_qt.py
changeset 26 dc7c549001d5
parent 23 98ccebc37403
child 72 1f0034e370aa
equal deleted inserted replaced
23:98ccebc37403 26:dc7c549001d5
    39     'javainstallation',
    39     'javainstallation',
    40     'javasensor',
    40     'javasensor',
    41     'javassl',
    41     'javassl',
    42     'javausermessages',
    42     'javausermessages',
    43     'javaapplicationsettings',
    43     'javaapplicationsettings',
    44     'javaruntimeapplicationsettings'
    44     # loc files for qt
       
    45     'javaapplicationinstaller',
       
    46     'javaapplicationsecuritymessages',
       
    47     'javaruntimeapplicationsettings',
       
    48     'javaruntimecertificatemanagement'
    45     ]
    49     ]
    46 
    50 
    47 # Path for java loc files inside RESOURCES_FILE.
    51 # Path for java loc files inside RESOURCES_FILE.
    48 RESOURCES_PATH = os.path.join("resources", "com", "nokia", "mj", "impl")
    52 RESOURCES_PATH = os.path.join("resources", "com", "nokia", "mj", "impl")
    49 
    53 
    87 
    91 
    88         print "Processed %d loc files" % (locFileCount)
    92         print "Processed %d loc files" % (locFileCount)
    89         shutil.rmtree(tmpDir)
    93         shutil.rmtree(tmpDir)
    90 
    94 
    91     except:
    95     except:
    92         print "Usage: %s <input_dir> <output_dir>" % sys.argv[0]
    96         print "Usage: %s <input_dir> <output_dir> <resources_jar>" % sys.argv[0]
    93         traceback.print_exc()
    97         traceback.print_exc()
    94         sys.exit(1)
    98         sys.exit(1)
    95 
    99 
    96 def readTs(filename):
   100 def readTs(filename):
    97     messages = []
   101     messages = []
   108         if lengthvariant != None:
   112         if lengthvariant != None:
   109             text = lengthvariant.text
   113             text = lengthvariant.text
   110         else:
   114         else:
   111             text = translation.text
   115             text = translation.text
   112 
   116 
       
   117         # If text is not found, this is unlocalised engineering English file
       
   118         if text == None:
       
   119             text = message.find("source").text
       
   120 
   113         # Sanity check - no newlines in text allowed
   121         # Sanity check - no newlines in text allowed
   114         if "\n" in text:
   122         if "\n" in text:
   115             raise Exception("Conversion error in %s / %s: newline found" % (filename, id))
   123             raise Exception("Conversion error in %s / %s: newline found" % (filename, id))
   116         
   124         
   117         messages.append((id, text))
   125         messages.append((id, text))