Hi all,
It is my first release
It mainly contains new way of handling the multillingual text in eMule.
Look at - exe plus lang files:
taab-mod-exe
Look at - sources:
taab-mod-sources EDIT 05.06.2003: Do not use those links. There is new 02 release based on 0.29a release :
Finally integrated into 0.29a.
Look at - exe plus lang files: taab-mod-exe
Look at - sources: taab-mod-sources
EDIT end;
taab-mod-info.txt content (in sources)
ver .01
based on standard 0.28b eMule
1. Main feature is separated resources for strings in XML files.
first of all see discussion
http://www.emule-project.net/board/i...ST&f=4&t=19051
XML files are under lang directory.
Main implementation is in eMulei18n.cpp (h).
i18n stands for 'internationalization' - idea brought from i18n used in web-technologies, like Cocoon - see jakarta.apache.org
XML structure very similar to this used in Cocoon for i18n.
String is looked for in the following order:
- in file meessages_custom_lang.xml;
- in file messages_lang.xml;
- in file messages_ENGLISH.xml;
if not found info in Debug log - shouldn't be any however;
Idea of messages_custom_lang.xml is to allow everyone to have his own strings undependent on main source (with corrected errors, etc.)
Easiest way to create custom file is to copy original file, change name, and later on change the content of texts.
XML file looks like:
<?xml version='1.0' encoding='WINDOWS-1252'?>
<catalogue>
<message key='IDP_SOCKETS_INIT_FAILED'><![CDATA[Error initiating the windows sockets.]]></message>
<message key='IDS_ABOUTBOX'><![CDATA[&About eMule...]]></message>
<message key='IDS_HTTPDOWNLOAD_FILESTATUS'><![CDATA[%1 from %2]]></message>
<message key='IDS_HTTPDOWNLOAD_CONNECTED'><![CDATA[Connected to %1]]></message>
...
you are allowed to change only the text in CDATA markup. Don't change anything else (ID, structure), file can be not read into XML parser.
In implementation used is DOMDocument parser (fu.... interface, no normal class wrapper, could use that from C#, but the way of linking must be changed).
XML files are created for all existing langauges in eMule - used some macros and tools and hand as well to convert string table to xmls.
One problem (solved) is slow searching in DOMDocument - so additionaly I added string map to speed up the getresstring function.
Second problem - DOMDocument refused to load Koreanian and Chineese files when using its standard encoding - so I converted the files into UTF-8. Please test if strings are properly displayed.
Normally all strings has its ID - and this ID is a number, but cannot put just numbers in XML as ID (not readable),
so its stringified form is used. For this all calls to GetResString(int) must be changed to GetResString(CString). I did it using search-and-replace with regular expression.
Later on found better idea and used macro, but only in WebServer.cpp - but this idea can be applyed for all calls.
There are two or three places where it doesn't work, so I had to modify the code - search for taab:locale in sources to find it.
Warning:
this mod contains also my other add-ins/patches, no reason to describe it here - not so important - does not harm anything, you have my word!!!
Purpose:
- to give startup code, which will clean current situation, where the string are resources and nobody likes it.
Please report:
any bugs, wrongly displayed text, etc.
ideas,