如何本地化字幕的消息框的标题/消息? [英] How to localize strings for caption/msg of messageboxes?

查看:87
本文介绍了如何本地化字幕的消息框的标题/消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用资源翻译表单上标签和按钮的任何修订文本是直截了当的:设置Localizable / Language属性并只写相应的字符串。


但是它对于要在消息框中显示的字符串有一个类似的解决方案真的那么不同和复杂:


                 MsgBox(My.Resources.license_expired& vbCrLf& My.Resources.contact_vendor,MsgBoxStyle.Information,My.Resources.license_issue)


It se < span style =""> ems 从资源中选择这些值,因为您可以在项目属性上添加它们
资源选项卡,但忽略作为资源文件添加到项目中的任何内容,更不用说其他语言资源了。


那么,如何获得与表单/对象类似的解决方案? Main.resx,Main.nl-NL.resx,...


我很想添加一个虚拟表单,在其上放置一堆公共标签,翻译它们,然后使用这些作为资源在调用消息框时。


似乎比使用附属程序集更简单...


谁让我朝着正确的方向前进?

解决方案

如果你忙于语言,那么我的资源就是Resources.resx,那么你需要resx。 


否则你必须做项目 - >项目属性 - >资源


Using resources to translate any fix texts of labels and buttons on forms is straight forward: set the Localizable/Language properties and just write the corresponding strings.

But is it really that different and complex to have a similar solution for strings that are to be shown in message boxes:

                MsgBox(My.Resources.license_expired & vbCrLf & My.Resources.contact_vendor, MsgBoxStyle.Information, My.Resources.license_issue)

It seems to pick these values up from the resources as you can add them on the project properties resource tab, but ignores anything added to the project as resource file, let alone another language resource.

So, how to have a similar solution as for the forms/objects? Main.resx, Main.nl-NL.resx, ...

I'm tempted to add a dummy form, put a bunch of public labels on it, translate them, and use these as a resource when calling a message box.

Seems simpler than working with satellite assemblies...

Who puts me in the right direction?

解决方案

My Resources is something else then Resources.resx if you are busy with languages then you need the resx. 

Otherwise you have to do Project -> Project properties -> resources


这篇关于如何本地化字幕的消息框的标题/消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆