I have a strong preference for using text files. Other modules of this
application are written in Java, and the resource file formats are very
similar. We plan to share most of the resources to economize on translation
costs. So I would really like to get the text file method to work if at all
possible.
Thanks for your response!
Mike
You can use and compile the text format in VS2005 using some special steps.
Add a new text file, set the file extension to ".restext". Select the
file in the Solution Explorer, and set the Build Action to Embedded
Resource in the properties window.
Now you can access the string using the ResourceManager, something like
below:
ResourceManager rm2 = new ResourceManager("LocalizationSample.TextFile1",
Assembly.GetExecutingAssembly());
MessageBox.Show(rm2.GetString("mystring"));
Hope this helps,
Marin Millar [MSFT]
Mike Leftwich - 04 Feb 2006 01:55 GMT
Marin,
Ok, that worked. But I'm a little baffled as to why it worked. I tried
doing all the same steps except for changing the file extension, and it's
clear that changing the file extension is required. It doesn't work if the
extension is .txt. However, all the help topics refer to naming the file
.txt, and the IDE names it with .txt if you create a new text file in the
resource editor. In fact, after changing the file extension to .restext the
IDE shows the file with a generic icon and if you try to open the text file
in the resource editor it displays a dialog box that says, "The Managed
Resource Editor does not support the requested file type. Would you like to
open the default editor for <filename>?"
Am I mistaken in thinking that something is broken here?
Thanks for your help.
Mike
> You can use and compile the text format in VS2005 using some special steps.
> Add a new text file, set the file extension to ".restext". Select the
[quoted text clipped - 7 lines]
> Hope this helps,
> Marin Millar [MSFT]