Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #2875

    Hi,
    I find your work very helpful.
    I am running an EchoLink Simplex Node (DQ4T) for our local Amateur Radio Club. As you probably can imagine, our members would like to have the announcements in German. Changing the default language alone is not enough, the German language has some peculiarities when it comes to quoting numbers. Also we use the 24 hour clock. Some people have changed the .tcl programs to correctly spell the time in German, but I have not found a way to insert this program snippet into the framework without being eliminated on the next “recompile” action. Any ideas?

    Keep up the good work!

    73
    Georg, DD8ZX

    #2876
    Aaron, N3MBH
    Forum Administrator

    What file are you trying to modify the TCL in? Once I know that, I can probably offer some direction.

    73,
    Aaron – N3MBH / WRFV871

    OpenRepeater is offered free of charge. Find out how you can support us.

    #2877

    Hi Aaron,
    thanks for your speedy reply.
    The modified file is located in /usr/share/svxlink/events.d/local, is called locale.tcl. File size about 5 K. Can I just paste it in this window or is there a feature to upload a file?

    Thank you
    73

    Georg, DD8ZX

    #2878
    Aaron, N3MBH
    Forum Administrator

    I just wanted to confirm you meant:
    /usr/share/svxlink/events.d/local/locale.tcl

    and not
    /usr/share/svxlink/events.d/local/Logic.tcl
    This file is modified by ORP.

    The path for the locale.tcl above doesn’t exist on ORP by default. There is a locale.tcl in the directory above that though. If it is the Logic.tcl file instead that is modified by a PHP class, so you may need to modify that. If it is a locale.tcl file then we will need to figure out how that would be implemented.

    73,
    Aaron – N3MBH / WRFV871

    OpenRepeater is offered free of charge. Find out how you can support us.

    #2879

    Hi,
    /usr/share/svxlink/events.d/local/locale.tcl is correct.

    ###############################################################################
    #
    # Locale specific functions for playing back time, numbers and spelling words.
    # Often, the functions in this file are the only ones that have to be
    # reimplemented for a new language pack.
    #
    ###############################################################################
    
    #
    # Spell the specified word using a phonetic alphabet
    #
    proc spellWord {word} {
      set word [string tolower $word];
      for {set i 0} {$i < [string length $word]} {set i [expr $i + 1]} {
        set char [string index $word $i];
        if {$char == "*"} {
          playMsg "Default" "star";
        } elseif {$char == "/"} {
          playMsg "Default" "slash";
        } elseif {$char == "-"} {
          playMsg "Default" "dash";
        } elseif {[regexp {[a-z0-9]} $char]} {
          playMsg "Default" "phonetic_$char";
        }
      }
    }
    
    #
    # Spell the specified number digit for digit
    #
    proc spellNumber {number} {
      for {set i 0} {$i < [string length $number]} {set i [expr $i + 1]} {
        set ch [string index $number $i];
        if {$ch == "."} {
          playMsg "Default" "decimal";
        } else {
          playMsg "Default" "$ch";
        }
      }
    }
    
    #
    # Say the specified two digit number (00 - 99)
    #
    proc playTwoDigitNumber {number} {
      if {[string length $number] != 2} {
        puts "*** WARNING: Function playTwoDigitNumber received a non two digit number: $number";
        return;
      }
    
      set first [string index $number 0];
      if {($first == "0") || ($first == "O")} {
        playMsg "Default" $first;
        playMsg "Default" "[string index $number 1]";
      } elseif {$first == "1"} {
        playMsg "Default" $number;
      } elseif {[string index $number 1] == "0"} {
        playMsg "Default" $number;
      } else {
        if { [string index $number 1] == "1"} {
            playMsg "Default" "ein";
        } elseif { [string index $number 1] == "2"} {
            playMsg "Default" "zwo";
        } else {
            playMsg "Default" "[string index $number 1]";
        }
        playMsg "Default" "[string index $number 0]X";
      }
    
    }
    
    #
    # Say the specified three digit number (000 - 999)
    #
    proc playThreeDigitNumber {number} {
      if {[string length $number] != 3} {
        puts "*** WARNING: Function playThreeDigitNumber received a non three digit number: $number";
        return;
      }
      
      set first [string index $number 0];
      if {($first == "0") || ($first == "O")} {
        spellNumber $number
      } else {
        append first "00";
        playMsg "Default" $first;
        if {[string index $number 1] != "0"} {
          playMsg "Default" "and"
          playTwoDigitNumber [string range $number 1 2];
        } elseif {[string index $number 2] != "0"} {
          playMsg "Default" "and"
          playMsg "Default" [string index $number 2];
        }
      }
    }
    
    #
    # Say a number as intelligent as posible. Examples:
    #
    #	1	- one
    #	24	- twentyfour
    #	245	- twohundred and fourtyfive
    #	1234	- twelve thirtyfour
    #	12345	- onehundred and twentythree fourtyfive
    #	136.5	- onehundred and thirtysix point five
    #
    proc playNumber {number} {
    
      if {[regexp {\-(\d+)?} $number]} {
        playMsg "Default" "minus";
      }
    
      if {[regexp {(\d+)\.(\d+)?} $number -> integer fraction]} {
        playNumber $integer;
        playMsg "Default" "decimal";
        spellNumber $fraction;
        return;
      }
    
      while {[string length $number] > 0} {
        set len [string length $number];
        if {$len == 1} {
          playMsg "Default" $number;
          set number "";
        } elseif {$len % 2 == 0} {
          playTwoDigitNumber [string range $number 0 1];
          set number [string range $number 2 end];
        } else {
          playThreeDigitNumber [string range $number 0 2];
          set number [string range $number 3 end];
        }
      }
    }
    
    proc playTime {hour minute} {
      scan $hour "%d" hour;
      scan $minute "%d" minute;
    
      if {$hour == 0} {
        set hour 0;
      }
      if {$hour == 1} {
        playMsg "Default" "ein";
      } else {
        playNumber [expr $hour];
      }
      playMsg "Default" "uhr";
      if {$minute != 0} {
        if {[string length $minute] == 1} {
          playMsg "Default" "$minute";
        }
        playTwoDigitNumber $minute;
      }
    }
    
    #
    # This file has not been truncated
    #
    

    Just to clarify, usr/share/svxlink/sounds/de_DE contains the German sound files, they are not renamed to German, but retain their original English names, just the contents is German. There are some files with German names when there is no English equivalent like “Uhr”.

    Sorry for the trouble
    73
    Georg, DD8ZX

    #2880
    Aaron, N3MBH
    Forum Administrator

    OK, the “/usr/share/svxlink/events.d/local/locale.tcl” is not written to by ORP so that should remain unchanged. If you look at the “/usr/share/svxlink/events.d/local/Logic.tcl” in the same folder, that gets written to by ORP. Any TCL or CONG files that get written to by ORP should have a custom comment headers at the top stating so. Take a look at the Logic.tcl in that folder or the svxlink.conf file and you will see what I mean.

    My guess at this point is ORP is not breaking your locale.tcl file as it should not be writing to it. I have not used it before, so I don’t know off hand if you have to declare the file in a different file like svxlink.conf that does get overwritten by ORP.

    I would imagine that you are changing your DEFAULT_LANG in the svxlink.conf from “en_US” to “de_DE”, in that case, yes that would get overwritten by ORP. 1) you could modify the PHP class that writes this as the language is currently hard coded. This is located at “/var/www/openrepeater/includes/classes/SVXLink.php”. There are two occurrences of “en_US” in this file that would need replaced. 2) A simpler alternative that should work is to just rename your language sound folders. Maybe change “en_US” to “en_US_orig” and change “de_DE” to “en_US”

    Let me know where that gets you.

    73,
    Aaron – N3MBH / WRFV871

    OpenRepeater is offered free of charge. Find out how you can support us.

    #2898

    Problem solved. Renamed the language files to en_US, deleted old en_US and copied them to the sounds directory. Speaking perfect German now!

    73

    Georg, DD8ZX

    #2900
    Aaron, N3MBH
    Forum Administrator

    Glad to hear and thanks for reporting back so others that wish to do the same know how.

    At some point, I would like to make language switching a part of the UI, but it will still require some level of customization and obtaining/creating the appropriate language packs and maybe modifying some localization settings, so that is one reason that it’s not on the top of the list. Then there is adding translation options to the UI as well which is a whole other animal. Having been trying to work that way slowly such as separating the back-end functions from the front end code…is a progression for sure.

    73,
    Aaron – N3MBH / WRFV871

    OpenRepeater is offered free of charge. Find out how you can support us.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.