Author Topic: XML based compilers  (Read 341657 times)

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9699
Re: XML based compilers
« Reply #150 on: October 07, 2012, 09:03:43 am »
The hack is already in svn...
...the description now, too.
I was able to reproduce it with one of my own projects, too btw. But I could swear this came with more recent version of either Ubuntu or wxWidgets. I've never seen such before. So it would either be a wxWidgets or Ubuntu thing. I wonder how a more recent wx294 demo case would behave.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5519
Re: XML based compilers
« Reply #151 on: October 07, 2012, 10:40:36 am »
I would refactor this in a little method which name says it is a hack, since now (just looking at the diff), there is code duplication, and will be easier to remove (function calls and implementation), and easier to test if hack is still needed (temporarily make the function empty)

What do you think ?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9699
Re: XML based compilers
« Reply #152 on: October 07, 2012, 10:56:54 am »
What do you think ?
Why not? I though in this case, as both hacks are directly after each other it would not be needed. Because if you see the one hack you'll also see the other.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: XML based compilers
« Reply #153 on: October 08, 2012, 11:40:02 pm »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9699
Re: XML based compilers
« Reply #154 on: October 09, 2012, 07:12:38 am »
good idea to file it to ubuntu
Bug reported.
Wouldn't the wxWidgets bug-tracker be the right place to report?!
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: XML based compilers
« Reply #155 on: October 09, 2012, 11:06:47 pm »
Wouldn't the wxWidgets bug-tracker be the right place to report?!
I actually was not quite sure where it belonged.  I will submit it there as well.  (It appears that this was reported a while ago as well.)

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: XML based compilers
« Reply #156 on: November 12, 2012, 11:36:52 pm »
About rev. 8553, would the following be more friendly for translators?  Or should this type of pseudo-intelligent logging be avoided?
Code
Index: src/plugins/compilergcc/compilergcc.cpp
===================================================================
--- src/plugins/compilergcc/compilergcc.cpp (revision 8554)
+++ src/plugins/compilergcc/compilergcc.cpp (working copy)
@@ -3728,8 +3728,9 @@
 
 wxString CompilerGCC::GetErrWarnStr()
 {
-    return wxString::Format(_("%u error(s), %u warning(s)"),
-                            m_Errors.GetCount(cltError), m_Errors.GetCount(cltWarning));
+    return wxString::Format(_("%u %s, %u %s"),
+                            m_Errors.GetCount(cltError),   wxString(m_Errors.GetCount(cltError)   == 1 ? _("error")   : _("errors")).wx_str(),
+                            m_Errors.GetCount(cltWarning), wxString(m_Errors.GetCount(cltWarning) == 1 ? _("warning") : _("warnings")).wx_str());
 }
 
 wxString CompilerGCC::GetMinSecStr()
@@ -3737,6 +3738,7 @@
     long int elapsed = (wxGetLocalTimeMillis() - m_StartTime).ToLong() / 1000;
     int mins =  elapsed / 60;
     int secs = (elapsed % 60);
-    return wxString::Format(_("%d minute(s), %d second(s)"), mins, secs);
-;
+    return wxString::Format(_("%d %s, %d %s"),
+                            mins, wxString(mins == 1 ? _("minute") : _("minutes")).wx_str(),
+                            secs, wxString(secs == 1 ? _("second") : _("seconds")).wx_str());
 }
Index: src/plugins/compilergcc/directcommands.cpp
===================================================================
--- src/plugins/compilergcc/directcommands.cpp (revision 8554)
+++ src/plugins/compilergcc/directcommands.cpp (working copy)
@@ -613,8 +613,8 @@
     if (!fileMissing.IsEmpty())
     {
         wxString warn;
-        warn.Printf(_("WARNING: Target '%s': Unable to resolve %lu external dependenc%s:"),
-                    target->GetFullTitle().wx_str(), static_cast<unsigned long>(fileMissing.Count()), wxString(fileMissing.Count() == 1 ? _("y") : _("ies")).wx_str());
+        warn.Printf(_("WARNING: Target '%s': Unable to resolve %lu external %s:"),
+                    target->GetFullTitle().wx_str(), static_cast<unsigned long>(fileMissing.Count()), wxString(fileMissing.Count() == 1 ? _("dependency") : _("dependencies")).wx_str());
         ret.Add(wxString(COMPILER_SIMPLE_LOG) + warn);
         for (size_t i=0; i<fileMissing.Count(); i++)
             ret.Add(wxString(COMPILER_SIMPLE_LOG) + fileMissing[i]);

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: XML based compilers
« Reply #157 on: November 12, 2012, 11:53:08 pm »
I see no problem with the current version ... KISS for the win.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9699
Re: XML based compilers
« Reply #158 on: November 13, 2012, 08:58:19 am »
I see no problem with the current version ... KISS for the win.
I agree. Either we do it like that in all places or we just keep it simple. It has some more advantages: You don't have to translate many units. Already now we have several thousands of units to translate anyways - adding even more might not be the best thing to do you know... ;)
@Alpha: If you want to, make a poEdit session on Code::Blocks. Then you know what I am talking about... ;D

However - you pointed me to a place that I missed to simplify. :P
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: XML based compilers
« Reply #159 on: November 13, 2012, 11:30:28 pm »
I think this might be a side effect from having an overzealous English teacher :).

@Alpha: If you want to, make a poEdit session on Code::Blocks. Then you know what I am talking about... ;D
I can imagine :o (and I have enough trouble as it is when I need to translate just a few sentences).

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: XML based compilers
« Reply #160 on: November 20, 2012, 12:42:16 am »
Do not worry, I am not trying to argue you change your mind ;).  In my reading, I had bumped into the following, and thought I would post some links in case the topic of plural translations was ever revisited in the future.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9699
Re: XML based compilers
« Reply #161 on: November 20, 2012, 06:21:24 am »
Do not worry, I am not trying to argue you change your mind ;).  In my reading, I had bumped into the following, and thought I would post some links in case the topic of plural translations was ever revisited in the future.
I know about these, but they all cause to double the units to translate in the worst case. The question is: In an IDE - is "dependency/ies" enough, or do you really want to be that super correct. I mean its not a scientific thesis we are doing here. And (most important to me) we don't want to scare away translators.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: XML based compilers
« Reply #162 on: December 10, 2012, 12:51:58 am »
Morten: Can you show us if you can do a pain free svn merge?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: XML based compilers
« Reply #163 on: December 10, 2012, 02:50:30 am »
I have some changes in my local copy; would you prefer to have them now (some changes are not yet thoroughly tested), or after the merge (assuming it will be soon)?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9699
Re: XML based compilers
« Reply #164 on: December 10, 2012, 08:53:17 am »
I have some changes in my local copy; would you prefer to have them now (some changes are not yet thoroughly tested), or after the merge (assuming it will be soon)?
After.

Morten: Can you show us if you can do a pain free svn merge?
Sorry, no time atm, but I'll see what I can do later this or next week.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ