Alexander Wagner a écrit :
> But tell me: What do I get then? A normal variable that I
> can insert somewhere? And how is this short status bar help
> related? I do not really understand those language files.
>
Hi,
There are 2 translation processes : the simplest one is the translation
of a sentence that is
::tr "MySentence"
will call the tr proc defined in language.tcl, and look into the
relevant file in tcl/lang directory ("MySentence" MUST be present in all
language files).
More difficult is the case of the UI tokens that are translated on the
fly (for example menus are translated dynamically when you switch
language settings via the options menu). The mechanism is close to the
first one, and the best thing to do is to look at menus.tcl for examples
(beware it is a bit complex and I personaly would have used simpler
code, like the msgcat API).
For example, line 393 of menus.tcl you see :
$m add command -label SearchCurrent -command ::search::board
-accelerator "Ctrl+Shift+B" <----- SearchCurrent is the token to translate
bind . <Control-B> ::search::board
set helpMessage($m,3) SearchCurrent <---- status bar updates
Just look in tcl/lang/ files and you will notice SearchCurrent is
present in all language files.
Be very cautious about file encodings (code pages) they must remain the
same or you will corrupt those files.
Then look at line 1344 of menus.tcl :
foreach tag {Reset Negate Material Current Header Using} {
configMenuText .menu.search [tr Search$tag $oldLang] Search$tag $lang
}
Tricky isn't it ? This is where the real translation process is triggered.
> > Of course after modifying any Tcl file, a build is necessary.
>
> Sure. As far as I implement NLS I have to bake my code into
> scid, that is what I got. Right now I've a nice little
> "plugin"-style module, but this will not possible anymore
> then.
>
> How about the online Help? What do I need to do to add a
> help support? (F1-Help, ie. the long one.)
>
It is sufficent to bind F1 key to the help window. For example :
bind $w <F1> {helpWindow Index}
Help data is in tcl/help/help.tcl file.
Pascal
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Scid-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scid-users