Consider the use of QMessageBox::warning to present warning messages. Here is one of my calls:
QMessageBox::warning(this,tr("Error"),
tr("The first index can't be\n greater than the last."),
QMessageBox::Ok, QMessageBox::Ok);
You see that there are 2 calls to tr in the call to the warning function. If you have not implemented any other languages, tr("Error") will return "Error". If you have set up your program with other languages, then tr will use the active language to rapidly find a translation for "Error". In the case of French, it might return "Erreur". So for each language you must prepare a translation for each string embedded in a call to tr.
The file which contains translations is an XML with the extension "ts". You need to a TRANSLATIONS variable to your Qt project file (ebe.pro for ebe). Here is my current value
TRANSLATIONS = ebe_fr.ts ebe_sp.ts ebe_sv.ts \
ebe_de.ts ebe_pt.ts ebe_hi.ts \
ebe_zh.ts ebe_ru.ts ebe_ar.ts \
ebe_bn.ts ebe_in.ts ebe_ja.ts
The project file is processed by the lupdate program to determine all the translation files and also the location an content of each tr call. Each of the files named has a 2 character language code like "fr" for "French" which is used by the Qt lupdate program to determine the language. If a particular .ts file does not exist it will be created with an empty translation for each tr string. If a string is repeated within a source file, it exists as one entry in the .ts file with the line numbers for each occurrence listed with the string. If a file already exists it is updated with changed information while retaining existing translations.
The translation process consists of replacing the empty translations with reasonable strings from the appropriate language. This can be done with an editor (provided the editor allows entering the proper characters and accents for the language). A better choice is to use the Qt Linguist program. This allows you to move through the .ts file without the bother of keeping the XML format straight. With Linguist you can type in translations or copy them from other sources. In my case I have been using Google Translate, though many editors will allow editing in multiple languages.
So far I have translations for French, German, Hindi, Arabic, Swedish, Russian, Chinese, Spanish and Portuguese. You can see from the TRANSLATIONS variable that I anticipate translations for Bengali, Indonesian and Japanese. At that point I will have covered the top 10 most used languages of the world with a start toward covering more of Europe.
My main problem is the inconsistent quality of Google Translate's translations. I really need knowledgeable people to repair my broken translations. I have had a volunteer from Canada repair my French file and I have volunteers working on Spanish, Portuguese, Hindi, Arabic and Chinese. I need help with Russian, Indonesian, Bengali, Japanese, German and Swedish.
In general this points out to me the need to recruit volunteers to the ebe project. I desperately need help with documentation. I need to complete HTML files detailing how to use ebe. Ultimately it would be wonderful to have all the HTML files translated into the dozen or so languages selected for ebe. There are also needs to write sample code and HTML files in the ebe library. Finally ebe is not nearly perfect and I need a few good programmers to add features and work on the ebe C++ code. This is an open source project so it needs volunteers.
Long term changes include adding a function/class database to provide call information within the editor and adding lessons to the system. The goal is to make ebe into a great tool for teaching and lessons seem important. I would also welcome any bright ideas which could further the cause.
2 comments:
Mr. Seyfarth,
Hopefully all is well with you. I'm planning on using your book for my architecture/assembler class and had a question about EBE. (Preface: I'm not a great c++ programmer--so what follows--well :) )
I had some trouble compiling on Qt5 on Mageia Linux, and eventually after changing the QtGui refs to QtWidgets, changing the QT += webkit to webkitwidgets, and some other minor changes, everything seems to run great. (I'd be happy to return the code changes if it is of any help.)
EBE is a nice program. I love the multitude of viewer windows for viewing system state. Anyway, I wanted to wish you the best and ask if you were still planning on continuing your work with ebe/asm after getting into the swing of retirement?
Thanks!
Hi!
I hope that my book satisfies your needs. If it needs some attention let me know.
I have been building ebe with Qt4. I tried briefly with Qt5 and it looked like I would have to change a few things. I want ebe to work on Linux, Windows and OS X so I think it might be easier for me to stick with Qt4.
I would like to get your changes to ebe for Qt5. It might save me some work.
For me, ebe represents my idea of what to do with retirement. I have had a lot of fun with it. The most fun for me is interacting with people.
I would like to improve ebe to make it a great program for beginners. Right now it could be improved a lot with more examples in the library and documentation. This is not what I do best - I tend to be a little lazy with documentation. I get excited about figuring things out and then I kind of wish to move on, but I have a year or 2 of work left to do on ebe. Perhaps I will attract some energetic volunteers.
I would also like to add a few more novel features. The toy box and the bit bucket are pretty cool.
Thanks for selecting my book. Let me know if you need something.
Ray
Post a Comment