"Localizing" inherited forms?

J

Jay B. Harlow [MVP - Outlook]

Cor,
Now I have put in the sub new (direct after the mybase.new) of the
inherrited form
Threading.Thread.CurrentThread.CurrentUICulture = New
Globalization.CultureInfo("en-US")
You need to set CurrentUICulture before you create any forms! I would
normally put it as the very first thing in my Sub Main. When you called the
derived (inherited) form's mybase.new, the base form used the initial
CurrentUICulture, then your derived form used the new CurrentUICulture. The
code that actually reads the localized properties is in each form's
InitializeComponent routine.

I find this with the RESX a terrible system it seems for me if it is made
by people who never had anything to do with more languages.
There is nothing stating that you need to use the built-in Localization. You
are free to implement your own method. In fact Shawn implemented his own
localization for icons, bitmaps & such:

http://www.windojitsu.com/blog/resxsucks.html

I implemented my own localization for XSLT transforms:

http://msmvps.com/jayharlow/archive/2005/01/24/33766.aspx

If you search for the thread "Load icon from resx" in this newsgroup about
27 Jan 2005 you can see a copy of a ResourceLoader based on the same logic
in my code above.

For binary resources such as icons, bitmaps & such, I normally use a method
similiar to Shawn's, largely for the reasons Shawn lists on his page above.
Until the XSLT Transforms, I did not really need to localize them...

One could easily do the same for other resources (strings & property
settings).
This languages problem can in my opinion very good be done by an External
XML file where localized people write the correct text. Even when people
from Globalize countries write text in another language in a program, than
you see often strange things.
Using a "global" instance of a ResourceManager & a single .resx you could
very easily implement a single XML file for the resources. By "global" I
mean one private to a Module or Shared Class.

The major advantage of using the built-in stuff is the fall back support.
For example if CurrentUICulture is "de-DE", ResourceManager will look for
"de-DE" resources, if it doesn't find it there, it will look for "de"
resources, if it doesn't find it there, it will look in your base assembly.
As Shawn & I show in the above web pages, adding this fall back support is
not that difficult...

The other major advantage is VS.NET support, which depending on who is doing
the translation may be a hindrance more then a help.

Hope this helps
Jay
 
C

Cor Ligthert

Nick,
Hmm, I understand where you are coming from but I do believe that
English is the most spoken language, correct me if I'm wrong but you more
than likely to find English speaking people in most countries. I know
Russia is much larger, but it's one of those things.

That can be so, other people in the EU are probably more quiet, however my
roughly written table seems quiet correct for what is the first language
when I now checked it on Internet.

Here a link from your own BBC, however not that good, because I can assure
you that nobody in Holland has German as first language.

http://www.bbc.co.uk/languages/european_languages/languages/index.shtml

English is the most spoken second language in the EU, however even Herfried
has his VStudio in the German language. What Dutch, Danish, Belgian, Norsk,
Swedish probably never would.

However common software is in in the majority in the first language of those
countries and not anymore in English. Only real tools are still in English
in countries as I wrote above.

Russian is the far most spoken language 290 milion agains English 60 milion
in Europe.

This to help you with your culure choose of course.

I know now that you are from Kent, however maybe you can need this as well
for your bussiness.

http://www.businessballs.com/cockney.htm

Cor
 
C

Cor Ligthert

Jay,

I am glad again that we have more the same idea than I thought about this.

You are right about that why from the culture in the base form. I could have
set it in the way as I do in the base form, this was of course only for
testing. I did not think on that too deep.

I have as well something of my own in XML and based on the culture settings.
I thought that when there was one who has showed those at least the last
half year in this newsgroup, than it was me. :)

It is just a class that depending from the language in the globalization
returns automaticly from a table the data in the correct languages.

Until now I never liked the XSLT tranformations even on webpages where I
have XML I did not use it. Probably is that the fact that I know JavaScript
to good. (That does not mean I will never use it)

Cor
 
G

Guest

Thanks Jay. After re-reading the links you suggested numerous times plus the
tips you've given me, I now understand what Localization is and how to use
it. I appreciate your patients with me. Thanks Again.
 
B

B23

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