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
1 4453
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
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Techfan |
last post by:
Is there a way to determine which resource file the resourcemanager
GetString method utilizes in a fallback situation?
|
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...
|
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...
|
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 +...
|
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...
|
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...
|
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...
|
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...
|
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...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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
|
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...
|
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...
|
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...
|
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,...
|
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...
|
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,...
|
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...
| |