From d7f0a1b93781fa77bcec0ea9dd1c3f90512c072b Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 11 Dec 2018 13:55:31 +0100 Subject: [PATCH 1/2] [lang] Xml could be option, this is developer tooling after all --- lang/CMakeLists.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lang/CMakeLists.txt b/lang/CMakeLists.txt index 65c0c4ca2..37ea8356c 100644 --- a/lang/CMakeLists.txt +++ b/lang/CMakeLists.txt @@ -18,7 +18,8 @@ # ### -find_package( Qt5 ${QT_VERSION} CONFIG REQUIRED Xml ) - -add_executable(txload txload.cpp) -target_link_libraries(txload Qt5::Xml) +find_package(Qt5 COMPONENTS Xml) +if( Qt5Xml_FOUND ) + add_executable(txload txload.cpp) + target_link_libraries(txload Qt5::Xml) +endif() From 33c5baa9f31bef11ac62ccf230ad410b17c509b9 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 11 Dec 2018 14:03:18 +0100 Subject: [PATCH 2/2] [lang] Add usage information - This developer tool was originally committed with a not-useful commit message, no usage info, and no documentation. Bad [ade]. --- lang/txload.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lang/txload.cpp b/lang/txload.cpp index 51b9dacb1..36e0f71a2 100644 --- a/lang/txload.cpp +++ b/lang/txload.cpp @@ -16,6 +16,11 @@ * along with Calamares. If not, see . */ +/* + * Tool to find differences between translations (can be used to help + * merging them into one). See usage string, below, for details. + */ + #include #include #include @@ -23,6 +28,16 @@ #include +static const char usage[] = "Usage: txload [ ...]\n" + "\n" + "Reads a .ts source file and zero or more .ts \n" + "files, and does a comparison between the translations. Source (English)\n" + "strings that are untranslated are flagged in each of the translation\n" + "files, while differences in the translations are themselves also shown.\n" + "\n" + "Outputs to stdout a human-readable list of differences between the\n" + "translations.\n"; + bool load_file(const char* filename, QDomDocument& doc) { QFile file(filename); @@ -158,7 +173,10 @@ int main(int argc, char** argv) QCoreApplication a(argc, argv); if (argc < 2) + { + qWarning() << usage; return 1; + } QDomDocument doc("master"); if ( !load_file(argv[1], doc) )