Dynamic language dependent ressources

G

Guest

Hello,

how would you solve in general the following requirement:
my application will ask you to login with a language, so you have installed
on your desktop one version of my application, providing multilanguage
support that means text, description, column names etc. will be displayed in
your login language.

The issue around translations of table columns is solved by myself, I will
dynamically display language dependent column titles (using SQL table for
translation of column names and updating the controls which are bound to this
a data column).

But how should I handle all the rest?

I'm using already the project resources (text strings) and fill "caption"
and "text" and other properties of the controls by these resource strings.

So is possible to change the resource file at run-time to get all text etc.
displayed in your language? If not, should I maintain in SQL a table doing
the translation for me how I did for SQL table column titles?

I don't want to compile individual program versions for each language,
install them on the computer and the user has to select the exe file of the
specific language each time he is using the program, this wouldn't be nice.


Thanks
Stephan
 
B

Ben Voigt

Stephan Hofmann said:
Hello,

how would you solve in general the following requirement:
my application will ask you to login with a language, so you have
installed
on your desktop one version of my application, providing multilanguage
support that means text, description, column names etc. will be displayed
in
your login language.

The issue around translations of table columns is solved by myself, I will
dynamically display language dependent column titles (using SQL table for
translation of column names and updating the controls which are bound to
this
a data column).

But how should I handle all the rest?

I'm using already the project resources (text strings) and fill "caption"
and "text" and other properties of the controls by these resource strings.

So is possible to change the resource file at run-time to get all text
etc.
displayed in your language? If not, should I maintain in SQL a table doing
the translation for me how I did for SQL table column titles?

You can certainly load a particular resources module using Assembly.Load and
then call the resource methods that take an assembly parameter, for
resources you handle that way.

The designer-generated resources file includes a "Culture" property you can
reassign. I'm not sure if this will affect the display of UI-elements such
as forms, etc. Actually, looking at InitializeComponent, I think you'd have
to rewrite that to retrieve resources, because I've got constant strings
appearing in the designer-generated code on my non-localizable (prototype
only) app.
 
G

Gaurav Vaish \(EduJini.IN\)

The designer-generated resources file includes a "Culture" property you
can reassign. I'm not sure if this will affect the display of UI-elements
such as forms, etc. Actually, looking at InitializeComponent, I think
you'd have

No. You wouldn't need to rewrite anything.

In the constructor of the class, before the InitializeComponent method is
called, change the culture using:

Thread.CurrentCulture = ...
Thread.CurrentUICulture = ...


--
Cheers,
Gaurav Vaish
http://www.mastergaurav.org
http://www.edujini.in
-------------------
 
G

Guest

Hello,

thanks for the hint. I found the following:
my.application.ChangeUICulture ("xx") (xx = two chars for country) before
the InitializeComponent as you mentioned.

Yours
Stephan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top