473,398 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

C# ResourceManager issue

Hey All,
Here is some background of what I want to do. The problem is, I don't know if it's even possible.

I want to have default translation file, built into the source code, via .resx files.

I want to allow the ability to override the culture specific types. For example, if I have a MyResources.resx, I want to be able to also have a MyResources.txt file, that will get converted to a .resource file, and then placed into a satellite assembly.

So essentially, the defaults will be compiled with app, and the others are compiled outside when needed.

Here is my challange: I want to have a method called GetValue() that will return the string of the resource. Problem: How do I create a resourceManager that will first look at the .resx, and if not there, then load the other .resources from a satellite dll. Is there a way?

here's an example:

In this example, I want to have an abstract class that will force the implementer t procive me with information to do the lookup. ie, I thought about getting them to give me the resourceName - But then I don't know where to look path wise. I thought about them giving me the Type, but if they give me the Type of class of whatever extends A, it's not helpful, because that class isn't a resource file.

public abstract class A {

abstract SOMETHING getResource();

public string getValue() {
resourceManager man = new ResourceManager(??)?
}
}

I am willing to say all resources are .txt and outside the project if that can make it work. What I can't do is have them all embedded as .resx, only the defaults can be. Any help is much appreciated!!

Thanks,
Nelson
Apr 17 '08 #1
1 4453
pootle
68
Hey All,
Here is some background of what I want to do. The problem is, I don't know if it's even possible.

I want to have default translation file, built into the source code, via .resx files.

I want to allow the ability to override the culture specific types. For example, if I have a MyResources.resx, I want to be able to also have a MyResources.txt file, that will get converted to a .resource file, and then placed into a satellite assembly.

So essentially, the defaults will be compiled with app, and the others are compiled outside when needed.

Here is my challange: I want to have a method called GetValue() that will return the string of the resource. Problem: How do I create a resourceManager that will first look at the .resx, and if not there, then load the other .resources from a satellite dll. Is there a way?

here's an example:

In this example, I want to have an abstract class that will force the implementer t procive me with information to do the lookup. ie, I thought about getting them to give me the resourceName - But then I don't know where to look path wise. I thought about them giving me the Type, but if they give me the Type of class of whatever extends A, it's not helpful, because that class isn't a resource file.

public abstract class A {

abstract SOMETHING getResource();

public string getValue() {
resourceManager man = new ResourceManager(??)?
}
}

I am willing to say all resources are .txt and outside the project if that can make it work. What I can't do is have them all embedded as .resx, only the defaults can be. Any help is much appreciated!!

Thanks,
Nelson
Hi nelsonbrodyk,


Normally, you have two options. Either you can build language support into your application (which is exactly what you want to avoid), or you can add multilingual support externally and use a tool (resgen) at build time. Personally, I always use the second approach because in my situation it is better to make text files to be sent for external translation in this way.

You can look here for a good (C#) example:
http://www.cscoding.com/article/1/1076.html

Or you can just google for "resgen".

HTH
Apr 18 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Techfan | last post by:
Is there a way to determine which resource file the resourcemanager GetString method utilizes in a fallback situation?
3
by: Nils Erik Asmundvaag | last post by:
Hello I hope someone is able to help me with this frustrating problem. I have a C# web project in Visual Studio .NET 2003. I want to support Swedish and Norwegian texts and have put the texts...
3
by: Craig | last post by:
Hi I'm creating a web control whereby I use a resource file to store strings for property descriptions and so forth. The namespace for the control is: Unsd.Web.WebControls all classes in the...
0
by: the_medeiros | last post by:
How i can use resources files to show display messages ??? I try use: private static ResourceManager resourceManager = new ResourceManager(typeof(ExceptionManager).Namespace +...
0
by: Weenie the Pooh | last post by:
We are writing an ASP.Net C# application (VS 2003) and plan to use embedded resources files for french, german and english UI. I created resx files named _todo.resx and _todo.fr-CH.resx Here...
7
by: Dennis | last post by:
I have a .resx (xml) file that contains resources. I am trying to follow the example in MSDN for creating the resource Manager as follows: Dim myAssembly As System.Reflection.Assembly...
1
by: Franz | last post by:
I know how to use ResourceManager, but I think I don't use it wisely. I have a web user control. Inside the control, I need to call ResourceManager.GetString. However, I also need to call...
0
by: ad | last post by:
We can get the string in Resource with ResourceManager like: ResourceManager rm = new ResourceManager(this.GetType().NameSpace+".Properties.Resources", this.GetType().Assembly); string...
2
by: ngrover | last post by:
When accessing strings from a french language utf-8 .txt file (that has been resgen'ed into a .resources file) via ResourceManager.GetString() method, I am encountering a problem. All the special...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.