473,407 Members | 2,598 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,407 software developers and data experts.

How to get available language resources

GS
Hello,

I use vs2005 and I try to find out how I can get a list of the cultures
where I have made resources for.

So I can make a combobox where I can choose the language I want to use.

With CultureInfo.GetCultures I became a complete list, but how can I filter
only the Cultures I need?

Thanks
Gerrit
Jan 13 '08 #1
4 4416
Gerrit,

You need to create a type that derives from ResourceManager. Then,
create an instance of your ResourceManager for the appropriate assembly. In
your derived class, you can then expose the keys to the Hashtable stored in
the ResourceSets field of the ResourceManager (it is marked as protected, so
it will be available to you).
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"GS" <gs*************@hotmail.comwrote in message
news:3b**************************@news.chello.nl.. .
Hello,

I use vs2005 and I try to find out how I can get a list of the cultures
where I have made resources for.

So I can make a combobox where I can choose the language I want to use.

With CultureInfo.GetCultures I became a complete list, but how can I
filter only the Cultures I need?

Thanks
Gerrit
Jan 13 '08 #2
GS
Nicholas,

Thanks for your answer. But I don't know how to do it. Can you give me some
hints?

I have sometihing like this, but that doesn't work..

public class MyClass
{
public void FillLanguagesComboBox()
{
MyManager manager = new MyManager();
manager.GetHashCode();
}
}

public class MyManager : ResourceManager
{

}

Thanks, Gerrit

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comschreef
in bericht news:73**********************************@microsof t.com...
Gerrit,

You need to create a type that derives from ResourceManager. Then,
create an instance of your ResourceManager for the appropriate assembly.
In your derived class, you can then expose the keys to the Hashtable
stored in the ResourceSets field of the ResourceManager (it is marked as
protected, so it will be available to you).
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"GS" <gs*************@hotmail.comwrote in message
news:3b**************************@news.chello.nl.. .
>Hello,

I use vs2005 and I try to find out how I can get a list of the cultures
where I have made resources for.

So I can make a combobox where I can choose the language I want to use.

With CultureInfo.GetCultures I became a complete list, but how can I
filter only the Cultures I need?

Thanks
Gerrit

Jan 14 '08 #3
GS,

You need to access the ResourceSets Hashtable instance exposed by the
ResourceManager class in your MyManager class. So basically, you would do
something like this:

public class MyManager : ResourceManager
{
public Hashtable GetResourceSets()
{
return ResourceSets;
}
}

You really shouldn't do it like that, as it exposes the internal
hashtable for that resource manager, which makes it open to being changed
(you should get the keys from the hashtable and expose those).
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"GS" <gs*************@hotmail.comwrote in message
news:47***********************@news.xs4all.nl...
Nicholas,

Thanks for your answer. But I don't know how to do it. Can you give me
some hints?

I have sometihing like this, but that doesn't work..

public class MyClass
{
public void FillLanguagesComboBox()
{
MyManager manager = new MyManager();
manager.GetHashCode();
}
}

public class MyManager : ResourceManager
{

}

Thanks, Gerrit

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comschreef
in bericht news:73**********************************@microsof t.com...
>Gerrit,

You need to create a type that derives from ResourceManager. Then,
create an instance of your ResourceManager for the appropriate assembly.
In your derived class, you can then expose the keys to the Hashtable
stored in the ResourceSets field of the ResourceManager (it is marked as
protected, so it will be available to you).
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"GS" <gs*************@hotmail.comwrote in message
news:3b**************************@news.chello.nl. ..
>>Hello,

I use vs2005 and I try to find out how I can get a list of the cultures
where I have made resources for.

So I can make a combobox where I can choose the language I want to use.

With CultureInfo.GetCultures I became a complete list, but how can I
filter only the Cultures I need?

Thanks
Gerrit


Jan 14 '08 #4
Unforunately is is not working, or I can not get it working.

But isn't it so that ResourceSets gets the available strings etc of the
loaded Resource / CultureInfo and not a list of the available translations?

Thanks, Gerrit

--

www.gsnel.nl
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comschreef
in bericht news:eA**************@TK2MSFTNGP02.phx.gbl...
GS,

You need to access the ResourceSets Hashtable instance exposed by the
ResourceManager class in your MyManager class. So basically, you would do
something like this:

public class MyManager : ResourceManager
{
public Hashtable GetResourceSets()
{
return ResourceSets;
}
}

You really shouldn't do it like that, as it exposes the internal
hashtable for that resource manager, which makes it open to being changed
(you should get the keys from the hashtable and expose those).
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"GS" <gs*************@hotmail.comwrote in message
news:47***********************@news.xs4all.nl...
>Nicholas,

Thanks for your answer. But I don't know how to do it. Can you give me
some hints?

I have sometihing like this, but that doesn't work..

public class MyClass
{
public void FillLanguagesComboBox()
{
MyManager manager = new MyManager();
manager.GetHashCode();
}
}

public class MyManager : ResourceManager
{

}

Thanks, Gerrit

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com>
schreef in bericht
news:73**********************************@microso ft.com...
>>Gerrit,

You need to create a type that derives from ResourceManager. Then,
create an instance of your ResourceManager for the appropriate assembly.
In your derived class, you can then expose the keys to the Hashtable
stored in the ResourceSets field of the ResourceManager (it is marked as
protected, so it will be available to you).
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"GS" <gs*************@hotmail.comwrote in message
news:3b**************************@news.chello.nl ...
Hello,

I use vs2005 and I try to find out how I can get a list of the cultures
where I have made resources for.

So I can make a combobox where I can choose the language I want to use.

With CultureInfo.GetCultures I became a complete list, but how can I
filter only the Cultures I need?

Thanks
Gerrit




Jan 14 '08 #5

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

Similar topics

82
by: Neuruss | last post by:
IronPython is currently at a pre-alpha stage suitable for experimentation but not for serious development work. http://www.ironpython.com
2
by: saravanan.arul | last post by:
Hi this sarav... I having some languages in dropdownlist(like english,tamil,japan.......) based on this dropdown selection full application need to change corresponding language.. Anyone...
34
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - What online resources are available? ----------------------------------------------------------------------- *...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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.