Author Topic: Code::Blocks' translation  (Read 565034 times)

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Code::Blocks' translation
« Reply #30 on: February 03, 2006, 10:02:53 am »
After CB uses default.conf as its configure file or is built with UNICODE mode, the internationalize of CB seems more difficult than before.
I don't want to say much more lest so many people be annoyed. :P
I'll try to solve them.
Please do say more. What exactly is making it more complicated?
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline heromyth

  • Multiple posting newcomer
  • *
  • Posts: 98
    • http://
Re: Code::Blocks' translation
« Reply #31 on: February 04, 2006, 03:16:07 pm »
After CB uses default.conf as its configure file or is built with UNICODE mode, the internationalize of CB seems more difficult than before.
I don't want to say much more lest so many people be annoyed. :P
I'll try to solve them.
Please do say more. What exactly is making it more complicated?

I build CB with unicode mode, but my translation can't works any more like before. Maybe I don't find the right way. So I build CB with ansi mode. Now my translation works. However another problem produced. That's some phrases translated by me have been written into the file default.conf. When I first launch CB and close it, an exception will be raised. It's from sdk\configuremanager.cpp:487 and it says the node and the namespace are "an_dlg". That's because I have translated this phrase "Layout changed!"  in src\main.cpp:917. Then I choice not to translated it and launch CB again (Notice, some Chinese characters have been existed in the file default.conf). A alert window shows these:
Code
TinyXML error:
Error reading end tag.

Good news
After I change the defult.conf's code page to utf-8, the second problem seems disappeared and the first one still be there.  Perhaps it is because CB is working with ansi mode, so the default.conf's code page is ansi.  However there produces another problem that all the Chinese characters in default.conf can't be shown correctly.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Code::Blocks' translation
« Reply #32 on: February 04, 2006, 06:02:41 pm »
This has nothing to do with the fact that the config is stored in xml, but you have found an actual bug in AnnoyingDialog there. :)

The reason why this fails is that the dialog's caption is used
a) as the caption
b) as the title in the check list box where you can re-enable disabled dialogs
c) as a key in the config file (this works fine in English but is deadly with Chinese chars)

Although the problem is easily identified, a solution is not quite so easy. Well, the solution *is* easy, but it will break the exisiting configuration files for everybody...

Let me think about what to do best.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline heromyth

  • Multiple posting newcomer
  • *
  • Posts: 98
    • http://
Re: Code::Blocks' translation
« Reply #33 on: February 05, 2006, 03:15:10 am »
It's really difficult in handling the non-English characters in XML files. So I have an idea submitting this bug to TinyXML.  :P

takeshimiya

  • Guest
Re: Code::Blocks' translation
« Reply #34 on: February 05, 2006, 03:21:45 am »
It's really difficult in handling the non-English characters in XML files. So I have an idea submitting this bug to TinyXML.  :P
Why you say that? tinyXML supports Unicode UTF-8 encoded strings.

raicuandi

  • Guest
Re: Code::Blocks' translation
« Reply #35 on: February 05, 2006, 09:06:39 am »
I've begin the romanian translation. Is there anyone else working on this, to avoid a double-effort?

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Code::Blocks' translation
« Reply #36 on: February 05, 2006, 04:22:45 pm »
It's really difficult in handling the non-English characters in XML files. So I have an idea submitting this bug to TinyXML.  :P
Don't bother, this really was not a bug in TinyXML, but improper use (read: our fault). Using non-ANSI characters in xml is wrong.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline heromyth

  • Multiple posting newcomer
  • *
  • Posts: 98
    • http://
Re: Code::Blocks' translation
« Reply #37 on: February 06, 2006, 02:23:24 am »
Yes, if all the words ouput to default.conf have't been translated before doing the ouput, I think, that problem also can be resolved. It seems many works must to be done.

Quote
Why you say that? tinyXML supports Unicode UTF-8 encoded strings.
I have changed the code page of default.conf which also include some non-ANSI characters to UTF-8, but these characters can't be shown correctly in CB. Sorry for my superficial tested result.

Offline heromyth

  • Multiple posting newcomer
  • *
  • Posts: 98
    • http://
Re: Code::Blocks' translation
« Reply #38 on: February 13, 2006, 12:27:19 pm »
It's really difficult in handling the non-English characters in XML files. So I have an idea submitting this bug to TinyXML.  :P
Don't bother, this really was not a bug in TinyXML, but improper use (read: our fault). Using non-ANSI characters in xml is wrong.

Not like that. It's improper use _U() and _C(). I have a patch for this at https://developer.berlios.de/patch/index.php?func=detailpatch&patch_id=827&group_id=5358.

Now the default.conf can have non-English characters which are certainly UNICODE. That is to say that the default.conf won't be affected on by the translation.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Code::Blocks' translation
« Reply #39 on: February 13, 2006, 12:45:59 pm »
Please accept that you cannot use xml tags that contain Chinese characters. It does not matter whether you convert the wxStrings or not, it is illegal.

If you write something like
Code
key << _("/file_groups/group") << wxString::Format(_T("%d"), i) << _T("/") << _T("name");
i.e. you translate the path, then this does not only make it impossible for people who are unable to speak Chinese to find an error in such a file, but it is also illegal.
It might even appear to work out of pure coincidence, but at some random point, it will fail, and we will not know why!
Please don't do such things, you're opening Pandora's box. Configuration keys should not be translated, and they should not contain special characters.

Storing non-ANSI characters as data is a completely different thing, this works fine since end of December, and you can certainly do it.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline heromyth

  • Multiple posting newcomer
  • *
  • Posts: 98
    • http://
Re: Code::Blocks' translation
« Reply #40 on: February 13, 2006, 01:45:04 pm »
Please accept that you cannot use xml tags that contain Chinese characters. It does not matter whether you convert the wxStrings or not, it is illegal.

Yes, it's. So if the code is like this
Code
key << _("/file_groups/group") << wxString::Format(_T("%d"), i) << _T("/") << _T("name");
, it is wrong. It should be like that:
Code
key << _T("/file_groups/group") << wxString::Format(_T("%d"), i) << _T("/") << _T("name");

My patchs have resolved some problems like this in CB's source codes.

Quote
Storing non-ANSI characters as data is a completely different thing, this works fine since end of December, and you can certainly do it.


I'am sure there is no problem with English characters with non-ANSI and ANSI mode. I have tested it that CB can't compeletly handles the non-English characters like Chinese characters as datas in default.conf with non-ANSI mode.  This patch also can resolve it.

I havn't tested it widely with non-English with ANSI mode.  So I have no idea of it.
« Last Edit: February 13, 2006, 01:47:38 pm by heromyth »

Offline sasq

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: Code::Blocks' translation
« Reply #41 on: February 23, 2006, 06:52:42 am »
I have a suggestion that all of you who want to do translation go to

http://sourceforge.net/tracker/index.php?func=detail&aid=1274988&group_id=126998&atid=707418

The link is broken [SourceForge complains about missing file].
I'm interested in making a Polish localization of Code::Blocks.

Offline heromyth

  • Multiple posting newcomer
  • *
  • Posts: 98
    • http://
Re: Code::Blocks' translation
« Reply #42 on: February 24, 2006, 03:10:00 am »
I have a suggestion that all of you who want to do translation go to

http://sourceforge.net/tracker/index.php?func=detail&aid=1274988&group_id=126998&atid=707418

The link is broken [SourceForge complains about missing file].
I'm interested in making a Polish localization of Code::Blocks.

The new link has been changed to this https://developer.berlios.de/patch/?func=browse&group_id=5358&set=open

Offline Revvy

  • Multiple posting newcomer
  • *
  • Posts: 32
Re: Code::Blocks' translation
« Reply #43 on: February 25, 2006, 01:58:17 am »
I'm sorry, I really don't have time to work on translating Code::Blocks any more.  I'll send what I did to the guy who passed it off to me, hopefully there's somebody who has time and skill to apply to this.
Cheers,
Revvy

Offline heromyth

  • Multiple posting newcomer
  • *
  • Posts: 98
    • http://
Re: Code::Blocks' translation
« Reply #44 on: February 27, 2006, 01:31:54 am »
I'm sorry, I really don't have time to work on translating Code::Blocks any more.  I'll send what I did to the guy who passed it off to me, hopefully there's somebody who has time and skill to apply to this.
Maybe you can submit your works to http://developer.berlios.de/patch/?func=addpatch&group_id=5358. Then somebody can benefit from it.