Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: nanyu on July 24, 2009, 11:19:56 am

Title: Syntax highlighting fail with Internationlization - who will apply it?
Post by: nanyu on July 24, 2009, 11:19:56 am
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]
Title: Re: Syntax highlighting fail with Internationlization
Post by: blueshake on July 24, 2009, 12:00:58 pm
I guess that "default" should not be translated in color setting,just a guess. :)
Title: Re: Syntax highlighting fail with Internationlization
Post by: nanyu 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!
Title: Re: Syntax highlighting fail with Internationlization - who will apply it?
Post by: blueshake on July 25, 2009, 05:47:01 am
I think you can make a patch and submit it.
Title: Re: Syntax highlighting fail with Internationlization - who will apply it?
Post by: killerbot on July 25, 2009, 10:30:38 am
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 ?
Title: Re: Syntax highlighting fail with Internationlization - who will apply it?
Post by: nanyu on July 25, 2009, 07:03:14 pm
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 ?

--------
Title: Re: Syntax highlighting fail with Internationlization - who will apply it?
Post by: killerbot on July 25, 2009, 07:04:58 pm
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 ;-)
Title: Re: Syntax highlighting fail with Internationlization - who will apply it?
Post by: thomas on July 25, 2009, 07:24:05 pm
Please don't apply that patch, whatever it is. Terribly bad luck is upon you.
Title: Re: Syntax highlighting fail with Internationlization - who will apply it?
Post by: killerbot on July 25, 2009, 09:47:08 pm
could you elaborate a little bit Thomas ?
Title: Re: Syntax highlighting fail with Internationlization - who will apply it?
Post by: thomas on July 26, 2009, 03:15:49 am
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.
Title: Re: Syntax highlighting fail with Internationlization - who will apply it?
Post by: blueshake on July 26, 2009, 04:49:10 am
@nanyu
I guess the translation can leave the "default" alone.Afterall it is a simple English word. :)
Title: Re: Syntax highlighting fail with Internationlization - who will apply it?
Post by: nanyu on July 26, 2009, 08:10:00 am
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.
Title: Re: Syntax highlighting fail with Internationlization - who will apply it?
Post by: killerbot on July 26, 2009, 10:35:15 am
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 ?
Title: Re: Syntax highlighting fail with Internationlization - who will apply it?
Post by: thomas on July 26, 2009, 04:56:08 pm
Ah, my bad... those stupid macros all look the same, I thought wxT was the one wxTranslating... sure, go ahead then.
Title: Re: Syntax highlighting fail with Internationlization - who will apply it?
Post by: killerbot on July 26, 2009, 06:32:02 pm
fix implemented rev 5713.
Title: Re: Syntax highlighting fail with Internationlization - who will apply it?
Post by: Jenna on July 26, 2009, 08:41:55 pm
fix implemented rev 5713.
I just also fixed it in C::B's editcolourset.cpp.
Title: Re: Syntax highlighting fail with Internationlization - who will apply it?
Post by: nanyu on July 31, 2009, 09:53:41 am
fix implemented rev 5713.
I just also fixed it in C::B's editcolourset.cpp.

thanks! It worksfine now.