src/JsRender/NodeToJs.vala
authorAlan Knowles <alan@roojs.com>
Fri, 19 Jun 2015 05:13:09 +0000 (13:13 +0800)
committerAlan Knowles <alan@roojs.com>
Fri, 19 Jun 2015 05:13:09 +0000 (13:13 +0800)
src/JsRender/NodeToJs.vala

index 38be8e9..bea8011 100644 (file)
@@ -599,31 +599,28 @@ public class JsRender.NodeToJs : Object {
                        //      continue;
                        //}
                   
-                       if (this.doubleStringProps.index_of(k) > -1) {
+                       if ((this.doubleStringProps.index_of(k) > -1) || 
+                               (ktype.down() == "string" && k[0] == '_')
+                       
+                       ) {
                                // then use the translated version...
                                
+                               var com = " /* " + 
+                                       (v.split("\n").length > 1 ?
+                                               ("\n" + string.joinv(this.pad +  "\n", v.split("\n")).replace("*/", "* - /") + "\n" + this.pad + "*/ ") :
+                                               (v.replace("*/", "* - /") + " */")
+                                       );
+                               
                                this.els.add(left + " : _this._strings['" + 
                                        GLib.Checksum.compute_for_string (ChecksumType.MD5, v) +
                                        "']"
                                );
                                this.out_props.set(left, "_this._strings['" + 
                                        GLib.Checksum.compute_for_string (ChecksumType.MD5, v) +
-                                       "']");
-                               continue;
-                       }
-                       if (ktype.down() == "string" && k[0] == '_') {
-                               this.els.add(left + " : _this._strings['" + 
-                                       GLib.Checksum.compute_for_string (ChecksumType.MD5, v) +
-                                       "']"
-                               );
-                               this.out_props.set(left, " _this._strings['" + 
-                                       GLib.Checksum.compute_for_string (ChecksumType.MD5, v) +
-                                       "']"
-                               );
-                               
-                               
+                                       "']" + com);
                                continue;
                        }
+                
                        // otherwise it needs to be encapsulated.. as single quotes..
                        
                        var vv = this.node.quoteString(v);