473,407 Members | 2,629 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.

Getting ressources based on culture does not work

Bob
I have a class in a VB.net 2005 project that is supposed to get strings from
a ressource file depending on the culture.
This is the code for the class
Imports System

Imports System.Globalization

Imports System.Threading

Imports System.Resources

Imports System.Reflection

Public Class clsRessources

Public Shared Function GetMsgString(ByVal RessourcNameString As String) As
String

Try

' Create a resource manager to retrieve resources.

Dim rm As New ResourceManager(AssemblyBaseNameForRm,
[Assembly].GetExecutingAssembly())

'''' Get the culture of the currently executing thread.

'''' The value of ci will determine the culture of

'''' the resources that the resource manager retrieves.

Dim ci As CultureInfo = Thread.CurrentThread.CurrentCulture

' Retrieve the value of the string resource named

' RessourcNameString localized for the culture specified by ci.

Return (rm.GetString("RessourcNameString", ci))

Catch ex As Exception

Return Nothing

MsgBox(ex.Message)

End Try

End Function

If have two ressource files in the project, One named strRessourcesErr.resx
and the other strRessourcesErr.fr.resx. Both files contain the correct
values for the ressource name string that the class is looking for yet the
class always returns nothing. No error messages are generated. the
AssemblyBaseNameForRm is correct, the value of
[Assembly].GetExecutingAssembly() I can't seem to be able to check in the
immediate window yet I suspect its OK.

Why does this not work, from reading all the docs its supposed to.

Any help appreciated.

Bob


Jun 2 '06 #1
0 756

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

Similar topics

303
by: mike420 | last post by:
In the context of LATEX, some Pythonista asked what the big successes of Lisp were. I think there were at least three *big* successes. a. orbitz.com web site uses Lisp for algorithms, etc. b....
2
by: William Gower | last post by:
I am trying to display a page that has a data grid on it. I get this message Description: An error occurred during the processing of a configuration file required to service this request....
3
by: Karunakararao | last post by:
Hi All DateTime populaing based on regional settings In ASP.NET Application Iam using this Code: Thread.CurrentThread.CurrentCulture =...
5
by: Franck | last post by:
Hello, I've just moved to visual developper 2005 to do so, I also had to use the convert assistant. what it did; moving my file resx files that i had in a diresctory called resx to a new...
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: 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
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,...
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
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...
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.