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

梦想的初衷 提交于 2019-12-06 11:26:05

问题


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://docs.microsoft.com/en-us/bot-framework/dotnet/bot-builder-dotnet-formflow-localize


回答1:


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] ...)



来源:https://stackoverflow.com/questions/46199439/how-to-use-rview-tool-in-bot-builder-c-sdk-to-localize-strings-in-form-flow

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!