diff --git a/openecomp-ui/tools/gulp/tasks/i18n.js b/openecomp-ui/tools/gulp/tasks/i18n.js
index a17e846..85d5c37 100644
--- a/openecomp-ui/tools/gulp/tasks/i18n.js
+++ b/openecomp-ui/tools/gulp/tasks/i18n.js
@@ -17,56 +17,13 @@
 var fs = require('fs');
 var replace = require('gulp-replace');
 var clean = require('gulp-clean');
-var mkdirp = require('mkdirp');
-
-/**
- *
- * @param options.localesPath
- * @param options.lang = options.lang
- *
- * @returns {string}
- */
-function composeLocalesDirPath(options) {
-	return options.localesPath + options.lang;
-}
-
-/**
- *
- * @param options.localesPath
- * @param options.lang
- *
- * @returns {string}
- */
-function composeLocaleFilePath(options) {
-	return composeLocalesDirPath(options) + '/locale.json';
-}
-
-
-/**
- *
- * @param options.localesPath
- * @param options.lang = options.lang
- */
-function ensureLocalesDir(options) {
-
-	return new Promise(function (resolve, reject) {
-		mkdirp(composeLocalesDirPath(options), function (err) {
-			if (err) {
-				reject(err);
-			}
-			else {
-				resolve();
-			}
-		});
-	});
-}
-
+var tap = require('gulp-tap');
 /**
  *
  * @param options
- * @param options.outputPath
- * @param options.localesPath
- * @param options.lang = options.lang
+ * @param options.outDir
+ * @param options.srcDir
+ * @param options.i18nBundles - optional. if given will check the that all keys from js are mapped
  *
  */
 function i18nTask(options) {
@@ -75,31 +32,66 @@
 
 	function addWord(expr) {
 		var word = expr.substring('i18n(\''.length, expr.length - 1);
-		i18nJson[word] = word;
+		if (word !== '') {
+			i18nJson[word] = word;
+		}
 		return expr;
 	}
 
-	return ensureLocalesDir(options).then(function () {
-		return new Promise(function(resolve, reject) {
-			gulp.src(options.outputPath + '**/*.js', {base: './'})
-				.pipe(replace(/i18n\('.*?'/g, addWord))
-				.pipe(clean())
-				.pipe(gulp.dest('./'))
-				.on('end', function () {
-
-					var i18nJsonWrapper = { dataWrapperArr: ["I18N_IDENTIFIER_START", i18nJson, "I18N_IDENTIFIER_END"] , i18nDataIdx: 1};
-
-					fs.writeFile(composeLocaleFilePath(options), JSON.stringify(i18nJsonWrapper), function (err) {
+	let createBundle = new Promise(function(resolve, reject) {
+		gulp.src(options.srcDir + '**/*.{js,jsx}', {base: './'})
+			.pipe(replace(/i18n\('.*?'/g, addWord))
+			.pipe(clean())
+			.pipe(gulp.dest('./'))
+			.on('end', function () {
+				console.log('Retrieved keys from static references.');
+				if (options.i18nBundles === undefined) {
+					// creating the file from the words saved during the replace
+					let outfile = options.outDir + '/bundleForStaticKeys.json';
+					fs.writeFile(outfile,JSON.stringify(i18nJson, null, '\t'), function (err) {
 						if (err) {
 							reject(err);
 						}
 						else resolve();
 					});
-				}).on('error', function (err) {
-				reject(err);
-			});
+					console.log('Bundle with static keys was created under: ' + outfile);
+				}
+				resolve();
+			}).on('error', function (err) {
+			reject(err);
 		});
 	});
+
+
+	if (options.i18nBundles === undefined) {
+		return createBundle;
+	} else {
+		return createBundle.then(() => {
+			new Promise(function (resolve, reject) {
+				gulp.src(options.i18nBundles)
+					.pipe(tap(function (file) {
+						console.log('Checking against bundle: ' + file.path);
+						let bundle = JSON.parse(file.contents.toString());
+						for (entry in i18nJson) {
+							if (!bundle[entry]) {
+								console.log('Missing Key: ' + entry);
+							} else {
+								delete bundle[entry];
+							}
+						}
+						for (entry in bundle) {
+							console.log('Unused in static files: ' + entry);
+						}
+					}))
+					.pipe(gulp.dest('./'))
+					.on('end', function () {
+						console.log('done');
+					}).on('error', function (err) {
+					reject(err);
+				});
+			});
+		});
+	}
 }
 
 module.exports = i18nTask;
diff --git a/openecomp-ui/tools/gulp/tasks/prod.js b/openecomp-ui/tools/gulp/tasks/prod.js
index cb6e251..509bec8 100644
--- a/openecomp-ui/tools/gulp/tasks/prod.js
+++ b/openecomp-ui/tools/gulp/tasks/prod.js
@@ -15,65 +15,51 @@
  */
 'use strict';
 
-let gulp, replace, Promise, webpack, webpackProductionConfig;
+let gulp, replace, Promise, webpack, webpackProductionConfig,cloneDeep, tap;
+let langs = [];
 
-const supportedLanguages = ['en'];
-
-function start(options) {
-
-	let promises = [buildIndex(options)];
-	supportedLanguages.forEach(function (lang) {
-		promises.push(bundleJS(options, lang));
-	});
-	return Promise.all(promises);
-}
-
-function bundleJS(options, lang) {
+/*
+Runs the webpack build.
+Will first seach for the resource bundles to see how many languages are supported and then run a build per langauage
+ */
+function buildWebPackForLanguage(prodConfig, lang) {
 	return new Promise(function (resolve, reject) {
-		let prodConfig = webpackProductionConfig;
-		prodConfig.resolve.alias.i18nJson = options.outDir + '/i18n/' + lang + '/locale.json';
-		prodConfig.output.filename = jsFileByLang(options.outFileName, lang);
 		webpack(prodConfig, function (err, stats) {
-			console.log('[webpack:build]', stats.toString());
+			console.log('[webpack:build ' + prodConfig.output.filename + ']', stats.toString());
 			if (err || stats.hasErrors()) {
-				console.log('bundleJS : Failure!!', '\n		-language: ', lang);
+				console.log('webpack:build : Failure!! ' + prodConfig.output.filename + ']');
 				reject(err || stats.toJson().errors);
 			}
 			else {
-				console.log('bundleJS : Done', '\n		-language: ', lang);
+				console.log('webpack:build : Done ' + prodConfig.output.filename + ']');
 				resolve();
 			}
 		});
 	});
 }
-
-function buildIndex(options) {
-
-	return new Promise(function (resolve, reject) {
-
-		// gulp.src returns a stream object
-		gulp.src(options.outDir + '/index.html')
-			.pipe(replace(/\/\/<!--prod:delete-->(.|[\r\n])*?<!--\/prod:delete-->/g, ''))//in script occurrences.
-			.pipe(replace(/<!--prod:delete-->(.|[\r\n])*?<!--\/prod:delete-->/g, ''))//out of script occurrences.
-			.pipe(replace(/<!--prod:add(-->)?/g, ''))
-			.pipe(replace(/\/\/<!--prod:supported-langs-->(.|[\r\n])*?<!--\/prod:supported-langs-->/g, supportedLanguages.map(function (val) {
-				return "'" + val + "'";
-			}).toString()))
+/*
+ // this will check in the src directory which language bundles we have and will
+ // create the array to that we can run a webpack build per language afterwards
+ */
+function getSupportedLanguages(options) {
+	return new Promise((resolve, reject) => {
+		gulp.src(options.i18nBundles)
+			.pipe(tap(function(file) {
+				let languageStartIndex = file.path.lastIndexOf('i18n') + 5;
+				let languageStr =  file.path.indexOf('.json') - languageStartIndex;
+				let currentLang = file.path.substr(languageStartIndex, languageStr);
+				console.log('Found bundle ' +  file.path + ' for [' + currentLang  + ']');
+				langs[currentLang] = file.path;
+			}))
 			.pipe(gulp.dest(options.outDir))
 			.on('end', function () {
-				console.log('buildIndex : Done');
 				resolve();
 			})
 			.on('error', function (e) {
-				console.log('buildIndex : Failure!!');
+				console.log('getLanguages : Failure!!');
 				reject(e);
 			});
 	});
-
-}
-
-function jsFileByLang(fileName, lang) {
-	return fileName.replace(/.js$/, '_' + lang + '.js');
 }
 
 /**
@@ -85,22 +71,27 @@
 	replace = require('gulp-replace');
 	Promise = require('bluebird');
 	webpack = require('webpack');
+	cloneDeep = require('lodash/cloneDeep');
+	tap = require('gulp-tap');
 
+
+	// updating webpack for the production build. no need for sourcemaps in this case.
 	webpackProductionConfig = require('../../../webpack.production');
-	webpackProductionConfig.module.rules = webpackProductionConfig.module.rules.filter(rule => ((rule.enforce !== 'pre') || (rule.enforce === 'pre' && rule.loader !== 'source-map-loader')));
-	webpackProductionConfig.module.rules.forEach(loader => {
-		if (loader.use && loader.use[0].loader === 'style-loader') {
-			loader.use = loader.use.map(loaderObj => loaderObj.loader.replace('?sourceMap', ''));
+
+	// get the languages so that we can bulid per language with the correct bundle
+	let getLanguages =getSupportedLanguages(options);
+	// this will run a webpack build per language
+	return getLanguages.then(() => {
+		let promises = [];
+		for (var lang in langs) {
+			let prodConfig = cloneDeep(webpackProductionConfig);
+			prodConfig.resolve.alias.i18nJson = langs[lang];
+			prodConfig.output.filename = (options.outFileName || '[name].js').replace(/.js$/, '_' + lang + '.js');
+			promises.push(buildWebPackForLanguage(prodConfig, lang));
 		}
+		return Promise.all(promises);
 	});
 
-
-	webpackProductionConfig.module.rules.push({test: /config.json$/, use: [{loader:'config-json-loader'}]});
-
-	return start({
-		outFileName: options.outFileName || '[name].js',
-		outDir: options.outDir
-	});
 }
 
 module.exports = prodTask;
