News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Code::Blocks' translation

Started by teto, October 06, 2005, 08:55:03 PM

Previous topic - Next topic

thomas

Quote from: heromyth on February 03, 2006, 02:32:36 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."

heromyth

Quote from: thomas on February 03, 2006, 10:02:53 AM
Quote from: heromyth on February 03, 2006, 02:32:36 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?

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:
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.

thomas

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."

heromyth

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

Quote from: heromyth 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
Why you say that? tinyXML supports Unicode UTF-8 encoded strings.

raicuandi

I've begin the romanian translation. Is there anyone else working on this, to avoid a double-effort?

thomas

Quote from: heromyth 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
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."

heromyth

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.

QuoteWhy 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.

heromyth

Quote from: thomas on February 05, 2006, 04:22:45 PM
Quote from: heromyth 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
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.

thomas

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
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."

heromyth

#40
Quote from: thomas 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.

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

QuoteStoring 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.

sasq

Quote from: heromyth on November 11, 2005, 06:41:05 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.

heromyth

Quote from: sasq on February 23, 2006, 06:52:42 AM
Quote from: heromyth on November 11, 2005, 06:41:05 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

Revvy

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

heromyth

Quote from: Revvy 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.
Maybe you can submit your works to http://developer.berlios.de/patch/?func=addpatch&group_id=5358. Then somebody can benefit from it.