guerinoni / qtsconverter Goto Github PK
View Code? Open in Web Editor NEWA simple tool to convert qt translation file (ts) to other format (xlsx / csv) and vice versa
License: MIT License
A simple tool to convert qt translation file (ts) to other format (xlsx / csv) and vice versa
License: MIT License
Wrong initial folder
When browse file button is clicked, it always start in a local build folder, instead of the folder that is selected into the line edit field
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The folder shown is not the last selected folder
Desktop (please complete the following information):
The export of multiple languages requires a lot of actions on the user sides
If I need to export multiple languages from excel files I need to create multiples copies of the same file, and convert one by one the excel files to ts files.
Suggestion
Instead of using the Translation keyword in the excel files, use directly the language codes (e.g.: en_GB, en_US, fr_FR ....)
Convert Ts to Excel
The same feature could be usefule when importing the multiple ts files to a unique excel files
Different revisions of the ts files
I spend a lot of time, updating the master language excel files, it would be nice, If I could choose to update an excel files, based on updated ts files.
Remove unused sources and translations
Add an option to remove translations that are not used anymore, removing the translations from the excel files
Please add Qt6 compatibility. CMake still requires Qt5 to build this application.
When it creates a TS file starting from CSV there is hardcoded version and language but is better extract this parameter, like field separator and string delimiter, to GUI
Describe the bug
When trying to convert a .csv back into a .ts file the application crashes due to a segmentation fault.
The .ts file contains multiple \n
characters that apparently break the CSV parser.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A .ts file identical to the initial one should be generated
Desktop (please complete the following information):
GDB backtrace:
ASSERT: "!isEmpty()" in file /home/maze/.local/lib/Qt/5.15.2/gcc_64/include/QtCore/qlist.h, line 361
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:49
#1 0x00007ffff580c864 in __GI_abort () at abort.c:79
#2 0x00007ffff6c489bc in qErrnoWarning(char const*, ...) () at /home/maze/.local/lib/Qt/5.15.2/gcc_64/lib/libQt5Core.so.5
#3 0x00007ffff6c480bb in qt_assert_x(char const*, char const*, char const*, int) () at /home/maze/.local/lib/Qt/5.15.2/gcc_64/lib/libQt5Core.so.5
#4 0x000055555556e07a in QList<QString>::first() (this=0x55555650b158) at /home/maze/.local/lib/Qt/5.15.2/gcc_64/include/QtCore/qlist.h:361
#5 0x000055555556c458 in CsvParser::removeEmptyFrontBack(QList<QStringList>&) const (this=0x555556508a40, list=...) at ../src/internal/CsvParser.cpp:69
#6 0x000055555556bcd3 in CsvParser::parse() const (this=0x555556508a40) at ../src/internal/CsvParser.cpp:20
#7 0x0000555555566648 in Converter::process() const (this=0x555556506530) at ../src/internal/Converter.cpp:12
#8 0x0000555555562e91 in ConverterGuiProxy::convert(ConverterGuiProxy::QConversionType, QString, QString, QString const&, QString const&, QString const&)
(this=0x7fffffffc290, type=ConverterGuiProxy::Csv2Ts, input=..., output=..., fieldSeparator=..., stringSeparator=..., tsVersion=...) at ../src/internal/ConverterGuiProxy.cpp:20
#9 0x0000555555562575 in ConverterGuiProxy::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=0x7fffffffc290, _c=QMetaObject::InvokeMetaMethod, _id=1, _a=0x7fffffff92e0)
at src/internal/internal_autogen/EWIEGA46WW/moc_ConverterGuiProxy.cpp:121
#10 0x000055555556281f in ConverterGuiProxy::qt_metacall(QMetaObject::Call, int, void**) (this=0x7fffffffc290, _c=QMetaObject::InvokeMetaMethod, _id=1, _a=0x7fffffff92e0)
at src/internal/internal_autogen/EWIEGA46WW/moc_ConverterGuiProxy.cpp:181
#11 0x00007ffff5ebc349 in QQmlObjectOrGadget::metacall(QMetaObject::Call, int, void**) const () at /home/maze/.local/lib/Qt/5.15.2/gcc_64/lib/libQt5Qml.so.5
#12 0x00007ffff5da36bd in CallMethod(QQmlObjectOrGadget const&, int, int, int, int*, QV4::ExecutionEngine*, QV4::CallData*, QMetaObject::Call) [clone .constprop.335] ()
at /home/maze/.local/lib/Qt/5.15.2/gcc_64/lib/libQt5Qml.so.5
#13 0x00007ffff5da5095 in CallPrecise(QQmlObjectOrGadget const&, QQmlPropertyData const&, QV4::ExecutionEngine*, QV4::CallData*, QMetaObject::Call) [clone .constprop.332] ()
at /home/maze/.local/lib/Qt/5.15.2/gcc_64/lib/libQt5Qml.so.5
#14 0x00007ffff5da5e13 in QV4::QObjectMethod::callInternal(QV4::Value const*, QV4::Value const*, int) const () at /home/maze/.local/lib/Qt/5.15.2/gcc_64/lib/libQt5Qml.so.5
#15 0x00007ffff5dc3863 in QV4::Moth::VME::interpret(QV4::CppStackFrame*, QV4::ExecutionEngine*, char const*) () at /home/maze/.local/lib/Qt/5.15.2/gcc_64/lib/libQt5Qml.so.5
#16 0x00007ffff5dc6722 in QV4::Moth::VME::exec(QV4::CppStackFrame*, QV4::ExecutionEngine*) () at /home/maze/.local/lib/Qt/5.15.2/gcc_64/lib/libQt5Qml.so.5
#17 0x00007ffff5d5b1e5 in QV4::Function::call(QV4::Value const*, QV4::Value const*, int, QV4::ExecutionContext const*) () at /home/maze/.local/lib/Qt/5.15.2/gcc_64/lib/libQt5Qml.so.5
#18 0x00007ffff5edc43a in QQmlJavaScriptExpression::evaluate(QV4::CallData*, bool*) () at /home/maze/.local/lib/Qt/5.15.2/gcc_64/lib/libQt5Qml.so.5
#19 0x00007ffff5e87d4c in QQmlBoundSignalExpression::evaluate(void**) () at /home/maze/.local/lib/Qt/5.15.2/gcc_64/lib/libQt5Qml.so.5
#20 0x00007ffff5e89613 in QQmlBoundSignal_callback(QQmlNotifierEndpoint*, void**) () at /home/maze/.local/lib/Qt/5.15.2/gcc_64/lib/libQt5Qml.so.5
#21 0x00007ffff5ebbe18 in QQmlNotifier::emitNotify(QQmlNotifierEndpoint*, void**) () at /home/maze/.local/lib/Qt/5.15.2/gcc_64/lib/libQt5Qml.so.5
#22 0x00007ffff5e6b5c6 in QQmlData::signalEmitted(QAbstractDeclarativeData*, QObject*, int, void**) () at /home/maze/.local/lib/Qt/5.15.2/gcc_64/lib/libQt5Qml.so.5
#23 0x00007ffff6e8bc36 in void doActivate<false>(QObject*, int, void**) () at /home/maze/.local/lib/Qt/5.15.2/gcc_64/lib/libQt5Core.so.5
#24 0x00007fffb948b571 in QQuickAbstractButtonPrivate::handleRelease(QPointF const&) () at /home/maze/.local/lib/Qt/5.15.2/gcc_64/lib/libQt5QuickTemplates2.so.5
#25 0x00007fffb94a76f5 in QQuickControl::mouseReleaseEvent(QMouseEvent*) () at /home/maze/.local/lib/Qt/5.15.2/gcc_64/lib/libQt5QuickTemplates2.so.5
#26 0x00007fffba30df5e in QQuickItem::event(QEvent*) () at /home/maze/.local/lib/Qt/5.15.2/gcc_64/lib/libQt5Quick.so.5
#27 0x00007ffff78c743c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /home/maze/.local/lib/Qt/5.15.2/gcc_64/lib/libQt5Widgets.so.5
#28 0x00007ffff78cdf20 in QApplication::notify(QObject*, QEvent*) () at /home/maze/.local/lib/Qt/5.15.2/gcc_64/lib/libQt5Widgets.so.5
#29 0x00007ffff6e53808 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /home/maze/.local/lib/Qt/5.15.2/gcc_64/lib/libQt5Core.so.5
#30 0x00007fffba325d67 in QQuickWindowPrivate::deliverMouseEvent(QQuickPointerMouseEvent*) () at /home/maze/.local/lib/Qt/5.15.2/gcc_64/lib/libQt5Quick.so.5
#31 0x00007fffba326f74 in QQuickWindowPrivate::deliverPointerEvent(QQuickPointerEvent*) () at /home/maze/.local/lib/Qt/5.15.2/gcc_64/lib/libQt5Quick.so.5
#32 0x00007fffba327f05 in QQuickWindowPrivate::handleMouseEvent(QMouseEvent*) () at /home/maze/.local/lib/Qt/5.15.2/gcc_64/lib/libQt5Quick.so.5
#33 0x00007ffff63ff63b in QWindow::event(QEvent*) () at /home/maze/.local/lib/Qt/5.15.2/gcc_64/lib/libQt5Gui.so.5
#34 0x00007fffba3293b9 in QQuickWindow::event(QEvent*) () at /home/maze/.local/lib/Qt/5.15.2/gcc_64/lib/libQt5Quick.so.5
#35 0x00007ffff78c743c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /home/maze/.local/lib/Qt/5.15.2/gcc_64/lib/libQt5Widgets.so.5
#36 0x00007ffff78cdf20 in QApplication::notify(QObject*, QEvent*) () at /home/maze/.local/lib/Qt/5.15.2/gcc_64/lib/libQt5Widgets.so.5
#37 0x00007ffff6e53808 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /home/maze/.local/lib/Qt/5.15.2/gcc_64/lib/libQt5Core.so.5
#38 0x00007ffff63f456d in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () at /home/maze/.local/lib/Qt/5.15.2/gcc_64/lib/libQt5Gui.so.5
#39 0x00007ffff63f5955 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () at /home/maze/.local/lib/Qt/5.15.2/gcc_64/lib/libQt5Gui.so.5
#40 0x00007ffff63d18ab in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /home/maze/.local/lib/Qt/5.15.2/gcc_64/lib/libQt5Gui.so.5
#41 0x00007ffff1fa469a in xcbSourceDispatch(_GSource*, int (*)(void*), void*) () at /home/maze/.local/lib/Qt/5.15.2/gcc_64/lib/libQt5XcbQpa.so.5
#42 0x00007ffff32ae4db in g_main_context_dispatch () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#43 0x00007ffff32ae788 in () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#44 0x00007ffff32ae853 in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#45 0x00007ffff6eaf1cc in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /home/maze/.local/lib/Qt/5.15.2/gcc_64/lib/libQt5Core.so.5
#46 0x00007ffff6e5221a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /home/maze/.local/lib/Qt/5.15.2/gcc_64/lib/libQt5Core.so.5
#47 0x00007ffff6e5b1d3 in QCoreApplication::exec() () at /home/maze/.local/lib/Qt/5.15.2/gcc_64/lib/libQt5Core.so.5
#48 0x00005555555601b1 in main(int, char**) (argc=1, argv=0x7fffffffc408) at ../src/main.cpp:48
I think a commandline in interface would be very handy to automate conversion. E.g. I would like to integrate qStrConverter into my CI in a workflow where I commit in an xlsx file and have it generate the ts.
This of course does not work with a GUI so a pure command line interface is needed.
an example usage would be:
qTsConverterCli xlsx-to-ts --in=myfile.xlsx --out=myfile.ts
Hi,
I cloned this project and tried to compile it from Qt Creator but got the following error:
[ 52%] Building CXX object 3rd-party/qtxlsx/CMakeFiles/QtXlsxWriter.dir/src/xlsx/xlsxzipreader.cpp.o /home/user/projects/qTsConverter/3rd-party/qtxlsx/src/xlsx/xlsxzipreader.cpp:28:10: fatal error: private/qzipreader_p.h: No such file or directory 28 | #include <private/qzipreader_p.h> | ^~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.
Is there any particular requirement needed to compile?
I am using:
Thanks!
Describe the bug
Application does not starts after install.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Application starts.
Screenshots
$ flatpak run org.guerinoni.qTsConverter
QSocketNotifier: Can only be used with threads started with QThread
QQmlApplicationEngine failed to load component
qrc:/main.qml:1:1: module "QtQuick" version 2.15 is not installed
Desktop (please complete the following information):
Describe the bug
I do not speak Japanese, but I discovered the following bug when using qTsConverter with Japanese translation. So there are three ways to write Japanese letters, Hiragana, Katakana, Kanji.
My client used Kanji in the Excel sheet, but in the resulting ts, the word was written both as Kanji and Katakana.
Example:
English: General
Translation in xlsx: 全般設定/装置情報
Output in ts: 全般設定/装置情報ゼンパンセッテイソウ
To Reproduce
Create a ts with the word "General". Create xlsx, translate as above, convert to ts.
Expected behavior
The translation string in the ts should be the same as in the xlsx.
Version
4.3.4 git 519dfbd
An installer for W10
Describe the bug
Hi, trying to run qTsConverter gives me the following error message:
QQmlApplicationEngine failed to load component
qrc:/main.qml:4:1: plugin cannot be loaded for module "QtQuick.Controls": Cannot protect module QtQuick.Controls 2 as it was never registered
To Reproduce
Steps to reproduce the behavior:
Expected behavior
normally running program :)
Desktop (please complete the following information):
If I choose a file CSV as input and set something.ts
as the output should be nice is the application automatic deduces that I want to convert CSV=>TS
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
The TS files I am trying to process contain many extracomment and extra-Context tags. These are produced by //: or //~ comments in the QML that are for providing extra information to the translator.
Text {
id: backTxt;
//: The back of the object, not the front
//% "Back"
//~ Context Not related to back-stepping
text: qsTrId("id-back-not-front");
}
<message id="id-back-not-front">
<source>Back</source>
<extracomment>The back of the object, not the front</extracomment>
<translation type="unfinished"></translation>
<extra-Context>Not related to back-stepping</extra-Context>
</message>
It would be nice to add support for these columns for csv/xlsx exports/imports.
More info is provided here.
Thank you for developing this extremely helpful tool!
An installer for macOs.
Describe the bug
Xlsx exporter eats the headers.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Not have an error.
Desktop (please complete the following information):
Additional context
Offending line: Xlsxbuilder.cpp:41
Reasoning:
Notify to the user the conversion result. If an error occurred, add a simple error description and in case of wrong file formatting how it can be solved (e.g. wrong headers).
Currently exporting to xlsx and then back to ts mangles plural forms (e.g. day vs days)
Describe the solution you'd like
I would like them to remain unchanged
Describe alternatives you've considered
There is none as if field is not marked (by add "numerusform" xml entry) the linguist tool can't even set them separately.
Missing Language setting inside Ts files
When opening the ts file generated with Qt Linguist, the tool requires to select the translations language
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The language is selected from the language code (e.g.: en_GB)
Describe the bug
A clear and concise description of what the bug is.
The build instructions provided in the README doesn't work.
--recursive
flag?CMake Error: The source directory "" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
build/
directory in my projects folderTo Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
A working build
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
master
Additional context
Add any other context about the problem here.
I ended up using Qt Creator which worked
On W10 test are not found, but I don't have windows.
When converting from ts
to other formats, the output will always be a file; update the destination label accordingly: Output File or Destination File.
When the conversion is from csv/xlsx
to ts
the label is correct since the user can only select a destination folder.
Parsing TS file as input file the application ignores location and line fields. It is better to keep this info in CSV because when it performs reconversion is useful for qt linguist.
Now the software automatic set as name of output file output
.. The best solution is to set this name from user input.
Im running OSX Big Sur 11.0.1 with Qt 5.12.2 installed, I have tried using the readme command (git clone --recursive https://github.com/guerinoni/qTsConverter.git) and I have tried downloading the code directly from the GitHub website, as well as the dependencies and placed them in their folders. Both times I got this output for install with an error for libqtcsv.a:
sudo make install
Password:
[ 1%] Automatic MOC for target qtcsv
[ 1%] Built target qtcsv_autogen
[ 13%] Built target qtcsv
[ 15%] Automatic MOC for target QtXlsxWriter
[ 15%] Built target QtXlsxWriter_autogen
[ 70%] Built target QtXlsxWriter
[ 71%] Automatic MOC and UIC for target qTsConverter
[ 71%] Built target qTsConverter_autogen
[100%] Built target qTsConverter
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/lib/libqtcsv.a
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /usr/local/lib/libqtcsv.a(mocs_compilation.cpp.o) has no symbols
-- Up-to-date: /usr/local/./include
-- Installing: /usr/local/./include/qtcsv
-- Installing: /usr/local/./include/qtcsv/reader.h
-- Installing: /usr/local/./include/qtcsv/abstractdata.h
-- Installing: /usr/local/./include/qtcsv/stringdata.h
-- Installing: /usr/local/./include/qtcsv/writer.h
-- Installing: /usr/local/./include/qtcsv/qtcsv_global.h
-- Installing: /usr/local/./include/qtcsv/variantdata.h
-- Installing: /usr/local/share/qtcsv/cmake/qtcsvConfig.cmake
-- Installing: /usr/local/share/qtcsv/cmake/qtcsvConfig-release.cmake
-- Installing: /usr/local/lib/libQtXlsxWriter.dylib
-- Installing: /usr/local/lib/cmake/QtXlsxWriter/QtXlsxWriterConfig.cmake
-- Installing: /usr/local/include/xlsxabstractooxmlfile.h
-- Installing: /usr/local/include/xlsxabstractsheet.h
-- Installing: /usr/local/include/xlsxcell.h
-- Installing: /usr/local/include/xlsxcellformula.h
-- Installing: /usr/local/include/xlsxcellrange.h
-- Installing: /usr/local/include/xlsxcellreference.h
-- Installing: /usr/local/include/xlsxchart.h
-- Installing: /usr/local/include/xlsxchartsheet.h
-- Installing: /usr/local/include/xlsxconditionalformatting.h
-- Installing: /usr/local/include/xlsxdatavalidation.h
-- Installing: /usr/local/include/xlsxdocument.h
-- Installing: /usr/local/include/xlsxformat.h
-- Installing: /usr/local/include/xlsxglobal.h
-- Installing: /usr/local/include/xlsxrichstring.h
-- Installing: /usr/local/include/xlsxworkbook.h
-- Installing: /usr/local/include/xlsxworksheet.h
-- Installing: /usr/local/bin/qTsConverter
-- Installing: /usr/local/share/doc/qTsConverter/README.md
-- Installing: /usr/local/share/licenses/qTsConverter/LICENSE
-- Installing: /usr/local/share/applications/org.guerinoni.qTsConverter.desktop
-- Installing: /usr/local/share/icons/hicolor/512x512/apps/org.guerinoni.qTsConverter.svg
-- Installing: /usr/local/share/icons/hicolor/512x512/apps/org.guerinoni.qTsConverter.png
-- Installing: /usr/local/share/metainfo/org.guerinoni.qTsConverter.appdata.xml
Then both times I tried to run I got this:
:bin connorlee$ ./qTsConverter
dyld: Library not loaded: @rpath/QtQuick.framework/Versions/5/QtQuick
Referenced from: /usr/local/bin/./qTsConverter
Reason: image not found
Abort trap: 6
Is this an error in the way I am compiling?
Thanks,
Connor
Describe the bug
When I click on "BROWSE" button nothing appear and in the terminal I can see the following error message:
ERROR: No native FileDialog implementation available. Qt Labs Platform requires Qt Widgets on this setup. Add 'QT += widgets' to .pro and create QApplication in main().
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Open the DialogFile to select the file to convert
Desktop (please complete the following information):
Additional context
When I execute the application, before to press the button, I can see the following message:
qt.qpa.xcb: QXcbConnection: XCB error: 5 (BadAtom), sequence: 474, resource id: 0, major code: 20 (GetProperty), minor code: 0
When exporting and then reimporting translation file the information that the translation is unfinished is lost.
Describe the solution you'd like
Imho it would be easy enough to check if the field is empty and mark it as unfinished in ts file.
Describe the bug
Even when successful, qTsConverter returns with 1
after conversion. Continuous integration don't like this.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
On successful conversion exit code 0
should be returned.
Additional context
As mentioned, this is crucial for CI/CD integration.
Many times translations are provided in xlsx format. Add the Office Excel compatibility in the supported formats.
When using the command line version within a docker container, qTsConverter fails to due to it needs a graphical backend. This is probably because there is still all graphical parts involved even though the window doesn't get created. I have not dived deeply into this, but most clean solution is probably make a separate executable for the CLI version.
To Reproduce
Steps to reproduce the behavior:
qTsConverter --help
within the containerExpected behavior
In CLI mode qTsConverter should not rely on graphical backend
Additional context
I work around this issue by invoking -platform vnc
which is available in my docker image
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.