From 5b6d39548266a68fb41e926665017c1d10af28d6 Mon Sep 17 00:00:00 2001 From: s-t-e-f-a-n Date: Wed, 10 Jul 2024 00:32:34 +0200 Subject: [PATCH] Test tst_xlsx2ts up and running Added description for scripts compile-cli.sh in readme Added description for scripts ts-to-xlsx.sh and xlsx-to-ts.sh in readme both for stack conversion of folder content Removed .vscode stuff --- .gitignore | 1 + .vscode/c_cpp_properties.json | 17 -------------- .vscode/launch.json | 29 ------------------------ .vscode/settings.json | 7 ------ .vscode/tasks.json | 28 ----------------------- README.md | 23 +++++++++++++++++-- src/internal/TitleHeaders.hpp | 25 -------------------- tests/CMakeLists.txt | 2 +- tests/files/scenario_multilocation.xlsx | Bin 5529 -> 5719 bytes tests/tst_xlsx2ts.cpp | 10 +++++--- 10 files changed, 30 insertions(+), 112 deletions(-) delete mode 100644 .vscode/c_cpp_properties.json delete mode 100644 .vscode/launch.json delete mode 100644 .vscode/settings.json delete mode 100644 .vscode/tasks.json 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 ddb23a7a9933e754b2e39a3d6adcad7f844e613b..01a4d0f7c6a6971c7e2dbbd53c46a2456f4c9004 100644 GIT binary patch delta 1831 zcmZ8h3pms3AOCG`%aGY(LmFEhxy+E0wX~u$B9~nH=Pdq?_#3w4nh0%lo7~R)WYH)r za#V6z{=iFi#kt4r@pM&dEIK@mZgdBv?-4YRzy6% z2H$iMO6?18U{S#MMMiE}>-yyd@`Xq3Imj0)6Xa=4&-#rWfsNl+TzyrF_aht1mU3st zM|bv`Iys%(W;4|K(ZFYgkRu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Uz$E|W9lKKv+ZX&5ZTys!HbZmkHE^7ogylF2 zFr+;-ZRB|>!7WA#loI1EvgPhVzccx`%)WnHD_dBgA9}T7okV`uur?RlkC-WU01UPN z$b&}FY8ZOxzXsr-b!6|s2MN$DLF>A?(WX?)?7A(!2!h2BeYIZP;Qo%QA_(& zXfKoY#s}dM&>fx=yF{Q29wB%Z160Fv(rRMe2XK!QI1Jc&U|l>F + 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); }