diff --git a/windows/lib/WixSDK.js b/windows/lib/WixSDK.js index 4393658..021074a 100644 --- a/windows/lib/WixSDK.js +++ b/windows/lib/WixSDK.js @@ -226,18 +226,28 @@ function(app_path, xwalk_path, meta_data, callback) { return node; } - var locales_path = path.join(xwalk_path, 'locales', 'xwalk'); - if (!fs.existsSync(locales_path)) - locales_path = path.join(xwalk_path, 'locales'); - if (fs.existsSync(locales_path)) { - var locales = fs.readdirSync(locales_path); - locales.forEach(function (locale) { - AddFileComponent(GetFolderNode('locales', app_root_folder), locales_path, locale); - }); - } else { - output.error("Folder 'locales' not found in " + xwalk_path); - output.error("Missing i18n support"); - } + function addRecursiveLocales(original_path, sub_folder, root_folder) { + var locales = fs.readdirSync(original_path); + + locales.forEach(function(locale) { + var l_path = path.join(original_path, locale); + + if (fs.lstatSync(l_path).isFile()) { + AddFileComponent(GetFolderNode(sub_folder, root_folder), original_path, locale); + } else if (fs.lstatSync(l_path).isDirectory()) { + addRecursiveLocales(l_path, locale, GetFolderNode(sub_folder, root_folder)); + } + }); + } + + var locales_path = path.join(xwalk_path, 'locales'); + + if (fs.existsSync(locales_path)) { + addRecursiveLocales(locales_path, 'locales', app_root_folder); + } else { + output.error("Folder 'locales' not found in " + xwalk_path); + output.error("Missing i18n support"); + } // @skip_array contains absolute path of those need to be skipped, items can be // directory or files.