gulp-i18n-ui5
Advanced tools
Comparing version 1.0.3 to 1.0.4
16
index.js
@@ -39,3 +39,6 @@ 'use strict'; | ||
fileExtensions: ["xml", "html"], | ||
pattern: "\\{i18n>([^}]+)\\}" | ||
pattern: [ | ||
"'i18n>([^']+)'", | ||
"\\{i18n>([^}]+)\\}" | ||
] | ||
}, { | ||
@@ -53,3 +56,3 @@ fileExtensions: ["json"], | ||
fileName: "webapp/i18n/i18n.properties", | ||
pattern: /^(#*)([^= ]+) *= *(.*)/ | ||
pattern: /^(#*)([^= ]+) *= *([^#]*)(#*)/ | ||
}, | ||
@@ -85,3 +88,4 @@ noDeactivateTokens: [] | ||
INACTIVE: 1, | ||
ACTIVE: 2 | ||
ACTIVE: 2, | ||
IGNORE: 3 | ||
}; | ||
@@ -181,3 +185,5 @@ | ||
if (match !== null) { | ||
if (match[1] === "#") { | ||
if (match[4] === "#") { | ||
retval.type = TOKEN.IGNORE | ||
} else if (match[1] === "#") { | ||
retval.type = TOKEN.INACTIVE; | ||
@@ -214,3 +220,3 @@ } else { | ||
return _.find(i18nPropertiesFileTokens, function(v) { | ||
return (v.type === TOKEN.ACTIVE || v.type === TOKEN.INACTIVE) && v.name === token; | ||
return (v.type === TOKEN.IGNORE || v.type === TOKEN.ACTIVE || v.type === TOKEN.INACTIVE) && v.name === token; | ||
}) === undefined; | ||
@@ -217,0 +223,0 @@ }) |
{ | ||
"name": "gulp-i18n-ui5", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "The plugin is used for simplify work with translations in OpenUI5 or SAPUI5 framework. The plugin searches views and source code of project in OpenUI5 or SAPUI5 framework for translation tokens and automatically update translation file used by the framework.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -81,1 +81,15 @@ # Plugin gulp-i18n-ui5 [![npm version](https://badge.fury.io/js/gulp-i18n-ui5)](http://badge.fury.io/js/gulp-i18n-ui5) | ||
``` | ||
## Ignore translation tokens | ||
If you use external translations and You need just ignore some tokens | ||
in the translation file Append `#` character to the end of the line. | ||
``` | ||
#XTIT | ||
INITIAL=Initial | ||
#XTIT | ||
#EMAIL=Email #Ignore | ||
``` |
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
11138
268
95
3