diff --git a/README.md b/README.md index d7098bb..6b3971c 100644 --- a/README.md +++ b/README.md @@ -51,93 +51,94 @@ XML and JSON filters are configurable ## Releases -Version | Comment | Release Date -:------:|---------|:-----------: -3.22.0 | Added option to ignore translatable SVG files when parsing DITA | September 26th, 2024 -3.21.0 | Fixed attributes parsing in HTML and improved JSON filter | August 29th, 2024 -3.20.0 | Improved region merging for Word documents | March 17th, 2024 -3.19.0 | Moved Language Tags handling to [BCP47J](https://github.com/rmraya/BCP47J) | March 7th, 2024 -3.18.0 | Fixed scope builder for DITA filter; removed Machine Translation engines | February 5th, 2024 -3.17.0 | Improved extraction from Word text boxes; switched to Java 21 | January 6th, 2024 -3.16.0 | Added catalog for XLIFF 2.2; adjusted ChatGPT models | October 29th, 2023 -3.15.0 | Added new options to JSON filter configuration | September 13th, 2023 -3.14.0 | Added option to generate XLIFF 2.1 | September 1st, 2023 -3.13.0 | Added export as TMX scripts; allowed relative paths from command line | August 27th, 2023 -3.12.0 | Improved JSON support and localization | August 16th, 2023 -3.11.0 | Improved SVG handling and language sorting | July 31st, 2023 -3.10.0 | Fixed TMX exports | July 10th, 2023 -3.9.0 | Improved Machine Translation support and internal code | June 30th, 2023 -3.8.0 | Improved localization handling | June 2nd, 2023 -3.7.0 | Extracted "alt" text from Word images | May 15th, 2023 -3.6.0 | Improved segmentation of XLIFF 2.0 | April 1st, 2023 -3.5.0 | Improved HTML filter | March 15th, 2023 -3.4.0 | Extracted localizable strings | February 27th, 2023 -3.3.0 | Detected loops while processing @keyref in DITA | February 20th, 2023 -3.2.0 | Improved file management | February 4th, 2023 -3.1.0 | Improved DITA merge | January 24th, 2023 -3.0.0 | Moved XML code to project [XMLJava](https://github.com/rmraya/XMLJava) | January 9th, 2023 -2.13.0 | Ignored tracked changes from Oxygen XML Editor | December 22nd, 2022 -2.12.0 | Added "xmlfilter" parameter to conversion options | December 5th, 2022 -2.11.0 | Improved support for DITA from Astoria CMS | December 2nd, 2022 -2.10.0 | Fixed DITA segmentation | November 22nd, 2022 -2.9.1 | Fixed joining of XLIFF 2.0 files and improved PHP Array support | October 22nd, 2022 -2.9.0 | Added support for PHP Arrays | October 21st, 2022 -2.8.0 | Updated TXLF, JSON and DITA filters | October 8th, 2022 -2.7.0 | Fixed resegmenter for XLIFF 2.0 | August 12th, 2022 -2.6.0 | Converted HTML fragments in Excel & Word files to tags | July 16th, 2022 -2.5.0 | Added configuration options to JSON filter; Added scripts to approve all segments; Updated language list | July 6th, 2022 -2.4.2 | Improved support for Trados Studio Packages | June 18th, 2022 -2.4.1 | Fixed conversion of third party XLIFF files | June 10th, 2022 -2.4.0 | Added remove all targets; added feedback for [Fluenta](https://www.maxprograms.com/products/fluenta.html) on DITA filter | June 9th, 2022 -2.3.0 | Added copy source to target; Fixed DITA conversion and merge | May 25th, 2022 -2.2.0 | Added pseudo-translation | May 11th, 2022 -2.1.0 | Updated dependencies and improved validation of XLIFF 2.x | April 21st, 2022 -2.0.0 | Moved server code to [XLIFF Manager](https://github.com/rmraya/XLIFFManager) project| March 29th, 2022 -1.17.5 | Updated DITA keyscope handling | March 18th, 2022 -1.17.4 | Fixed handling of nested untranslatables in DITA; Improved XLIFF 2.0 support | March 6th, 2022 -1.17.2 | Fixed support for FrameMaker MIF files | February 6th, 2022 -1.17.1 | Improved support for DITA | February 5th, 2022 -1.17.0 | Improved validation of XLIFF 2.0; Added SVG statistics for XLIFF 2.0 | December 1st, 2021 -1.16.0 | Improved support for XLIFF 2.0; Switched to Java 17 | November 23rd, 2021 -1.15.2 | MS Office and DITA fixes | November 13th, 2021 -1.15.0 | Initial support for RELAX NG gammars | November 8th, 2021 -1.14.0 | Improved segmentation for XLIFF 2.0 | October 3rd, 2021 -1.13.0 | Improved DITA support | August 31st, 2021 -1.12.7 | Improved round trip 1.2 -> 2.0 -> 1.2; Ignored untranslatable SVG in DITA maps | July 4th, 2021 -1.12.6 | Improved validation; updated language management | June 19th, 2021 -1.12.5 | Improved support for bilingual files | February 3rd, 2021 -1.12.4 | Allowed concurrent access for [XLIFF Validation](https://github.com/rmraya/XLIFFValidation) | January 22nd, 2021 -1.12.3 | Improved support for Trados Studio packages | January 1st, 2021 -1.12.2 | Suppressed output for confirmed empty targets | December 7th, 2020 -1.12.1 | Improved conversion of XLIFF 1.2 files | December 3rd, 2020 -1.12.0 | Added support for Adobe InCopy ICML and SRT subtitles | November 23rd, 2020 -1.11.1 | Fixed JSON encoding; fixed import of XLIFF matches | November 1st, 2020 -1.11.0 | Added support for JSON files | September 25, 2020 -1.10.1 | Fixed handling of TXLF files and improved XML catalog | September 5th, 2020 -1.10.0 | Added conversion of 3rd party XLIFF; improved support for XLIFF 2.0; fixed issues with Trados Studio packages | August 25th, 2020 -1.9.1 | Added improvements required by [Swordfish IV](https://github.com/rmraya/Swordfish). | August 13th, 2020 -1.9.0 | Added 5 Machine Translation (MT) engines (Google, Microsoft Azure, DeepL, MyMemory & Yandex) | May 18th, 2020 -1.8.4 | Improved catalog and other minor fixes | April 25th, 2020 -1.8.3 | Fixed conversion of PO files | April 17th, 2020 -1.8.2 | Switched to synchronized classes in XML package | April 10th, 2020 -1.8.1 | Improved support for Trados Studio packages | April 3rd, 2020 -1.8.0 | Implemented support for Trados Studio packages | March 29th, 2020 -1.7.0 | Major code cleanup; Changed segmentation model for XLIFF 2.0 | January 1st, 2020 -1.6.0 | Added support for XLIFF files from WPML WordPress Plugin | December 1st, 2019 -1.5.2 | Improved segmenter performance | October 29th, 2019 -1.5.1 | Fixed catalog on Windows | September 22nd, 2019 -1.5.0 | Improved support for empty <xref/> elements in DITA; improved support for XML catalogs | September 5th, 2019 -1.4.2 | Added option to join XLIFF files; Fixed merge errors in XLIFF 2.0; added tool info to XLIFF files; cleaned DITA attributes on merging | August 14th, 2019 -1.4.1 | Improved performance embedding skeleton; added Apache Ant building option; renamed module to 'openxliff' | July 25th, 2019 -1.4.0 | Improved report of task results | July 17th, 2019 -1.3.3 | Fixed merging of MS Office files from XLIFF 2.0 | July 5th, 2019 -1.3.2 | Updated for Swordfish 3.4.3 | June 30th, 2019 -1.3.1 | Updated for Swordfish 3.4-0 | April 30th, 2019 -1.3.0 | Added option to export approved XLIFF segments as TMX | April 18th, 2019 -1.2.1 | Improved validation of XLIFF 2.0 | April 6th, 2019 -1.2.0 | Added Translation Status Analysis | March 3rd, 2019 -1.1.0 | Incorporated XLIFFChecker code| November 20th, 2018 -1.0.0 | Initial Release | November 12th, 2018 +| Version | Comment | Release Date | +|:-------:|---------|:------------:| +|3.23.0 | Migrated `.bat` scripts to `.cmd` | October 24th, 2024| +|3.22.0 | Added option to ignore translatable SVG files when parsing DITA | September 26th, 2024| +|3.21.0 | Fixed attributes parsing in HTML and improved JSON filter | August 29th, 2024| +|3.20.0 | Improved region merging for Word documents | March 17th, 2024| +|3.19.0 | Moved Language Tags handling to [BCP47J](https://github.com/rmraya/BCP47J) | March 7th, 2024| +|3.18.0 | Fixed scope builder for DITA filter; removed Machine Translation engines | February 5th, 2024| +|3.17.0 | Improved extraction from Word text boxes; switched to Java 21 | January 6th, 2024| +|3.16.0 | Added catalog for XLIFF 2.2; adjusted ChatGPT models | October 29th, 2023| +|3.15.0 | Added new options to JSON filter configuration | September 13th, 2023| +|3.14.0 | Added option to generate XLIFF 2.1 | September 1st, 2023| +|3.13.0 | Added export as TMX scripts; allowed relative paths from command line | August 27th, 2023| +|3.12.0 | Improved JSON support and localization | August 16th, 2023| +|3.11.0 | Improved SVG handling and language sorting | July 31st, 2023| +|3.10.0 | Fixed TMX exports | July 10th, 2023| +|3.9.0 | Improved Machine Translation support and internal code | June 30th, 2023| +|3.8.0 | Improved localization handling | June 2nd, 2023| +|3.7.0 | Extracted "alt" text from Word images | May 15th, 2023| +|3.6.0 | Improved segmentation of XLIFF 2.0 | April 1st, 2023| +|3.5.0 | Improved HTML filter | March 15th, 2023| +|3.4.0 | Extracted localizable strings | February 27th, 2023| +|3.3.0 | Detected loops while processing @keyref in DITA | February 20th, 2023| +|3.2.0 | Improved file management | February 4th, 2023| +|3.1.0 | Improved DITA merge | January 24th, 2023| +|3.0.0 | Moved XML code to project [XMLJava](https://github.com/rmraya/XMLJava) | January 9th, 2023| +|2.13.0 | Ignored tracked changes from Oxygen XML Editor | December 22nd, 2022| +|2.12.0 | Added "xmlfilter" parameter to conversion options | December 5th, 2022| +|2.11.0 | Improved support for DITA from Astoria CMS | December 2nd, 2022| +|2.10.0 | Fixed DITA segmentation | November 22nd, 2022| +|2.9.1 | Fixed joining of XLIFF 2.0 files and improved PHP Array support | October 22nd, 2022| +|2.9.0 | Added support for PHP Arrays | October 21st, 2022| +|2.8.0 | Updated TXLF, JSON and DITA filters | October 8th, 2022| +|2.7.0 | Fixed resegmenter for XLIFF 2.0 | August 12th, 2022| +|2.6.0 | Converted HTML fragments in Excel & Word files to tags | July 16th, 2022| +|2.5.0 | Added configuration options to JSON filter; Added scripts to approve all segments; Updated language list | July 6th, 2022| +|2.4.2 | Improved support for Trados Studio Packages | June 18th, 2022| +|2.4.1 | Fixed conversion of third party XLIFF files | June 10th, 2022| +|2.4.0 | Added remove all targets; added feedback for [Fluenta](https://www.maxprograms.com/products/fluenta.html) on DITA filter | June 9th, 2022| +|2.3.0 | Added copy source to target; Fixed DITA conversion and merge | May 25th, 2022| +|2.2.0 | Added pseudo-translation | May 11th, 2022| +|2.1.0 | Updated dependencies and improved validation of XLIFF 2.x | April 21st, 2022| +|2.0.0 | Moved server code to [XLIFF Manager](https://github.com/rmraya/XLIFFManager) project| March 29th, 2022| +|1.17.5 | Updated DITA keyscope handling | March 18th, 2022| +|1.17.4 | Fixed handling of nested untranslatables in DITA; Improved XLIFF 2.0 support | March 6th, 2022| +|1.17.2 | Fixed support for FrameMaker MIF files | February 6th, 2022| +|1.17.1 | Improved support for DITA | February 5th, 2022| +|1.17.0 | Improved validation of XLIFF 2.0; Added SVG statistics for XLIFF 2.0 | December 1st, 2021| +|1.16.0 | Improved support for XLIFF 2.0; Switched to Java 17 | November 23rd, 2021| +|1.15.2 | MS Office and DITA fixes | November 13th, 2021| +|1.15.0 | Initial support for RELAX NG gammars | November 8th, 2021| +|1.14.0 | Improved segmentation for XLIFF 2.0 | October 3rd, 2021| +|1.13.0 | Improved DITA support | August 31st, 2021| +|1.12.7 | Improved round trip 1.2 -> 2.0 -> 1.2; Ignored untranslatable SVG in DITA maps | July 4th, 2021| +|1.12.6 | Improved validation; updated language management | June 19th, 2021| +|1.12.5 | Improved support for bilingual files | February 3rd, 2021| +|1.12.4 | Allowed concurrent access for [XLIFF Validation](https://github.com/rmraya/XLIFFValidation) | January 22nd, 2021| +|1.12.3 | Improved support for Trados Studio packages | January 1st, 2021| +|1.12.2 | Suppressed output for confirmed empty targets | December 7th, 2020| +|1.12.1 | Improved conversion of XLIFF 1.2 files | December 3rd, 2020| +|1.12.0 | Added support for Adobe InCopy ICML and SRT subtitles | November 23rd, 2020| +|1.11.1 | Fixed JSON encoding; fixed import of XLIFF matches | November 1st, 2020| +|1.11.0 | Added support for JSON files | September 25, 2020| +|1.10.1 | Fixed handling of TXLF files and improved XML catalog | September 5th, 2020| +|1.10.0 | Added conversion of 3rd party XLIFF; improved support for XLIFF 2.0; fixed issues with Trados Studio packages | August 25th, 2020| +|1.9.1 | Added improvements required by [Swordfish IV](https://github.com/rmraya/Swordfish). | August 13th, 2020| +|1.9.0 | Added 5 Machine Translation (MT) engines (Google, Microsoft Azure, DeepL, MyMemory & Yandex) | May 18th, 2020| +|1.8.4 | Improved catalog and other minor fixes | April 25th, 2020| +|1.8.3 | Fixed conversion of PO files | April 17th, 2020| +|1.8.2 | Switched to synchronized classes in XML package | April 10th, 2020| +|1.8.1 | Improved support for Trados Studio packages | April 3rd, 2020| +|1.8.0 | Implemented support for Trados Studio packages | March 29th, 2020| +|1.7.0 | Major code cleanup; Changed segmentation model for XLIFF 2.0 | January 1st, 2020| +|1.6.0 | Added support for XLIFF files from WPML WordPress Plugin | December 1st, 2019| +|1.5.2 | Improved segmenter performance | October 29th, 2019| +|1.5.1 | Fixed catalog on Windows | September 22nd, 2019| +|1.5.0 | Improved support for empty <xref/> elements in DITA; improved support for XML catalogs | September 5th, 2019| +|1.4.2 | Added option to join XLIFF files; Fixed merge errors in XLIFF 2.0; added tool info to XLIFF files; cleaned DITA attributes on merging | August 14th, 2019| +|1.4.1 | Improved performance embedding skeleton; added Apache Ant building option; renamed module to 'openxliff' | July 25th, 2019| +|1.4.0 | Improved report of task results | July 17th, 2019| +|1.3.3 | Fixed merging of MS Office files from XLIFF 2.0 | July 5th, 2019| +|1.3.2 | Updated for Swordfish 3.4.3 | June 30th, 2019| +|1.3.1 | Updated for Swordfish 3.4-0 | April 30th, 2019| +|1.3.0 | Added option to export approved XLIFF segments as TMX | April 18th, 2019| +|1.2.1 | Improved validation of XLIFF 2.0 | April 6th, 2019| +|1.2.0 | Added Translation Status Analysis | March 3rd, 2019| +|1.1.0 | Incorporated XLIFFChecker code| November 20th, 2018| +|1.0.0 | Initial Release | November 12th, 2018| ## Supported File Formats @@ -203,7 +204,7 @@ A binary distribution will be created in `/dist` folder. You can use the library in your own Java code. Conversion to XLIFF is handled by the class `com.maxprograms.converters.Convert`. -If you use binaries from the command line, running `.\convert.bat` or `./convert.sh` without parameters displays help for XLIFF generation. +If you use binaries from the command line, running `.\convert.cmd` or `./convert.sh` without parameters displays help for XLIFF generation. ```text Usage: @@ -282,12 +283,12 @@ Default XML catalog and SRX file are provided. You can also use custom versions You can convert XLIFF files created with OpenXLIFF Filters to original format using class `com.maxprograms.converters.Merge` in your Java code. -If you use binaries from the command line, running `.\merge.bat` or `./merge.sh` without parameters will display the information you need to merge an XLIFF file. +If you use binaries from the command line, running `.\merge.cmd` or `./merge.sh` without parameters will display the information you need to merge an XLIFF file. ```text Usage: - merge.bat [-help] [-version] -xliff xliffFile -target targetFile [-catalog catalogFile] [-unapproved] [-export] + merge.cmd [-help] [-version] -xliff xliffFile -target targetFile [-catalog catalogFile] [-unapproved] [-export] Where: @@ -310,12 +311,12 @@ All XLIFF 2.0 modules are validated using XML Schema validation in a first pass. You can validate XLIFF files using your own Java code. Validation of XLIFF files is handled by the class `com.maxprograms.validation.XliffChecker`. -If you use binaries from the command line, running `.\xliffchecker.bat` or `./xliffchecker.sh` without parameters displays help for XLIFF validation. +If you use binaries from the command line, running `.\xliffchecker.cmd` or `./xliffchecker.sh` without parameters displays help for XLIFF validation. ```text Usage: - xliffchecker.bat [-help] -file xliffFile [-catalog catalogFile] + xliffchecker.cmd [-help] -file xliffFile [-catalog catalogFile] Where: @@ -332,7 +333,7 @@ You can validate your XLIFF files online at [https://dev.maxprograms.com/Validat This library lets you produce an HTML file with word counts and segment status statistics from an XLIFF file. -If you use binaries from the command line, running `.\analysis.bat` or `./analysis.sh` without parameters displays help for statistics generation. +If you use binaries from the command line, running `.\analysis.cmd` or `./analysis.sh` without parameters displays help for statistics generation. You can generate statistics using your own Java code. Statistics generation is handled by the class `com.maxprograms.stats.RepetitionAnalysis`. @@ -354,7 +355,7 @@ The HTML report is generated in the folder where the XLIFF file is located and i You can combine several XLIFF files into a larger one using class `com.maxprograms.converters.Join` from your Java code or using the provided scripts. -Running `.\join.bat` or `./join.sh` without parameters displays help for joining files. +Running `.\join.cmd` or `./join.sh` without parameters displays help for joining files. ```text Usage: @@ -373,12 +374,12 @@ The merge process automatically splits the files when converting back to origina You can pseudo-translate all untranslated segments using class `com.maxprograms.converters.PseudoTranslation` from your Java code or using the provided scripts. -Running `.\pseudotranslate.bat` or `./pseudotranslate.sh` without parameters displays help for pseudo-translating an XLIFF file. +Running `.\pseudotranslate.cmd` or `./pseudotranslate.sh` without parameters displays help for pseudo-translating an XLIFF file. ```text Usage: - pseudotranslate.bat [-help] -xliff xliffFile [-catalog catalogFile] + pseudotranslate.cmd [-help] -xliff xliffFile [-catalog catalogFile] Where: @@ -391,12 +392,12 @@ Where: You can copy the content of `` elements to new `` elements for all untranslated segments using class `com.maxprograms.converters.CopySources` from your Java code or using the provided scripts. -Running `.\copysources.bat` or `./copysources.sh` without parameters displays help for copying source to target in an XLIFF file. +Running `.\copysources.cmd` or `./copysources.sh` without parameters displays help for copying source to target in an XLIFF file. ```text Usage: - copysources.bat [-help] -xliff xliffFile [-catalog catalogFile] + copysources.cmd [-help] -xliff xliffFile [-catalog catalogFile] Where: @@ -409,12 +410,12 @@ Where: You can set all `` or `` elements as `approved` or `final` if they contain target text using class `com.maxprograms.converters.ApproveAll` from your Java code or using the provided scripts. -Running `.\approveall.bat` or `./approveall.sh` without parameters displays help for approving or confirming all segments in an XLIFF file. +Running `.\approveall.cmd` or `./approveall.sh` without parameters displays help for approving or confirming all segments in an XLIFF file. ```text Usage: - approveall.bat [-help] -xliff xliffFile [-catalog catalogFile] + approveall.cmd [-help] -xliff xliffFile [-catalog catalogFile] Where: @@ -427,12 +428,12 @@ Where: You can remove`` elements from all `` or `` elements using class `com.maxprograms.converters.RemoveTargets` from your Java code or using the provided scripts. -Running `.\removetargets.bat` or `./removetargets.sh` without parameters displays help for removing targets from an XLIFF file. +Running `.\removetargets.cmd` or `./removetargets.sh` without parameters displays help for removing targets from an XLIFF file. ```text Usage: - removetargets.bat [-help] -xliff xliffFile [-catalog catalogFile] + removetargets.cmd [-help] -xliff xliffFile [-catalog catalogFile] Where: @@ -445,7 +446,7 @@ Where: You can export all aproved segments from an XLIFF file as TMX using class `com.maxprograms.converters.TmxExporter` from your Java code or using the provided scripts. -Running `.\exporttmx.bat` or `./exporttmx.sh` without parameters displays help for exporting approved segments from an XLIFF file. +Running `.\exporttmx.cmd` or `./exporttmx.sh` without parameters displays help for exporting approved segments from an XLIFF file. ```text Usage: diff --git a/analysis.bat b/analysis.cmd similarity index 100% rename from analysis.bat rename to analysis.cmd diff --git a/approveall.bat b/approveall.cmd similarity index 100% rename from approveall.bat rename to approveall.cmd diff --git a/build.xml b/build.xml index 68a5a93..d79e391 100644 --- a/build.xml +++ b/build.xml @@ -43,17 +43,17 @@ - Copy .bat to /dist - - - - - - - - - - + Copy .cmd to /dist + + + + + + + + + + Copy .sh to /dist diff --git a/convert.bat b/convert.cmd similarity index 97% rename from convert.bat rename to convert.cmd index c934d96..cf5d83e 100644 --- a/convert.bat +++ b/convert.cmd @@ -1,5 +1,5 @@ -@echo off -pushd "%~dp0" -set OpenXLIFF_HOME=%CD% -popd +@echo off +pushd "%~dp0" +set OpenXLIFF_HOME=%CD% +popd %OpenXLIFF_HOME%\bin\java.exe --module-path %OpenXLIFF_HOME%\lib -m openxliff/com.maxprograms.converters.Convert %* \ No newline at end of file diff --git a/copysources.bat b/copysources.cmd similarity index 100% rename from copysources.bat rename to copysources.cmd diff --git a/exporttmx.bat b/exporttmx.cmd similarity index 100% rename from exporttmx.bat rename to exporttmx.cmd diff --git a/join.bat b/join.cmd similarity index 100% rename from join.bat rename to join.cmd diff --git a/lib/openxliff.jar b/lib/openxliff.jar index 77ebf5d..f2a8fcf 100644 Binary files a/lib/openxliff.jar and b/lib/openxliff.jar differ diff --git a/merge.bat b/merge.cmd similarity index 97% rename from merge.bat rename to merge.cmd index 6b37c5d..82c0e1f 100644 --- a/merge.bat +++ b/merge.cmd @@ -1,5 +1,5 @@ -@echo off -pushd "%~dp0" -set OpenXLIFF_HOME=%CD% -popd +@echo off +pushd "%~dp0" +set OpenXLIFF_HOME=%CD% +popd %OpenXLIFF_HOME%\bin\java.exe --module-path %OpenXLIFF_HOME%\lib -m openxliff/com.maxprograms.converters.Merge %* \ No newline at end of file diff --git a/pseudotranslate.bat b/pseudotranslate.cmd similarity index 100% rename from pseudotranslate.bat rename to pseudotranslate.cmd diff --git a/removetargets.bat b/removetargets.cmd similarity index 100% rename from removetargets.bat rename to removetargets.cmd diff --git a/src/com/maxprograms/converters/ApproveAll.java b/src/com/maxprograms/converters/ApproveAll.java index 024b649..956aaa1 100644 --- a/src/com/maxprograms/converters/ApproveAll.java +++ b/src/com/maxprograms/converters/ApproveAll.java @@ -93,7 +93,8 @@ public static void main(String[] args) { private static void help() { MessageFormat mf = new MessageFormat(Messages.getString("ApproveAll.help")); - String help = mf.format(new String[] { "\\".equals(File.pathSeparator) ? "approveall.bat" : "approveall.sh" }); + boolean isWindows = System.getProperty("os.name").toLowerCase().contains("windows"); + String help = mf.format(new String[] { isWindows ? "approveall.cmd" : "approveall.sh" }); System.out.println(help); } diff --git a/src/com/maxprograms/converters/Constants.java b/src/com/maxprograms/converters/Constants.java index c3b0b49..bc91800 100644 --- a/src/com/maxprograms/converters/Constants.java +++ b/src/com/maxprograms/converters/Constants.java @@ -21,8 +21,8 @@ private Constants() { public static final String TOOLID = "OpenXLIFF"; public static final String TOOLNAME = "OpenXLIFF Filters"; - public static final String VERSION = "3.22.0"; - public static final String BUILD = "20240926_0709"; + public static final String VERSION = "3.23.0"; + public static final String BUILD = "20241024_0743"; public static final String SUCCESS = "0"; public static final String ERROR = "1"; diff --git a/src/com/maxprograms/converters/Convert.java b/src/com/maxprograms/converters/Convert.java index 3d8b0f3..c525460 100644 --- a/src/com/maxprograms/converters/Convert.java +++ b/src/com/maxprograms/converters/Convert.java @@ -281,7 +281,7 @@ public static void main(String[] args) { if (xliff.isEmpty()) { xliff = sourceFile.getAbsoluteFile().getAbsolutePath() + ".xlf"; } - + if (xliff20 && xliff21) { logger.log(Level.ERROR, Messages.getString("Convert.21")); return; @@ -337,7 +337,8 @@ public static void main(String[] args) { private static void help() { MessageFormat mf = new MessageFormat(Messages.getString("Convert.help")); - String help = mf.format(new String[] { "\\".equals(File.pathSeparator) ? "convert.bat" : "convert.sh" }); + boolean isWindows = System.getProperty("os.name").toLowerCase().contains("windows"); + String help = mf.format(new String[] { isWindows ? "convert.cmd" : "convert.sh" }); System.out.println(help); } diff --git a/src/com/maxprograms/converters/CopySources.java b/src/com/maxprograms/converters/CopySources.java index 52b5c95..de30f3b 100644 --- a/src/com/maxprograms/converters/CopySources.java +++ b/src/com/maxprograms/converters/CopySources.java @@ -95,9 +95,10 @@ public static void main(String[] args) { } private static void help() { - MessageFormat mf = new MessageFormat(Messages.getString("CopySources.help")); - String help = mf.format(new String[] { "\\".equals(File.pathSeparator) ? "copysources.bat" : "copysources.sh" }); - System.out.println(help); + MessageFormat mf = new MessageFormat(Messages.getString("CopySources.help")); + boolean isWindows = System.getProperty("os.name").toLowerCase().contains("windows"); + String help = mf.format(new String[] { isWindows ? "copysources.cmd" : "copysources.sh" }); + System.out.println(help); } public static void copySources(String xliff, String catalog) diff --git a/src/com/maxprograms/converters/Join.java b/src/com/maxprograms/converters/Join.java index 1183d92..e005908 100644 --- a/src/com/maxprograms/converters/Join.java +++ b/src/com/maxprograms/converters/Join.java @@ -84,10 +84,10 @@ public static void main(String[] args) { } } - File targetFile = new File(target); - if (!targetFile.isAbsolute()) { - target = targetFile.getAbsoluteFile().getAbsolutePath(); - } + File targetFile = new File(target); + if (!targetFile.isAbsolute()) { + target = targetFile.getAbsoluteFile().getAbsolutePath(); + } try { join(list, target); } catch (IOException | SAXException | ParserConfigurationException ex) { @@ -97,7 +97,8 @@ public static void main(String[] args) { private static void help() { MessageFormat mf = new MessageFormat(Messages.getString("Join.help")); - String help = mf.format(new String[] { "\\".equals(File.pathSeparator) ? "join.bat" : "join.sh" }); + boolean isWindows = System.getProperty("os.name").toLowerCase().contains("windows"); + String help = mf.format(new String[] { isWindows ? "join.cmd" : "join.sh" }); System.out.println(help); } diff --git a/src/com/maxprograms/converters/Merge.java b/src/com/maxprograms/converters/Merge.java index 4e62b2a..19e885e 100644 --- a/src/com/maxprograms/converters/Merge.java +++ b/src/com/maxprograms/converters/Merge.java @@ -145,7 +145,7 @@ public static void main(String[] args) { File catalogFolder = new File(new File(home), "catalog"); if (!catalogFolder.exists()) { MessageFormat mf = new MessageFormat(Messages.getString("Merge.05")); - logger.log(Level.ERROR, mf.format(new String[]{catalogFolder.getAbsolutePath()})); + logger.log(Level.ERROR, mf.format(new String[] { catalogFolder.getAbsolutePath() })); return; } catalog = new File(catalogFolder, "catalog.xml").getAbsolutePath(); @@ -170,7 +170,7 @@ public static void main(String[] args) { } if (!Constants.SUCCESS.equals(result.get(0))) { MessageFormat mf = new MessageFormat(Messages.getString("Merge.07")); - logger.log(Level.ERROR, mf.format(new String[]{result.get(1)})); + logger.log(Level.ERROR, mf.format(new String[] { result.get(1) })); } } @@ -265,7 +265,8 @@ public static List merge(String xliff, String target, String catalog, bo private static void help() { MessageFormat mf = new MessageFormat(Messages.getString("Merge.help")); - String help = mf.format(new String[] { "\\".equals(File.pathSeparator) ? "merge.bat" : "merge.sh" }); + boolean isWindows = System.getProperty("os.name").toLowerCase().contains("windows"); + String help = mf.format(new String[] { isWindows ? "merge.cmd" : "merge.sh" }); System.out.println(help); } diff --git a/src/com/maxprograms/converters/PseudoTranslation.java b/src/com/maxprograms/converters/PseudoTranslation.java index 39fe3f2..e563727 100644 --- a/src/com/maxprograms/converters/PseudoTranslation.java +++ b/src/com/maxprograms/converters/PseudoTranslation.java @@ -65,9 +65,9 @@ public static void main(String[] args) { } if (catalog.isEmpty()) { String home = System.getenv("OpenXLIFF_HOME"); - if (home == null) { - home = System.getProperty("user.dir"); - } + if (home == null) { + home = System.getProperty("user.dir"); + } File catalogFolder = new File(new File(home), "catalog"); if (!catalogFolder.exists()) { logger.log(Level.ERROR, Messages.getString("PseudoTranslation.1")); @@ -95,9 +95,10 @@ public static void main(String[] args) { } private static void help() { - MessageFormat mf = new MessageFormat(Messages.getString("PseudoTranslation.help")); - String help = mf.format(new String[] { "\\".equals(File.pathSeparator) ? "pseudotranslate.bat" : "pseudotranslate.sh" }); - System.out.println(help); + MessageFormat mf = new MessageFormat(Messages.getString("PseudoTranslation.help")); + boolean isWindows = System.getProperty("os.name").toLowerCase().contains("windows"); + String help = mf.format(new String[] { isWindows ? "pseudotranslate.cmd" : "pseudotranslate.sh" }); + System.out.println(help); } public static void pseudoTranslate(String xliff, String catalog) diff --git a/src/com/maxprograms/converters/RemoveTargets.java b/src/com/maxprograms/converters/RemoveTargets.java index 9895cbe..1789c37 100644 --- a/src/com/maxprograms/converters/RemoveTargets.java +++ b/src/com/maxprograms/converters/RemoveTargets.java @@ -60,9 +60,9 @@ public static void main(String[] args) { } if (catalog.isEmpty()) { String home = System.getenv("OpenXLIFF_HOME"); - if (home == null) { - home = System.getProperty("user.dir"); - } + if (home == null) { + home = System.getProperty("user.dir"); + } File catalogFolder = new File(new File(home), "catalog"); if (!catalogFolder.exists()) { logger.log(Level.ERROR, Messages.getString("RemoveTargets.1")); @@ -77,7 +77,7 @@ public static void main(String[] args) { } if (!catalogFile.isAbsolute()) { catalog = catalogFile.getAbsoluteFile().getAbsolutePath(); - } + } File xliffFile = new File(xliff); if (!xliffFile.isAbsolute()) { xliff = xliffFile.getAbsoluteFile().getAbsolutePath(); @@ -130,9 +130,10 @@ private static void recurse(Element root) { } private static void help() { - MessageFormat mf = new MessageFormat(Messages.getString("RemoveTargets.help")); - String help = mf.format(new String[] { "\\".equals(File.pathSeparator) ? "removetargets.bat" : "removetargets.sh" }); - System.out.println(help); + MessageFormat mf = new MessageFormat(Messages.getString("RemoveTargets.help")); + boolean isWindows = System.getProperty("os.name").toLowerCase().contains("windows"); + String help = mf.format(new String[] { isWindows ? "removetargets.cmd" : "removetargets.sh" }); + System.out.println(help); } } diff --git a/src/com/maxprograms/converters/TmxExporter.java b/src/com/maxprograms/converters/TmxExporter.java index 1517186..2a5aa94 100755 --- a/src/com/maxprograms/converters/TmxExporter.java +++ b/src/com/maxprograms/converters/TmxExporter.java @@ -121,15 +121,14 @@ public static void main(String[] args) { if (tmx.isEmpty()) { tmx = xliff + ".tmx"; } - + export(xliff, tmx, catalog); } private static void help() { - MessageFormat mf = new MessageFormat( - Messages.getString("TmxExporter.3")); - String help = mf.format( - new String[] { "\\".equals(File.pathSeparator) ? "exporttmx.bat" : "exporttmx.sh" }); + MessageFormat mf = new MessageFormat(Messages.getString("TmxExporter.3")); + boolean isWindows = System.getProperty("os.name").toLowerCase().contains("windows"); + String help = mf.format(new String[] { isWindows ? "exporttmx.cmd" : "exporttmx.sh" }); System.out.println(help); } diff --git a/src/com/maxprograms/stats/RepetitionAnalysis.java b/src/com/maxprograms/stats/RepetitionAnalysis.java index 63a0115..c47e0fb 100755 --- a/src/com/maxprograms/stats/RepetitionAnalysis.java +++ b/src/com/maxprograms/stats/RepetitionAnalysis.java @@ -105,7 +105,8 @@ public static void main(String[] args) { private static void help() { MessageFormat mf = new MessageFormat(Messages.getString("RepetitionAnalysis.help")); - String help = mf.format(new String[] { "\\".equals(File.pathSeparator) ? "analysis.bat" : "analysis.sh" }); + boolean isWindows = System.getProperty("os.name").toLowerCase().contains("windows"); + String help = mf.format(new String[] { isWindows? "analysis.cmd" : "analysis.sh" }); System.out.println(help); } diff --git a/src/com/maxprograms/validation/XliffChecker.java b/src/com/maxprograms/validation/XliffChecker.java index eebc2a4..71ea679 100644 --- a/src/com/maxprograms/validation/XliffChecker.java +++ b/src/com/maxprograms/validation/XliffChecker.java @@ -135,7 +135,8 @@ public static void main(String[] args) { private static void help() { MessageFormat mf = new MessageFormat(Messages.getString("XliffChecker.help")); - String help = mf.format(new String[] { "\\".equals(File.pathSeparator) ? "xliffchecker.bat" : "xliffchecker.sh" }); + boolean isWindows = System.getProperty("os.name").toLowerCase().contains("windows"); + String help = mf.format(new String[] { isWindows ? "xliffchecker.cmd" : "xliffchecker.sh" }); System.out.println(help); } diff --git a/xliffchecker.bat b/xliffchecker.cmd similarity index 97% rename from xliffchecker.bat rename to xliffchecker.cmd index 9f8b68e..96eac91 100644 --- a/xliffchecker.bat +++ b/xliffchecker.cmd @@ -1,5 +1,5 @@ -@echo off -pushd "%~dp0" -set OpenXLIFF_HOME=%CD% -popd +@echo off +pushd "%~dp0" +set OpenXLIFF_HOME=%CD% +popd %OpenXLIFF_HOME%\bin\java.exe --module-path %OpenXLIFF_HOME%\lib -m openxliff/com.maxprograms.validation.XliffChecker %* \ No newline at end of file