【发布时间】:2019-05-17 10:48:29
【问题描述】:
我想创建一个类来翻译我的插件自定义异常消息。
我能够使用以下代码为 javascript 实现这一点:
LocalizedLabels: {
AlertMessages: {
EmaiTemplateInvitation: {
'1033': 'Please select an Email Template for invitations and try again.',
'1031': 'Bitte wählen Sie eine E-Mail-Vorlage für Einladungen aus und versuchen Sie es erneut.'
},
TypeForecastInfo: {
'1033': 'Please type Forecast information.',
'1031': 'Please type Forecast information.'
}
},
// call by
Alert.show(LocalizedLabels.AlertMessages.EmaiTemplateInvitation[Xrm.Page.context.getUserLcid()], null, null, "WARNING", 500, 200);
我想要 csharp 类似的东西。谢谢你
【问题讨论】:
-
所以基本上你想传递 int 代码并想要返回该代码的字符串?
-
不,假设我有一个异常: throw new Exception("something went wrong") 现在我想要一个类,它包含“something went wrong”的翻译,我可以这样称呼它:throw new Exception(Class.SOMETHING_WENT_WRONG),它根据当前用户登录的语言选择文本,如上面的 javascript。
标签: c# dynamic dynamics-crm dynamics-365 language-translation