【问题标题】:get value of specific resource string获取特定资源字符串的值
【发布时间】:2017-11-14 20:09:34
【问题描述】:

我开发了一个多语言应用程序,我的资源文件位于 App_GlobalResources 中。资源文件结构如下:

App_GlobalResources

--------Resource.ar.resx

--------Resource.resx

我想显示两种文化的资源键值。如何在两种文化中获得特定资源键的价值。

【问题讨论】:

    标签: c# multilingual resourcemanager


    【解决方案1】:

    你可以用 ResourceManager 做到这一点

            ResourceManager rm = new ResourceManager(typeof(*Your Resource Class*));
            rm.GetString("Resource Key", new CultureInfo("en"));
            rm.GetString("Resource Key", new CultureInfo("ar"));
    

    【讨论】:

    • 史蒂夫,它仍然给我文化价值。
    • @Ronak 这意味着您的 Resource.ar.resx 文件中不存在相同的密钥
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-11-20
    • 2015-09-17
    • 1970-01-01
    • 1970-01-01
    • 2021-10-13
    相关资源
    最近更新 更多