Locale-Concept

Since it always leads to questions and problems, on this page the SvxLink-locale-concept is described in more detail. The background of the locale-concept is on the one hand to allow the users a simple adaptation to the language of the respective country. On the other hand, these user-specific changes should not be overwritten every time the system is updated, but should of course be retained. It is therefore unfavorable to change the installed tcl files according to your own needs, as these changes would be lost after each update. Saving the tcl files and later restoring them is also unfavorable, since the new tcl files could possibly contain new or changed procedures, which would then be overwritten by the old settings.

When SvxLink is started, the event handler usually first loads the events.tcl file, which loads the other module- and logic-specific tcl files. This happens in the following order (state 1/2012 for German environment):

1) /usr/share/svxlink/events.d/
2) /usr/share/svxlink/events.d/local/
3) /usr/share/svxlink/sounds/de_DE/events.d/
4) /usr/share/svxlink/sounds/de_DE/events.d/local/
5) /usr/share/svxlink/modules.d/

So if you want to overwrite a tcl system function with your own function, e.g. to adapt the announcement of the time to the German way of speaking, you create any tcl file in the corresponding local directories, define the namespace in it first and your own function within it. Since this own file is read in the local directory AFTER the system tcl’s, the system tcl functions are overwritten by the self-defined functions.

Here is an example for the change of the roger beep, which is generated in the file Logic.tcl. In the example the pitch is to be changed from 440Hz to 800Hz:

1) Create a file beep.tcl with the following content:

namespace eval Logic {
#
# Executed when the squelch just have closed and the RGR_SOUND_DELAY timer has
# expired.
#
proc send_rgr_sound {} {
playTone 800 80 50;
playSilence 50;
}
}

2) Save this file in the directory /usr/share/svxlink/sounds/de_DE/events.d/local/. Restart SvxLink so that the new settings can be loaded.