473,785 Members | 2,317 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem in Accessing Resource Manager

Hi,
I am developing a windows application which should support different
language for this I am using "Resource Manager" default in .net
framework.

Here I am developing dll for Resource because there are different
application which can access one dll avoid duplications.

Resource File Name :
Resources/MyAppResource.d e.resx
Resources/MyAppResource.j a.resx
Resources/MyAppResource.e n.resx
Resources/MyAppResource.f r.resx

But here I am facing a big problem.
I created Resource files for four languages as above,
1] Here It is allowing me to use only two letter only if I use ja-JP
the resource manager is not loading the resource set.
2] I am able to access resource strings through "ResourceSe t" objects
only, If I create Resource Manager for each language try to access.

3] I am able to access only through the ResourceSet only.


# # # # # # # # # # #

private void button2_Click(o bject sender, System.EventArg s e)
{
CultureInfo m_EnglishCultur e = new CultureInfo("en-US");
CultureInfo m_JapanishCultu re = new CultureInfo("ja-JP");
CultureInfo m_FranceCulture = new CultureInfo("fr-CA");
CultureInfo m_DeutchCulture = new CultureInfo("de-AT");

textBox1.Text += Environment.New Line ;

textBox1.Text += GetString("frmb tn",m_EnglishCu lture ) +
Environment.New Line;
textBox1.Text += GetString("frmb tn", m_JapanishCultu re)+
Environment.New Line;
textBox1.Text += GetString("frmb tn", m_FranceCulture ) +
Environment.New Line;
textBox1.Text += GetString("frmb tn",m_DeutchCul ture ) +
Environment.New Line;

}

private Hashtable m_htResource = new Hashtable();
ResourceManager rm ;

private string GetString(strin g Key, CultureInfo cinfo)
{
string strCulutre = cinfo.TwoLetter ISOLanguageName ;;
string strReturnValue ="";
if( m_htResource.Co ntains(strCulut re) )
{
strReturnValue = ((ResourceSet)
m_htResource[strCulutre]).GetString(Key , true);
//strReturnValue =
((ResourceManag er)m_htResource[strCulutre]).GetString(key , cinfo); //
Resourcemanger
}
return strReturnValue;
}
private void LoadAllResource s()
{
if( rm == null)
{
rm = new ResourceManager ("MyAppResource .Resources.MyAp pResource",
Assembly.GetExe cutingAssembly( ));
}
string[] strAssemblies = {"en-US", "ja-JP", "de-AT", "fr-CA"};
CultureInfo c ;
foreach(string s in strAssemblies)
{
c = new CultureInfo(s);
ResourceSet rSet = rm.GetResourceS et(c, true,true);
m_htResource.Ad d(s, rSet); //en-US

if( s.Split('-').Length 1)
m_htResource.Ad d(s.Split('-')[0], rSet); // en

//ResourceManager rm1 = new
ResourceManager ("MyAppResource .Resources.MyAp pResource",
Assembly.GetExe cutingAssembly( ));
m_htResource.Ad d(s, rm1);
}
}

private void TestForm_Load(o bject sender, System.EventArg s e)
{
LoadAllResource s();
}

Jul 25 '07 #1
0 1774

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2988
by: Jaydeep | last post by:
Hello, I am facing a strange problem. Problem accessing remote database from ASP using COM+ server application having VB components (ActiveX DLL) installed. Tier 1 : ASP front End (IIS 5.0) Tire 2 : COM objects Tier 3 : SQL Server 2000 DB Flow is : ASP talks with COM objects and COM objects talks with DB Scenario 1
3
15640
by: Jagdip Singh | last post by:
Hi, We are facing problem accessing to DB2. Seems like database manager is down I tried starting it using db2start but it was neither showing any messages nor returning to command prompt after finishing start. I do not know actually if it was trying to start database or hanging somewhere
0
4546
by: Zorba.GR | last post by:
IBM DB2 Connect Enterprise Edition v8.2, other IBM DB2 (32 bit, 64 bit) (MULTiOS, Windows, Linux, Solaris), IBM iSoft Commerce Suite Server Enterprise v3.2.01, IBM Tivoli Storage Resource Manager Express Edition v1.3.2 Win, IBM Tivoli System Automation v1.2.0 Linux, IBM Tivoli Workload Scheduler Virtualized Data Centers v8.2 , other IBM Tivoli CDs, WEBSPHERE EVERYPLACE MOBILE PORTAL v5.0 - ALTIUM , other IBM WebSphere Business CDs...
2
1953
by: Rob Garfoot | last post by:
I'm hoping someone here can help with this one as I've been looking all around for a solution to this and I've yet to find one that is satisfactory. I'm trying to add support for different languages to my ASP.NET project. I have read the docs in MSDN and several sites and newsgrops but still can't get this working as advertized. I have created string resources in both a .txt and a .resx
5
2609
by: Martin Bischoff | last post by:
Hi, is it possible to implement custom resource managers for ASP.NET 2.0 so that strings can be read from a database (for example)? Ideally, it should be possible to configure the custom resource manager in web.config, so that it replaces the default resource manager. Using the <%$ ... %> syntax should read the strings via the custom resource manager, e.g. when used like this:
2
5523
by: Fredrik Rodin | last post by:
All, I'm having problems with my resource manager in ASP.NET 2.0 after conversion from ASP.NET 1.1. Here is a background: In ASP.NET 1.1 All my user controls and aspx pages inherit from base classes. A base class includes this property (among others...;-)):
9
2852
by: Alf P. Steinbach | last post by:
<what to design a C++ solution for> A Windows API /resource/ is data embedded in the executable, accessed via API functions. A resource is completely identified by the quadruple (id, type, language, file), where (1) id is what, for want of a better name, I'll call a /kludgeon/, (2) type is also a kludgeon, (3) language is a small integer identifying a concrete national language or one of a set of pseudo-languages such as the Windows...
1
2008
by: Tom | last post by:
This may seem a little strange, but in all my years of developing Windows Forms apps, I've never really used Resource files; however, I would like to start doing so in order to store icons, pictures, and most importantly, error message strings in resource files so I don't have to go searching for them inside the code (if I want them changed). I know VS 2005 makes it MUCH easier to use and create resource files, but in my few times I have...
0
5317
harshadd
by: harshadd | last post by:
Dear all, I am trying to install File server Resource Manager to apply user level directory quota. Tried to use this link for help , it is as below: I checked the GIF file But on my server I can not see item no 3 & 4 . ie File server management & File server resource manager
0
9643
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10147
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10085
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7494
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5379
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4045
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2877
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.