diff options
author | Basil <basil@miranda-ng.org> | 2013-02-22 11:44:22 +0000 |
---|---|---|
committer | Basil <basil@miranda-ng.org> | 2013-02-22 11:44:22 +0000 |
commit | 2eee15c40aea9351bcadace3d1ebfd0d98cb84ef (patch) | |
tree | e9be40ee651ceee81652f8b08fb162036e066458 /tools | |
parent | d5aa68bc585710dcb741ac2cd545c21410b0af7e (diff) |
By Wishmaster request, translate.js now output =CORE=.txt not to /out:"/path/to/folder", but one level upper. Thus, now you need specify /out:"/path/plugins" and /untranslated:"/path/plugins" to get same folder structure, as /langpacks/german have now:
\langpacks\german\=CORE=.txt
\langpacks\german\Plugins\*.txt
\langpacks\german\Untranslated\=CORE=.txt
\langpacks\german\Untranslated\Plugins\*.txt
git-svn-id: http://svn.miranda-ng.org/main/trunk@3688 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'tools')
-rw-r--r-- | tools/lpgen/translate.js | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/tools/lpgen/translate.js b/tools/lpgen/translate.js index 15f66736fe..bddfe8b5a0 100644 --- a/tools/lpgen/translate.js +++ b/tools/lpgen/translate.js @@ -9,7 +9,7 @@ //* Usage: cscript /nologo translate.js /path:"path\plugins" translated plugins folder*//
//* Usage: cscript /nologo translate.js /core:"path\=core=.txt" use core file *//
//* Usage: cscript /nologo translate.js /dupes:"path\=dupes=.txt" use dupes file *//
-//* Usage: cscript /nologo translate.js /out:"path\folder" output result to folder *//
+//* Usage: cscript /nologo translate.js /out:"path\plugins" output result to folder *//
//* Usage: cscript /nologo translate.js /outfile:"path\file" output result to one file*//
//* Usage: cscript /nologo translate.js /langpack:"path\lang.txt" - Full langpack *//
//* Usage: cscript /nologo translate.js /noref:"yes" - remove ref. ";file path\file" *//
@@ -186,17 +186,25 @@ function OutputFiles(TranslatedArray,UntranslatedArray,FileName) { TraslatedTemplateFile=trunk+"\\langpacks\\english\\plugins\\translated_"+FileName
UnTranslatedFile=trunk+"\\langpacks\\english\\plugins\\untranslated_"+FileName
- //redefine path to files, if FileName is a =CORE=.txt
- if (FileName=="=CORE=.txt") {
- TraslatedTemplateFile=trunk+"\\langpacks\\english\\translated_"+FileName;
- UnTranslatedFile=trunk+"\\langpacks\\english\\untranslated_"+FileName;
- }
-
//redefine path to files, if /out specified
if (out) {
TraslatedTemplateFile=out+"\\"+FileName;
UnTranslatedFile=out+"\\untranslated_"+FileName;
}
+
+ //redefine path to files, if FileName is a =CORE=.txt
+ if (FileName=="=CORE=.txt") {
+ TraslatedTemplateFile=trunk+"\\langpacks\\english\\translated_"+FileName;
+ UnTranslatedFile=trunk+"\\langpacks\\english\\untranslated_"+FileName;
+ if (out) {
+ //if /out:"/path/plugins" specified redefine path of translated and untranslated =CORE=.txt file to parent folder of specified path
+ TraslatedTemplateFile=FSO.BuildPath(FSO.GetParentFolderName(out),FileName);
+ //if /untranslated:"yes" specified, redefine untranslated core to parent folder, same as above.
+ UnTranslatedFile=FSO.BuildPath(FSO.GetParentFolderName(out),"untranslated_"+FileName);
+ }
+ //if /untralsated:"path/plugins" specified, redefine to parent folder with name "=CORE=.txt"
+ if (UnTranslatedPath!="yes") UnTranslatedFile=FSO.BuildPath(FSO.GetParentFolderName(UnTranslatedPath),FileName);
+ }
// output translated file if /out and /outfile ommited, or if /out specified
if ((!out && !outfile) || out) {
@@ -206,7 +214,8 @@ function OutputFiles(TranslatedArray,UntranslatedArray,FileName) { //Write untranslated array into file, if /untranslated specified and there is something in array
if (untranslated & UntranslatedArray.length>0) {
- if (UnTranslatedPath!="yes") UnTranslatedFile=UnTranslatedPath+"\\"+FileName;
+ //redefine Untranslated file path and name, if /untranslated:"/path/plugins" specified and this is not a =CORE=.txt file
+ if (UnTranslatedPath!="yes" && FileName!="=CORE=.txt") UnTranslatedFile=UnTranslatedPath+"\\"+FileName;
if (log) WScript.Echo("Untranslated in: "+UnTranslatedFile);
WriteToUnicodeFile(UntranslatedArray,UnTranslatedFile);
}
|