Merge branch 'relax-xml'
This commit is contained in:
commit
1cc7b40a94
@ -18,7 +18,8 @@
|
|||||||
#
|
#
|
||||||
###
|
###
|
||||||
|
|
||||||
find_package( Qt5 ${QT_VERSION} CONFIG REQUIRED Xml )
|
find_package(Qt5 COMPONENTS Xml)
|
||||||
|
if( Qt5Xml_FOUND )
|
||||||
add_executable(txload txload.cpp)
|
add_executable(txload txload.cpp)
|
||||||
target_link_libraries(txload Qt5::Xml)
|
target_link_libraries(txload Qt5::Xml)
|
||||||
|
endif()
|
||||||
|
@ -16,6 +16,11 @@
|
|||||||
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Tool to find differences between translations (can be used to help
|
||||||
|
* merging them into one). See usage string, below, for details.
|
||||||
|
*/
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
@ -23,6 +28,16 @@
|
|||||||
|
|
||||||
#include <QDomDocument>
|
#include <QDomDocument>
|
||||||
|
|
||||||
|
static const char usage[] = "Usage: txload <master> [<subsidiary> ...]\n"
|
||||||
|
"\n"
|
||||||
|
"Reads a .ts source file <master> and zero or more .ts <subsidiary>\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)
|
bool load_file(const char* filename, QDomDocument& doc)
|
||||||
{
|
{
|
||||||
QFile file(filename);
|
QFile file(filename);
|
||||||
@ -158,7 +173,10 @@ int main(int argc, char** argv)
|
|||||||
QCoreApplication a(argc, argv);
|
QCoreApplication a(argc, argv);
|
||||||
|
|
||||||
if (argc < 2)
|
if (argc < 2)
|
||||||
|
{
|
||||||
|
qWarning() << usage;
|
||||||
return 1;
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
QDomDocument doc("master");
|
QDomDocument doc("master");
|
||||||
if ( !load_file(argv[1], doc) )
|
if ( !load_file(argv[1], doc) )
|
||||||
|
Loading…
Reference in New Issue
Block a user