diff --git a/lang.js b/lang.js index 1997ce1ded..8b0261ccb9 100644 --- a/lang.js +++ b/lang.js @@ -40,14 +40,23 @@ var isWin = /^win/.test(os.platform()); var espoPath = path.dirname(fs.realpathSync(__filename)) + ''; var resLang = process.argv[2] || 'lang_LANG'; -var poPath = espoPath + '/build/' + 'espocrm-' + resLang +'.po'; - var onlyModuleName = null; if (process.argv.length > 2) { for (var i in process.argv) { if (~process.argv[i].indexOf('--module=')) { onlyModuleName = process.argv[i].substr(('--module=').length); } + } +} + +var poPath = espoPath + '/build/' + 'espocrm-' + resLang; +if (onlyModuleName) { + poPath += '-' + onlyModuleName; +} +poPath += '.po'; + +if (process.argv.length > 2) { + for (var i in process.argv) { if (~process.argv[i].indexOf('--path=')) { poPath = process.argv[i].substr(('--path=').length); } @@ -95,6 +104,7 @@ function Lang (poPath, espoPath) { var dirs = [coreDir]; dirNames[coreDir] = 'application/Espo/Resources/i18n/' + resLang + '/'; + var installDir = this.espoPath + 'install/core/i18n/' + this.baseLanguage + '/'; dirs.push(installDir); dirNames[installDir] = 'install/core/i18n/' + resLang + '/'; diff --git a/po.js b/po.js index 4b525411a3..9b4077dd93 100644 --- a/po.js +++ b/po.js @@ -56,7 +56,11 @@ function PO (espoPath, language) { this.currentPath = path.dirname(fs.realpathSync(__filename)) + '/'; - this.outputFileName = 'espocrm-' + this.language + '.po'; + this.outputFileName = 'espocrm-' + this.language ; + if (onlyModuleName) { + this.outputFileName += '-' + onlyModuleName; + } + this.outputFileName += '.po'; this.path = espoPath; if (this.path.substr(-1) != '/') {