Aug 01 2022 08:15 AM
We are using OAuthPrompt for signing verification in our bot project. Currently it is supporting only single language which is set at initialization time.
Is it possible to translate the OAuthPrompt Text and Title to user preferred language?
Aug 02 2022 12:09 AM
Aug 02 2022 10:51 AM
We have added the below OAuthPrompt to waterfall dialog.
AddDialog(new OAuthPrompt(
nameof(OAuthPrompt),
new OAuthPromptSettings
{
ConnectionName = ConnectionName,
Text = "Please Sign In",
Title = "Sign In",
Timeout = 300000
}));
For text and title, we have added resource string for supporting different languages. But its taking the language which is at the time of initializing only later on its not translating to the user preferred language.
While calling the OAuthPrompt , its not getting translated to the current language which is set.
return await stepContext.BeginDialogAsync(nameof(OAuthPrompt), null, cancellationToken);
Aug 03 2022 10:22 PM - edited Aug 04 2022 01:43 AM
@Aiswarya_Lakshmy - Could you please refer below document for Localization.
Globalization and localization in ASP.NET Core | Microsoft Docs
Localization in .NET | Microsoft Docs
Could you please refer below sample also:
Microsoft-Teams-Samples/samples/app-localization/csharp at main · OfficeDev/Microsoft-Teams-Samples ...
Please let us know if you have any other query. Thanks
Aug 04 2022 07:12 AM
We have already done the localization. It will take the user preferred language while initialization.
Later we have changed the user preferred language , but language of Oauth prompt is not getting changed. It will be the same language which is set at the initialization time.
Please find the attachment for Oauth prompt. Its values will be English if we have initialized in English and later if we change to German , still the Oauth prompt will be shown in English only
Is it possible to change the Oauth prompt Title and Text to the user selected language.
Aug 05 2022 03:22 AM
Aug 06 2022 04:07 AM
Yes our application is supporting multiple languages and we have done localization already and its working also
If the application is initialized in in German the resource string for Oauth prompt will be in German and if the application is initialized in English then the resource strings will be English.
On later if we change the application language , all other cards values are getting translated except this OauthPrompt , that is the issue we are having
Aug 08 2022 12:14 AM
Currently Microsoft Oauth prompt is taking the local system language.
If the language is set to German in our laptop and if we call the Oauth prompt, its taking the German resource string value . Later we changed the user preferred language to English and then we have set the culture again , but still Text and Title is taking the local system language which is German.
CultureInfo.CurrentUICulture = CultureInfo.CurrentCulture = new CultureInfo("en");
return await stepContext.BeginDialogAsync(nameof(OAuthPrompt), null, cancellationToken);
Is there any possibility to change the culture while calling the Oauth prompt
Aug 08 2022 03:39 AM
Currently Microsoft Oauth prompt is taking the local system language.
If the language is set to German in our laptop and if we call the Oauth prompt, its taking the German resource string value . Later we changed the user preferred language to English and then we have set the culture again , but still Text and Title is taking the local system language which is German.
CultureInfo.CurrentUICulture = CultureInfo.CurrentCulture = new CultureInfo("en");
return await stepContext.BeginDialogAsync(nameof(OAuthPrompt), null, cancellationToken);
Is there any possibility to change the culture while calling the Oauth prompt
Aug 08 2022 03:42 AM
Aug 10 2022 03:24 AM
When can we expect an update. We are working on this feature and currently its in blocked state. It will be good if you can update whether it is possible to do language translation for oauth prompt
Aug 10 2022 05:39 AM
Aug 10 2022 07:16 AM
Culture is set at the initialization of app itself and we are not getting any events while setting the culture.
Oauth prompt is raised when we call the below method,
public override Task<DialogTurnResult> BeginDialogAsync(DialogContext dc, object options = null, CancellationToken cancellationToken = default);
It will directly prompt the oauth prompt in UI . We have tried setting the culture just before this prompt , but still title and text is displayed in local system language
Aug 11 2022 12:34 AM
Aug 11 2022 12:53 AM
I have tried , its coming as Dutch , we have selected the user preferred language as Dutch and my local system language is English.
Please find the attached screen shot
Aug 18 2022 02:26 AM
Is there any update on this , will it be possible to do translation for oauth prompt
Aug 25 2022 04:19 AM
Aug 25 2022 04:54 AM
We have tried in Teams app by changing the app language to Dutch and then gave signin prompt. Still its taking English resource string as Title and text. I have attached the screen shot of Sign in prompt
Sep 06 2022 01:20 AM - edited Oct 20 2022 09:45 PM
@Aiswarya_Lakshmy - We got a confirmation from engineering team saying that
You have to do additional changes, just changing the language won't work. You need to update the bot to
a. read the language of the user from the installation event
b. create the sign in card with the fields in the right language based on the user locale
Then you should change the language in Teams, the bot will get the new language during install. If a and b are implemented the card will be sent in the right language back
Thanks,
Nivedipa
----------------------------------------------------------------------------------
If the response is helpful, please click "**Mark as Best Response**" and like it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.