开发者

Windows Forms local resource file

开发者 https://www.devze.com 2023-04-04 01:31 出处:网络
I am using a number of localised form resource files in order to store translation strings. In addition to the standard component c开发者_开发问答aptions and text values, I am storing localised messag

I am using a number of localised form resource files in order to store translation strings. In addition to the standard component c开发者_开发问答aptions and text values, I am storing localised messagebox strings for things like autosave notifications.

However, when opening the form again, the additional messagebox strings have been removed from all the form resource files.

Is it not possible to store additional strings in these files? Or is there a workaround?


It sounds like you're modifying the Designer.resx files created by the designer to hold info about the controls on the form which shouldn't be modified manually as you're likely to lose any changes you've made to it when modifying the form.

Instead, add additional resource files to your project as Doliveras mentions to hold the message strings that you also want localising. These can then be combined with the Designer.resx files to create satellite assemblies for each culture you're localising for.


You can add resources files to the project and put your strings in these files.

To access these resource strings from your code you can use My.resources.resources_file_name.resource_string_name.

In order to have the same string in various languages you will need to name the resources files like this:

resource_file_1.resx

resource_file_1.es-ES.resx (for Spanish (Spain) localization)

resource_file_1.en-US.resx (for English (US) localization) ...

0

精彩评论

暂无评论...
验证码 换一张
取 消