diff --git a/.gitignore b/.gitignore index adb690e..d137c54 100644 --- a/.gitignore +++ b/.gitignore @@ -383,3 +383,4 @@ $RECYCLE.BIN/ compile_commands.json src/internal/version.hpp +.vscode/ \ No newline at end of file diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json deleted file mode 100644 index 1c49144..0000000 --- a/.vscode/c_cpp_properties.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "configurations": [ - { - "name": "Linux", - "includePath": [ - "${workspaceFolder}/**" - ], - "defines": [], - "compilerPath": "/usr/bin/gcc", - "cStandard": "c17", - "cppStandard": "gnu++14", - "intelliSenseMode": "linux-gcc-x64", - "configurationProvider": "ms-vscode.cmake-tools" - } - ], - "version": 4 -} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index b7c0ceb..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "configurations": [ - { - "name": "(gdb) Launch", - "type": "cppdbg", - "request": "launch", - "program": "${workspaceFolder}/build/src/qTsConverter", - "args": [], - "stopAtEntry": false, - "cwd": "${fileDirname}", - "environment": [], - "externalConsole": false, - "MIMode": "gdb", - "setupCommands": [ - { - "description": "Enable pretty-printing for gdb", - "text": "-enable-pretty-printing", - "ignoreFailures": true - }, - { - "description": "Set Disassembly Flavor to Intel", - "text": "-gdb-set disassembly-flavor intel", - "ignoreFailures": true - } - ] - } - ], - "version": "2.0.0" -} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index e5dc6cb..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "files.associations": { - "array": "cpp", - "*.tcc": "cpp", - "future": "cpp" - } -} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json deleted file mode 100644 index 08d9005..0000000 --- a/.vscode/tasks.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "tasks": [ - { - "type": "cppbuild", - "label": "C/C++: gcc build active file", - "command": "/usr/bin/gcc", - "args": [ - "-fdiagnostics-color=always", - "-g", - "${file}", - "-o", - "${fileDirname}/${fileBasenameNoExtension}" - ], - "options": { - "cwd": "${fileDirname}" - }, - "problemMatcher": [ - "$gcc" - ], - "group": { - "kind": "build", - "isDefault": true - }, - "detail": "Task generated by Debugger." - } - ], - "version": "2.0.0" -} \ No newline at end of file diff --git a/README.md b/README.md index e3932e0..86484ab 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,18 @@ the cli can be invoked with two command line switches. ```bash qTsConverter --no-version --no-location ../../tests/files/scenario_multiline.ts ./lol.xlsx ``` +To create an excel file for each ts file in a folder, +a bash script can be invoked. +```bash +./scripts/ts-to-xlsx.sh /path/to/ts-files ./build/src/ +``` +To create a ts file for each excel file in a folder, +a bash script can be invoked. +```bash +./scripts/xlsx-to-ts.sh /path/to/xlsx-files ./build/src/ +``` + + ## Build @@ -53,6 +65,12 @@ cd build cmake -DBUILD_CLI:BOOL=ON -DCMAKE_PREFIX_PATH=/home/guerra/Qt/5.15.2/gcc_64/ .. cmake --build . ``` +or alternatively use script +```bash +cd scripts +./compile-cli.sh +``` + ### Linux Compile from source and install: @@ -99,8 +117,9 @@ cmake --install build_win_release ``` ## -Example of supported TS file: +Example of supported TS file and its features (for reference see https://doc.qt.io/qt-6/linguist-ts-file-format.html): +```xml @@ -119,4 +138,4 @@ Example of supported TS file: - +``` diff --git a/src/internal/TitleHeaders.hpp b/src/internal/TitleHeaders.hpp index ae737e9..002b01c 100644 --- a/src/internal/TitleHeaders.hpp +++ b/src/internal/TitleHeaders.hpp @@ -14,28 +14,3 @@ struct TitleHeader { static constexpr char TranslatorComment[] = "translatorcomment"; static constexpr char TranslationType[] = "TranslationType"; }; - - -/* - -EXAMPLE - Expanded - - - - - - context a - - - source example - comment example - extra comment example - translator comment example - translation example - - Beispiel1 - Beispiel2 - - - - */ diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 2ec53c1..54732e1 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -29,7 +29,7 @@ target_link_libraries( target_link_libraries( tst_xlsx2ts PUBLIC internal - PRIVATE Qt5::Core Qt5::Gui Qt5::Xml + PRIVATE Qt5::Core Qt5::Gui Qt5::Quick Qt5::Widgets Qt5::Xml PUBLIC qtcsv QtXlsxWriter) add_definitions(-DFILESPATH=\"${CMAKE_CURRENT_SOURCE_DIR}/files\") diff --git a/tests/files/scenario_multilocation.xlsx b/tests/files/scenario_multilocation.xlsx index ddb23a7..01a4d0f 100644 Binary files a/tests/files/scenario_multilocation.xlsx and b/tests/files/scenario_multilocation.xlsx differ diff --git a/tests/tst_xlsx2ts.cpp b/tests/tst_xlsx2ts.cpp index 6174ab6..73f4def 100644 --- a/tests/tst_xlsx2ts.cpp +++ b/tests/tst_xlsx2ts.cpp @@ -1,16 +1,20 @@ #include "ConverterFactory.hpp" #include "util.hpp" +#include + auto main() -> int { bool ret = false; + QApplication::setApplicationVersion("5.0.0"); + ret |= !test_conversion("scenario_after_version_4_5_0.xlsx", "scenario_simple.ts", ConverterFactory::ConversionType::Xlsx2Ts); - -/* ret |= !test_conversion("scenario_multilocation.xlsx", + + ret |= !test_conversion("scenario_multilocation.xlsx", "scenario_multilocation.ts", ConverterFactory::ConversionType::Xlsx2Ts); - */ + return static_cast(ret); }