diff --git a/Config/MainConfig.inc b/Config/MainConfig.inc index 77dea9e..aa356c8 100644 Binary files a/Config/MainConfig.inc and b/Config/MainConfig.inc differ diff --git a/CustomApp.ini b/CustomApp.ini index 8c162b8..4a31ed4 100644 Binary files a/CustomApp.ini and b/CustomApp.ini differ diff --git a/Folder/Config/FolderConfig.inc b/Folder/Config/FolderConfig.inc index 6df768e..4b463b0 100644 Binary files a/Folder/Config/FolderConfig.inc and b/Folder/Config/FolderConfig.inc differ diff --git a/Images/Logo.png b/Images/Logo.png index 0c56a57..06339cc 100644 Binary files a/Images/Logo.png and b/Images/Logo.png differ diff --git a/Images/PreviewImage.png b/Images/PreviewImage.png new file mode 100644 index 0000000..fdcf22c Binary files /dev/null and b/Images/PreviewImage.png differ diff --git a/Images/RMSKIN.bmp b/Images/RMSKIN.bmp index 2dfdb47..9a68c9c 100644 Binary files a/Images/RMSKIN.bmp and b/Images/RMSKIN.bmp differ diff --git a/Images/Screenshot.png b/Images/Screenshot.png index e753443..3ae9e74 100644 Binary files a/Images/Screenshot.png and b/Images/Screenshot.png differ diff --git a/Images/copy.png b/Images/copy.png index 7b51eff..01376bb 100644 Binary files a/Images/copy.png and b/Images/copy.png differ diff --git a/Images/speaker.png b/Images/speaker.png new file mode 100644 index 0000000..03a5b98 Binary files /dev/null and b/Images/speaker.png differ diff --git a/Scripts/Translate.ps1 b/Scripts/Translate.ps1 index 3cb6add..797af12 100644 --- a/Scripts/Translate.ps1 +++ b/Scripts/Translate.ps1 @@ -10,9 +10,46 @@ function Translate { $Response = Invoke-RestMethod -Uri $Uri -Method Get $Translation = $Response[0].SyncRoot | ForEach-Object { $_[0] } - $RmAPI.Bang('!SetVariable Translation1 "'+$Translation+'"') - $RmAPI.Bang('!WriteKeyValue Variables Translation1 "'+$Translation+'" "'+$VarsLocation+'"') + $RmAPI.Bang('!SetVariable Translation1 "' + $Translation + '"') + $RmAPI.Bang('!WriteKeyValue Variables Translation1 "' + $Translation + '" "' + $VarsLocation + '"') $RmAPI.Bang('!SetVariable CopyActive 1') $RmAPI.Bang('!UpdateMeter *') $RmAPI.Bang('!Update') } + +function Listen { + $Translation = $RmAPI.OptionStr('Translation') + $TargetLanguage = $RmAPI.OptionStr('TargetLanguage') + + $targetCulture = @{ + 'en' = 'en-US' + 'fr' = 'fr-FR' + 'de' = 'de-DE' + 'es' = 'es-ES' + 'it' = 'it-IT' + 'pt' = 'pt-PT' + 'ru' = 'ru-RU' + 'ja' = 'ja-JP' + 'zh' = 'zh-CN' + } + $targetCultureCode = $targetCulture[$TargetLanguage] + + if (!$targetCultureCode) { + $targetCultureCode = 'en-US' + Write-Host "Invalid target language." + } + + Add-Type -AssemblyName System.Speech + $SpeechSynthesizer = New-Object -TypeName System.Speech.Synthesis.SpeechSynthesizer + + $targetVoice = $SpeechSynthesizer.GetInstalledVoices() | Where-Object { $_.VoiceInfo.Culture.Name -eq $targetCultureCode } + + if (!$targetVoice) { + Write-Host "Target voice not found. Falling back to English." + $targetCultureCode = 'en-US' + $targetVoice = $SpeechSynthesizer.GetInstalledVoices() | Where-Object { $_.VoiceInfo.Culture.Name -eq $targetCultureCode } + } + + $SpeechSynthesizer.SelectVoice($targetVoice.VoiceInfo.Name) + $SpeechSynthesizer.Speak($Translation) +} diff --git a/Settings/Config/MainConfig.inc b/Settings/Config/MainConfig.inc index 314ed5d..dbd4088 100644 Binary files a/Settings/Config/MainConfig.inc and b/Settings/Config/MainConfig.inc differ diff --git a/Settings/Folder/Config/FolderConfig.inc b/Settings/Folder/Config/FolderConfig.inc index f0ac965..d3e6af3 100644 Binary files a/Settings/Folder/Config/FolderConfig.inc and b/Settings/Folder/Config/FolderConfig.inc differ diff --git a/Variables/VariablesData.inc b/Variables/VariablesData.inc index 80d15a1..fb9d314 100644 Binary files a/Variables/VariablesData.inc and b/Variables/VariablesData.inc differ