How to do pretranslation, using a macro

Hello,

at the moment, I'm trying to create a macro for Passolo 2022, which I can start to run a pretranslation of my untranslated strings.

Unfortunately, I don't know, how to get this done.
I've tried to use

Dim Translation As PslTranslations
Dim t As PslTranslation
If TranslationList.IsDeleted = False And TranslationList.Language.LangID = PSL.GetLangID(Right(project.Name, 2), pslCodeISO) Then
	For x = 1 To TranslationList.StringCount - 1
		If TranslationList.String(x).State(pslStateTranslated) = False Then
			PSL.Output(TranslationList.Title & ", String-Nummer: " & TranslationList.String(x).Number & ", String-ID: " & TranslationList.String(x).ID & ", String-Text: " & TranslationList.String(x).Text)
			TranslationList.String(x).Text = PSL.TranslateText(TranslationList.String(x).SourceText, 1031, 1033, 100)
			logMessage = Chr(9) & Chr(9) & "Translist-Titel: '" & TranslationList.Title & "', String Nummer: " & TranslationList.String(x).Number & ", ID: '" & TranslationList.String(s).ID & "', String-Text: '" & TranslationList.String(s).Text & "', Sprach-Code: '" & TranslationList.String(s).TransList.Language.LangID & "', Quellstring: '" & TranslationList.String(x).SourceText & "',  Übersetzung: '" & TranslationList.String(x).Text & "'"
			WriteLog(logMessage, pretranslationLog)
		End If
	Next
End If
as well as
Dim Translation As PslTranslations
Dim t As PslTranslation
If TranslationList.IsDeleted = False And TranslationList.Language.LangID = PSL.GetLangID(Right(project.Name, 2), pslCodeISO) Then
	For x = 1 To TranslationList.StringCount - 1
		If TranslationList.String(x).State(pslStateTranslated) = False Then
			PSL.Output(TranslationList.Title & ", String-Nummer: " & TranslationList.String(x).Number & ", String-ID: " & TranslationList.String(x).ID & ", String-Text: " & TranslationList.String(x).Text)
			Set Translation = PSL.TranslateText(TranslationList.String(x).SourceText, 1031, 1033, 100)
			logMessage = Chr(9) & Chr(9) & "Translist-Titel: '" & TranslationList.Title & "', String Nummer: " & TranslationList.String(x).Number & ", ID: '" & TranslationList.String(s).ID & "', String-Text: '" & TranslationList.String(s).Text & "', Sprach-Code: '" & TranslationList.String(s).TransList.Language.LangID & "', Quellstring: '" & TranslationList.String(x).SourceText & "',  Übersetzung: '" & TranslationList.String(x).Text & "'"
			WriteLog(logMessage, pretranslationLog)
		End If
	Next
End If
but neither worked.

What do I have to do or what to I have to use instead, to get my pretranslation done by a macro?

Thank you very much in advance for your hints and your support.

Kind regards and have a great day.

Nils

emoji
Parents Reply Children