How to use RView tool in Bot Builder (C# SDK) to localize strings in Form Flow

229 views Asked by At

I need to localize all the strings and Enums in FormFlow for the German language. How can I use RView tool to generate resource files? I have read following but I couldn't understand how to use it. Can someone explain in simple steps

https://learn.microsoft.com/en-us/bot-framework/dotnet/bot-builder-dotnet-formflow-localize

1

There are 1 answers

9
Ezequiel Jadib On BEST ANSWER

I think that it's pretty clear, but let's try to write some steps:

  1. In your code, look for the static method that builds the form, for example this one in the ContosoFlowers example.
  2. Once you found it, then capture two things: the namespace and the assembly name. In the context of the ContosoFlowers sample the namespace it will be ContosoFlowers.Models and the assembly ContosoFlowers.dll (it's on the bin folder after you build the project).
  3. Run the rview tool as rview -g {AssemblyName} {Namespace}.{NameOfTheBuildFormMethod}. Following the ContosoFlowers sample it will be rview -g ContosoFlowers.dll ContosoFlowers.Models.BuildOrderForm
  4. Folllow the steps described in the Configure your project section of the doumentation to add the resulting resx file to your solution.

Note: The RView tool is included with the BotBuilder SDK nuget package. Once you add the NuGet to your project if you go to packages folder and then to the Microsoft.Bot.Builder folder, you will find a tools folder with the RView.exe file. Alternatively, you can get the source code of the tool at https://github.com/Microsoft/BotBuilder/tree/master/CSharp/Tools/RView

Note 2: If you make changes and want to recreate the resx file, do not forget to change the Neutral Language (back) to '(None)', or else the rview tool will give you an error message (Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Resources.MissingManifestResourceException: Missing resources System.Collections.Generic.List`1[System.String] ...)