8
0
mirror of https://gitee.com/shuto/customCamera.git synced 2026-05-21 00:00:01 +08:00

Merge pull request #93 from geneanet/issue/92-fail-merge-resources

Issue/92 fail merge resources
This commit is contained in:
Christophe Boucaut
2015-08-07 09:13:26 +02:00
2 changed files with 12 additions and 4 deletions
+11 -3
View File
@@ -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 = {
+1 -1
View File
@@ -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"
>
<name>GeneanetCustomCamera</name>
<description>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.</description>