Created
November 8, 2012 19:05
-
-
Save sleroux/4040812 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var data2xml = require("data2xml"), | |
key = 'splashScreen', | |
xmlObject = {}, | |
imgPath = "dummyImage.png"; | |
xmlObject[key] = {}, | |
xmlObject[key]['image'] = []; | |
// Push 2 different images for each localization | |
xmlObject[key]["image"].push({ | |
text: { | |
_attr: { | |
"xml:lang": 'en' | |
}, | |
_value: "locales/en/" + imgPath | |
} | |
}); | |
xmlObject[key]["image"].push({ | |
text: { | |
_attr: { | |
"xml:lang": 'fr' | |
}, | |
_value: "locales/fr/" + imgPath | |
} | |
}); | |
// Default locale splash | |
xmlObject[key]["image"].push({ | |
_value: imgPath | |
}); | |
console.log(data2xml('qnx', xmlObject)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
var obj = { name: { text: { _attr: { "xml:lang": "de-DE" }, _value: "The german description for HelloWorldDisplayManaged application" }, _value: "The HelloWorldDisplayManaged application" } }
I used the above object to generate;
The HelloWorldDisplayManaged applicationThe german description for HelloWorldDisplayManaged application