Hi All,
I have a problem related to Google Translate.
I am using Google.Cloud.Translation.V2 in c# application
following code can re produce the problem I am facing
– Code Start
var client = TranslationClient.Create(Google.Apis.Auth.OAuth2.GoogleCredential.FromFile(@“keyFile.json”));
string textToTranslate = @“نود إفادتكم بأننا حضرنا جلسة اليوم وحضر المدعى عليه وطلبت من المحكمة أجل أخير للتسوية ووافقت المحكمة على تأجيل الدعوى كأجل أخير لتاريخ 12/10/2023م للتسوية أو الرد”;
string textToLang = @“en”;
string textFromLang = @“ar”;
string translatedTextReturn = string.Empty;
TranslationResult translationResult = client.TranslateText(textToTranslate, textToLang, textFromLang, TranslationModel.ServiceDefault);
translatedTextReturn = translationResult.TranslatedText;
Console.WriteLine(translatedTextReturn);
Console.ReadLine();
– Code End
translatedTextReturn = “We would like to inform you that we attended today’s session and the defendant attended, and I asked the court for a deadline for settlement, and the court agreed to postpone the case as a deadline for 10/12/2023 AD for settlement or response”
as you see I have the dd/MM/yyyy format for dates but translated text automatically converts to MM/dd/yyyy
How could I prevent this?
Thanks!!!