Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a string table resource for Visual C# 2005?

As a developer who spent many years working within Visual C++ 6, I'm used to working with the String Table resource to store unicode strings for localization. Is there a resource within Visual Studio 2005 that provides the same? Are there any third party libraries or tools?

like image 867
Wayne Renaud Avatar asked Oct 23 '08 14:10

Wayne Renaud


People also ask

What is table of string in C?

When compiler encounters such a string, it stores it in the program's string table and generates a pointer to the string. For this reason, the following program is correct and prints - one two three. #include<stdio.h> int main(void){ char*p = "one two three"; printf(p); return 0; } c.

What are string tables?

A string table is a Windows resource that contains a list of IDs, values, and captions for all the strings of your application. For example, the status-bar prompts are located in the string table. While developing an application, you can have several string tables — one for each language or condition.


2 Answers

ResourceManager is your friend - and yes, Visual Studio still has support for it all in the editor. You might also want to read "Encoding and Localization". If you're really keen, I can thoroughly recommend Guy Smith-Ferrier's book on .NET i18n.

like image 175
Jon Skeet Avatar answered Sep 20 '22 00:09

Jon Skeet


The short answer is "resources.resx" -- if you used a template for your new project, you probably have one already. Open it up, then drop down the "resource type" picker and select Strings. You can access them as (project namespace).Properties.Resources.(string name), though you may need to prepend a "global::" to that.

Of course, as Jon points out, for multi-language localization, you can access multiple resource files independently.

like image 22
Coderer Avatar answered Sep 20 '22 00:09

Coderer