Implement the "TRANSLATE" command to translate just one string;

rename "JSONTRANSLATE" to "TRANSLATE_DUMP"
This commit is contained in:
Dianne Skoll
2024-12-10 13:06:12 -05:00
parent 1781f84d84
commit bffa28e258
3 changed files with 50 additions and 18 deletions

View File

@@ -699,8 +699,12 @@ proc DoQueue {} {
}
proc DoTranslate {} {
# Get just the translations we can use
global DaemonFile
puts $DaemonFile "JSONTRANSLATE"
puts $DaemonFile "TRANSLATE New Moon"
puts $DaemonFile "TRANSLATE Full Moon"
puts $DaemonFile "TRANSLATE First Quarter"
puts $DaemonFile "TRANSLATE Last Quarter"
flush $DaemonFile
}
@@ -2835,17 +2839,17 @@ proc sort_q { a b } {
}
#---------------------------------------------------------------------------
# PopulateTranslations
# AddTranslation
# Arguments:
# table -- the translation table from Remind
# obj - a dictionary of the form old:new
# Returns:
# nothing
# Description:
# Populates the Translations dict object
# Updates the Translations dict object
#---------------------------------------------------------------------------
proc PopulateTranslations { table } {
proc AddTranslation { obj } {
global Translations
set Translations $table
set Translations [dict merge $Translations $obj]
ScheduleUpdateForChanges
}
@@ -2887,8 +2891,7 @@ proc DaemonReadable { file } {
set response [dict get $obj response]
switch -- $response {
"translate" {
set table [dict get $obj table]
PopulateTranslations $table
AddTranslation [dict get $obj translation]
}
"queued" {
set n [dict get $obj nqueued]