- This topic has 7 replies, 2 voices, and was last updated 5 years, 4 months ago by Aaron, N3MBH.
-
AuthorPosts
-
June 18, 2019 at 8:39 am #2875Georg, DD8ZXUser
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, DD8ZXJune 18, 2019 at 12:01 pm #2876Aaron, N3MBHForum AdministratorWhat file are you trying to modify the TCL in? Once I know that, I can probably offer some direction.
73,
Aaron – N3MBH / WRFV871OpenRepeater is offered free of charge. Find out how you can support us.
June 18, 2019 at 5:32 pm #2877Georg, DD8ZXUserHi 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
73Georg, DD8ZX
June 18, 2019 at 7:51 pm #2878Aaron, N3MBHForum AdministratorI just wanted to confirm you meant:
/usr/share/svxlink/events.d/local/locale.tcland 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 / WRFV871OpenRepeater is offered free of charge. Find out how you can support us.
June 19, 2019 at 6:03 am #2879Georg, DD8ZXUserHi,
/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, DD8ZXJune 19, 2019 at 8:47 am #2880Aaron, N3MBHForum AdministratorOK, 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 / WRFV871OpenRepeater is offered free of charge. Find out how you can support us.
July 2, 2019 at 9:46 am #2898Georg, DD8ZXUserProblem 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
July 2, 2019 at 11:06 am #2900Aaron, N3MBHForum AdministratorGlad 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 / WRFV871OpenRepeater is offered free of charge. Find out how you can support us.
-
AuthorPosts
- You must be logged in to reply to this topic.