gpt4 book ai didi

c# - 如何在 Bot Builder (C# SDK) 中使用 RView 工具来本地化 Form Flow 中的字符串

转载 作者:行者123 更新时间:2023-11-30 20:29:22 24 4
gpt4 key购买 nike

我需要将 FormFlow 中的所有字符串和枚举本地化为德语。如何使用RView工具生成资源文件?我已阅读以下内容,但无法理解如何使用它。谁能用简单的步骤解释一下

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

最佳答案

我认为这已经很清楚了,但让我们尝试写一些步骤:

  1. 在您的代码中,寻找构建表单的静态方法,例如示例 this oneContosoFlowers例子。
  2. 找到它后,捕获两件事: namespace 和程序集名称。在 ContosoFlowers 的上下文中对命名空间进行采样,它将是 ContosoFlowers.Models 和程序集 ContosoFlowers.dll(生成项目后它位于 bin 文件夹中)。
  3. rview -g {AssemblyName} {Namespace}.{NameOfTheBuildFormMethod} 的形式运行 rview 工具。 按照 ContosoFlowers示例它将是 rview -g ContosoFlowers.dll ContosoFlowers.Models.BuildOrderForm
  4. 按照文档的配置您的项目部分中描述的步骤将生成的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] ...)

关于c# - 如何在 Bot Builder (C# SDK) 中使用 RView 工具来本地化 Form Flow 中的字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46199439/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com