Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion Code.gs
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,23 @@ function makeAndroidString(object, textIndex, options) {
exportString += "\t" + '</string-array>' + "\n";
prevIdentifier = "";
}

if(typeof text === 'string') {
text = text.replace(/\n/g, "\\n");
text = text.replace(/&/g, "&amp;");
text = text.replace(/\'/g, "\\'");
text = text.replace(/</g, "&lt;");
text = text.replace(/>/g, "&gt;");
text = text.replace(/"/g, "\\\"");
}

if(identifier.indexOf("[]")>0) {

if(identifier != prevIdentifier) {
exportString += "\t" + '<string-array name="' + identifier.substr(0,identifier.length-2) + '">' + "\n";
}

exportString += "\t\t"+'<item>'+o.text+'</item>' + "\n";
exportString += "\t\t"+'<item>'+text+'</item>' + "\n";
prevIdentifier = identifier;

} else {
Expand Down Expand Up @@ -261,6 +270,10 @@ function makeIosString(object, textIndex, options) {
continue;
}

if(typeof text === 'string') {
text = text.replace(/"/g, "\\\"");
}

exportString += '"' + identifier + '" = "' + text + "\";\n";
}

Expand Down