tsdconseil / opencv-demonstrator

OpenCV demonstrator (GUI)
http://www.tsdconseil.fr/log/opencv/demo/index-en.html
GNU Lesser General Public License v3.0
141 stars 57 forks source link

Application logging to console, and code comments language #44

Closed valera-rozuvan closed 8 years ago

valera-rozuvan commented 8 years ago

Right now most of the application logs that are printed in the console are in French. Also, most of the comments in the source code are also in French. @juliena82 do you object if I start slowly changing the log messages and the source code comments to English?

applemuncy commented 8 years ago

While I think logging should be i18n I do wonder what to do about about comments in code. Does Dozygen have any options for handling i18n?

I was thinking when I come across something in French that I have to translate to understand, I would just paste the English undernieth the French in as much as comments get stripped at compile time.

By the way, I think both of you do better at English than me.

juliena82 commented 8 years ago

@valera-rozuvan @applemuncy When I wrote the software, I was working alone and I didn't think at this time that I would have the chance to cooperate aftwerwards with others to improve it. That's why there are a lot of french comments and log messages. Now, as our common language here is english, it's time to change that!

However, I would like to do it in a way to preserve the original french comments / log messages too. So I propose that, step by step, english versions of the comments can be added, just below the french comments. I am not sure if doxygen support multilanguage comments, but anyway, actually running doxygen is not really necessary (in theory, one can just read the header files to have the doc).

For the log files, I suggest the use internationnalized strings using a new log.xml file (similar to lang.xml). So that we can have English logs, and also french logs.

What do you think of it?

PS: note that french is an internationnal langage too (and do you know that maybe there will be more french speaking people in 2050 as English or spanish?)

valera-rozuvan commented 8 years ago

= ) @juliena82 I agree. We should not remove the French comments and log messages. Instead we should add i18n support for log messages, and add English translations in-place for comments (i.e. below the French comments in the source code).

Also, an option to turn off log messages altogether.

juliena82 commented 8 years ago

@valera-rozuvan Indeed, I am note sure whether currently the log messages are in utf8 or iso 8859-1. I will check.

Also, by default log messages on the console are off (only logs to log file is on), and are enabled by the -vv command line option (there are other options too, I need to document...)

applemuncy commented 8 years ago

Under Linux logging messages to console appears to be on by default. One can always redirect by > /dev/null 2> /dev/null Doesn't bother me any.

And just for the record, I was a foreign exchange student to France and Switzerland for a year many years ago and so this is nice to try to understand French again. Not so good when I think I know what something means but in fact don't : (

valera-rozuvan commented 8 years ago

= )

juliena82 commented 8 years ago

@applemuncy @valera-rozuvan Ok, so this is a bug, occuring on Linux only (log message showing up even without -vv option)... I cannot solve this problem just now (currently working on the refactoring of input selection), but let's this issue stay open so that we do not forget to solve it.

@applemuncy Super ! nous pourrons donc peut-être échanger (un peu) en français ;)

applemuncy commented 8 years ago

Mais oui , certainement : )

valera-rozuvan commented 8 years ago

@juliena82 I will try and debug to understand why the log messages appear in Linux.

juliena82 commented 8 years ago

@valera-rozuvan Oops, I just recheck on Windows, and there is the same problem. Actually, it was modification meant to be temporary that was not reverted. In ocvdemo.cc, removing the following line is sufficient: utils::TraceManager::set_global_min_level(TraceManager::TraceTarget::TRACE_TARGET_STD, TraceLevel::AL_VERBOSE); I cannot push now because I am currentlydoing other modifications, but I will push soon.

juliena82 commented 8 years ago

Following last push, now by default there is no log on the console unless you specify some trace option at the command line (e.g. -vv)

valera-rozuvan commented 8 years ago

@juliena82 +1 No logs in console under Linux now. Thanks = )