如何在 Bot Builder (C# SDK) 中使用 RView 工具来本地化 Form Flow 中的字符串
How to use RView tool in Bot Builder (C# SDK) to localize strings in Form Flow
我需要将 FormFlow 中的所有字符串和枚举本地化为德语。如何使用RView工具生成资源文件?我已阅读以下内容,但无法理解如何使用它。谁能用简单的步骤解释一下
https://docs.microsoft.com/en-us/bot-framework/dotnet/bot-builder-dotnet-formflow-localize
我认为已经很清楚了,但让我们尝试写一些步骤:
- 在您的代码中,查找构建表单的静态方法,例如
示例 this one in the ContosoFlowers 示例。
- 找到后,捕获两件事:命名空间和程序集名称。在 ContosoFlowers 示例的上下文中,命名空间将是
ContosoFlowers.Models
和程序集 ContosoFlowers.dll
(它在您构建项目后位于 bin 文件夹中)。
- 运行
rview
工具作为 rview -g {AssemblyName} {Namespace}.{NameOfTheBuildFormMethod}.
在 ContosoFlowers 示例之后它将是 rview -g ContosoFlowers.dll ContosoFlowers.Models.BuildOrderForm
- 按照文档的配置您的项目 部分中描述的步骤将生成的
resx
文件添加到您的解决方案中。
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] ...)
我需要将 FormFlow 中的所有字符串和枚举本地化为德语。如何使用RView工具生成资源文件?我已阅读以下内容,但无法理解如何使用它。谁能用简单的步骤解释一下
https://docs.microsoft.com/en-us/bot-framework/dotnet/bot-builder-dotnet-formflow-localize
我认为已经很清楚了,但让我们尝试写一些步骤:
- 在您的代码中,查找构建表单的静态方法,例如 示例 this one in the ContosoFlowers 示例。
- 找到后,捕获两件事:命名空间和程序集名称。在 ContosoFlowers 示例的上下文中,命名空间将是
ContosoFlowers.Models
和程序集ContosoFlowers.dll
(它在您构建项目后位于 bin 文件夹中)。 - 运行
rview
工具作为rview -g {AssemblyName} {Namespace}.{NameOfTheBuildFormMethod}.
在 ContosoFlowers 示例之后它将是rview -g ContosoFlowers.dll ContosoFlowers.Models.BuildOrderForm
- 按照文档的配置您的项目 部分中描述的步骤将生成的
resx
文件添加到您的解决方案中。
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/RViewNote 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] ...)