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

女生的网名这么多〃 提交于 2019-12-04 18:09:15
Ezequiel Jadib

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

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