cordova-plugin-localization-strings
Advanced tools
Comparing version 5.0.5 to 5.0.6
{ | ||
"name": "cordova-plugin-localization-strings", | ||
"version": "5.0.5", | ||
"version": "5.0.6", | ||
"description": "Cordova Plugin for handling localization strings on InfoPlist.strings and Localizable.strings on iOS, strings.xml on Android", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -20,9 +20,19 @@ var fs = require("fs"); | ||
function getProjectName() { | ||
// Valid matches | ||
// '<name>Application one</name>', | ||
// '<name short="App1">Application one</name>', | ||
// '<name xmlns:widget="http://www.w3.org/ns/widgets">Application one</name>', | ||
// '<name >Application one</name>', | ||
// `<name | ||
// >Application one</name>`, | ||
// | ||
// Invalid matches | ||
// '<name2>Application one</name>', | ||
// '<namefoo>Application one</name>', | ||
// '<name!!>Application one</name>', | ||
const regExpression = "<name(?=[\\s>])[^>]*>(.*?)</name>"; | ||
var config = fs.readFileSync("config.xml").toString(); | ||
var matches = config.match(new RegExp("<name>(.*?)</name>", "i")); | ||
var matches = config.match(new RegExp(regExpression, "i")); | ||
// if simple name-tag not found then try optional form of name tag with short name | ||
if (!matches) | ||
matches = config.match(new RegExp('<name short=".*?">(.*?)</name>', "i")); | ||
return (matches && matches[1]) || null; | ||
@@ -29,0 +39,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24593
440