The Dotnet SignalR Rosetta Stone application (aka Rosetta Stone Chat) is a demo application built with the Blazor framework using server hosting. The application uses SignalR to support a real time chat user interface with calls to Azure Cognitive Translator services to perform real time translation across Chinese, English, German, Russian and Spanish languages.
The Rosetta Stone Chat application consists of 2 core components, as illustrated in the diagram below:
-
The Blazor application running SignalR server is hosted in a docker container, providing real-time websocket based chat services with front end users. These users interact with the application in their language of choice, with the application facilitating all translation services. In a production environment, these services would be hosted in the Azure SignalR Hub managed service to provide the necessary scalability.
-
The Azure service layer provides the translation services to translate user messages from their language into the 5 supported languages of the application: Chinese, English, German, Russian and Spanish. To avoid overusing these services, these calls are currently capped at 2,000 API invocations for the life of the server process.
The Rosetta Stone Chat application provides the building blocks for multi-lingual, real-time chat. There are backlog work items for increasing configurability, supporting additional languages and mobile compatability.
Two articles got me 90% of where I needed to go with the initial Rosetta Stone Chat application. The Blazor Server chat tutorial provides excellent scaffolding for getting SignalR interactions up and running with Blazor. Jeeva Subburaj's article on building a real time translation chat using SignalR and Azure Cognitive services bridged many of the gaps from the base tutorial. Since it's pre-Blazor, there was still some work to be done to get this where it needed to be.