Commits

Anonymous committed de54a95

masterfix: #i10000# modify extract date and dummy fields for string database

Comments (0)

Files changed (2)

l10ntools/java/jpropex/java/JPropEx.java

         //String path = makeAbs( inputFileArg );
         path = path.replace( rootArg + "/" , "" );
         path = path.replace("/","\\");
-        return new SdfEntity( projectArg , path , "" /* dummy1 */ , resourceType , "", "" , "" , "" , "" /* dummy2 */ , 
-                              sourceLanguage , "",  "" , ""  , "" , "2002-02-02 02:02:02" );
+        // TODO: Make this static
+        java.text.SimpleDateFormat dateformat = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        String date = dateformat.format( new Date() );
+        return new SdfEntity( projectArg , path , "0" /* dummy1 */ , resourceType , "", "" , "" , "" , "0" /* dummy2 */ , 
+                              sourceLanguage , "",  "" , ""  , "" , date );
     }
     
     private void merge()

l10ntools/scripts/tool/sdf.py

 #*************************************************************************
 
 from pseudo import PseudoSet,PseudoOrderedDict
+from time import gmtime, strftime
 
 class SdfData:
     _filename        = "";
     const._DATE_POS            = 14
         
     def __init__(self, project="", source_file="", dummy1="0", resource_type="", gid="", lid="", helpid="", platform="", dummy2="0", langid="", 
-                       text="", helptext="", quickhelptext="", title="", date="2002-02-02 02:02:02"):
+                       text="", helptext="", quickhelptext="", title="", date=""):
         self.project        = project;
         self.source_file    = source_file;
         self.dummy1         = dummy1;
         self.helptext       = helptext;
         self.quickhelptext  = quickhelptext;
         self.title          = title;
-        self.date           = date;
+        if date != "":
+            self.date = date;
+        else:
+            self.date = strftime("%Y-%m-%d %H:%M:%S",gmtime())
+
 
     def set_properties(self, line):
         splitted = line.split("\t")