Author Topic: Syntax highlighting fail with Internationlization - who will apply it?  (Read 8545 times)

Offline nanyu

  • Almost regular
  • **
  • Posts: 188
  • nanyu
I changed the Syntax highlighting for editor. it work fine.
But after I setted the Internationlization to Chinese, the highlighting was jumbled.

(windows xp , code::blocks svn5696)

 help me!

[attachment deleted by admin]
« Last Edit: July 24, 2009, 08:04:23 pm by nanyu »

Offline blueshake

  • Regular
  • ***
  • Posts: 459
Re: Syntax highlighting fail with Internationlization
« Reply #1 on: July 24, 2009, 12:00:58 pm »
I guess that "default" should not be translated in color setting,just a guess. :)
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

Offline nanyu

  • Almost regular
  • **
  • Posts: 188
  • nanyu
Re: Syntax highlighting fail with Internationlization
« Reply #2 on: July 24, 2009, 08:02:48 pm »
I guess that "default" should not be translated in color setting,just a guess. :)

What a great GUESS it is..:)

I found the BUG now:
===============================
svn: 5702
file: codeblocks\src\plugins\contrib\codesnippets\editor\seditorcolourset.cpp
line: 450
    // first load the default colours to all styles (ignoring some built-in styles)
    SOptionColour* defaults = GetOptionByName(lang, _("Default"));
=========== I think the "Default" needn't translate to Chinese(or other language)...so..pls :
    SOptionColour* defaults = GetOptionByName(lang, _wxT("Default"));

Whic developer can apply it ?  I can test it after modifed. thanks!
« Last Edit: July 24, 2009, 08:08:47 pm by nanyu »

Offline blueshake

  • Regular
  • ***
  • Posts: 459
I think you can make a patch and submit it.
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
I could apply it.
Question : do you build CB yourself ? If so, you can already change it in your source tree. If not, I assume you will want a next nightly build ?

Offline nanyu

  • Almost regular
  • **
  • Posts: 188
  • nanyu
I could apply it.
Question : do you build CB yourself ? If so, you can already change it in your source tree. If not, I assume you will want a next nightly build ?

Thank you! I build CB myself, but I will wait the next nightly build. I teach my students study C++ with CB. It's too difficult  to update their CB to the my owner verson.

by the way:  I'll write a book about C::B and publish it. could I do it ?

--------
« Last Edit: July 25, 2009, 07:09:07 pm by nanyu »

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
since you build CB yourself, could you try the suggestion out to see if it works correctly ?
I prefer to have the feedback in advance of committing it ;-)

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Please don't apply that patch, whatever it is. Terribly bad luck is upon you.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
could you elaborate a little bit Thomas ?

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Translating "default" to Chinese will cause Chinese characters being used as XML tag names which at least some versions of TinyXML don't like at all. Therefore, translating "default" means terribly bad luck.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline blueshake

  • Regular
  • ***
  • Posts: 459
@nanyu
I guess the translation can leave the "default" alone.Afterall it is a simple English word. :)
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

Offline nanyu

  • Almost regular
  • **
  • Posts: 188
  • nanyu
Translating "default" to Chinese will cause Chinese characters being used as XML tag names which at least some versions of TinyXML don't like at all. Therefore, translating "default" means terribly bad luck.

OH NO! what I will do is "not translating" "default" from English to Chinese or other language!

current code is :

 SOptionColour* defaults = GetOptionByName(lang, _("Default")); //  _() make  "Default" been translated.

and now, I hope it be modify to :

 SOptionColour* defaults = GetOptionByName(lang, _wxT("Default")); //  _wxT() didn''t do any translating work.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Translating "default" to Chinese will cause Chinese characters being used as XML tag names which at least some versions of TinyXML don't like at all. Therefore, translating "default" means terribly bad luck.

OH NO! what I will do is "not translating" "default" from English to Chinese or other language!

current code is :

 SOptionColour* defaults = GetOptionByName(lang, _("Default")); //  _() make  "Default" been translated.

and now, I hope it be modify to :

 SOptionColour* defaults = GetOptionByName(lang, _wxT("Default")); //  _wxT() didn''t do any translating work.


That's also what I thought it did. The bug was it used to be translated (_()) and now it no longer will be.
Although I think there might be an error (I don't think it should be _wxT("Default") :
I think it should be either :
Code
 _T("Default")
or
Code
 wxT("Default")

Any further objections Thomas ?

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Ah, my bad... those stupid macros all look the same, I thought wxT was the one wxTranslating... sure, go ahead then.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
fix implemented rev 5713.