diff --git a/hooks/before_compile/generateActivity.js b/hooks/before_compile/generateActivity.js index 7fcf206..a0ddbd4 100644 --- a/hooks/before_compile/generateActivity.js +++ b/hooks/before_compile/generateActivity.js @@ -2,6 +2,8 @@ "use strict"; +/* jshint loopfunc:true */ + // Define required. var fs = require("fs"); var xml2js = require("xml2js"); @@ -18,9 +20,9 @@ var pathResPlugin = __dirname+"/../../res/"; /** * Generate a path based on a package name. - * + * * @param {string} packageName Package name, eg: com.example. - * + * * @return {string} Return path generate. */ var generatePathFrompackageName = function(packageName) { @@ -29,7 +31,7 @@ var generatePathFrompackageName = function(packageName) { /** * Create different java classes. - * + * * @param {string} packageName Package name of the current application. */ var createClasses = function(packageName) { @@ -137,6 +139,12 @@ var updateConfig = function() { if (fs.existsSync(pathFileTranslate+"strings.xml")) { objToXml = fs.readFileSync(pathFileTranslate+"strings.xml", {encoding: "utf8"}); parseString(objToXml, parseStringCallback); + // Delete in resources strings which will be added in the strings.xml file if they exist already. + objToXml.resources.string.forEach(function (currentStringResource) { + if (translationsForApplication[lang].hasOwnProperty(currentStringResource.$.name)) { + delete translationsForApplication[lang][currentStringResource.$.name]; + } + }); } else { // generate minimal object. objToXml = { diff --git a/plugin.xml b/plugin.xml index 813f6a7..439b9fd 100644 --- a/plugin.xml +++ b/plugin.xml @@ -3,7 +3,7 @@ xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android" id="org.geneanet.customCamera" - version="0.1.1" + version="0.1.2" > GeneanetCustomCamera This cordova plugin is an alternative to the official cordova plugin (camera). It starts a custom camera: image overlay with an opacity slider, user-defined color of the buttons, activating/deactivating functions.