473,416 Members | 1,849 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,416 software developers and data experts.

"Localizing" inherited forms?

Nak
Hi there,

I have some inherited forms that I wish to make "localizable",
unfortunately none of the items I wish to be "localizable" are actually
being "localized". For example, I have a few of properties which set the
text of some labels on the form which are inherited from the base form,
these text values aren't "localized" Has anyone any ideas where I'm going
wrong?

Nick.
Nov 21 '05 #1
24 1802
Nak
Hi again,

I've found a way round it by making the access modifier for each control
I wish to make localizable "Protected" rather than "Friend", then I can set
the property in the designer directly rather than through my own property.
I was hoping that there would be an attribute that I could set to my own
properties that I wish to be localizable? Thanks for any tips with this in
advance.

Nick.

"Nak" <a@a.com> wrote in message
news:OG*****************@TK2MSFTNGP12.phx.gbl...
Hi there,

I have some inherited forms that I wish to make "localizable",
unfortunately none of the items I wish to be "localizable" are actually
being "localized". For example, I have a few of properties which set the
text of some labels on the form which are inherited from the base form,
these text values aren't "localized" Has anyone any ideas where I'm going
wrong?

Nick.

Nov 21 '05 #2
"Nak" <a@a.com> wrote in message
news:OX**************@TK2MSFTNGP11.phx.gbl...
I was hoping that there would be an attribute that I could set to my
own properties that I wish to be localizable?


The attribute

System.ComponentModel.BrowsableAttribute(True)

will make the property visible in the Properties window.

HTH,
Phill W.
Nov 21 '05 #3
Nick,
Is the base form in the same assembly or a different assembly?

If the base form is in a different assembly, then as you found you need to
use "Protected" or "Protected Friend" to be able to set a controls
properties in the derived form.

I have not tried it, can't you set the base form to be localizable &
localize just be base form, then localize just the derived form? Although if
you need to rearrange controls, I can see where the derived form would need
to change the location of base controls...

Hope this helps
Jay

"Nak" <a@a.com> wrote in message
news:OX**************@TK2MSFTNGP11.phx.gbl...
Hi again,

I've found a way round it by making the access modifier for each
control I wish to make localizable "Protected" rather than "Friend", then
I can set the property in the designer directly rather than through my own
property. I was hoping that there would be an attribute that I could set
to my own properties that I wish to be localizable? Thanks for any tips
with this in advance.

Nick.

"Nak" <a@a.com> wrote in message
news:OG*****************@TK2MSFTNGP12.phx.gbl...
Hi there,

I have some inherited forms that I wish to make "localizable",
unfortunately none of the items I wish to be "localizable" are actually
being "localized". For example, I have a few of properties which set the
text of some labels on the form which are inherited from the base form,
these text values aren't "localized" Has anyone any ideas where I'm
going wrong?

Nick.


Nov 21 '05 #4
Nak
Hi Jay,
If the base form is in a different assembly, then as you found you need to
use "Protected" or "Protected Friend" to be able to set a controls
properties in the derived form.
Oh that would make sence why I was having problems seeing the objects in
the other assembly.
I have not tried it, can't you set the base form to be localizable &
localize just be base form, then localize just the derived form? Although
if you need to rearrange controls, I can see where the derived form would
need to change the location of base controls...


I'm not quite sure how that works to be honest with you, I was suprised
that it didn't localise in the first place, but then again I suppose all it
is doing is applying localisation to specific controls anyway. Unless of
course it is applying it to anything with the "browsable" attribute as
suggested by Phil. I shall have to take another look. Cheers loads for the
help!

Nick.
Nov 21 '05 #5
Nak
Hi Phil,
System.ComponentModel.BrowsableAttribute(True)


Hmmm, would take make the property localisable? I'll have to take a
look in a short while. Cheers for the tip and your time, most appreciated.

Nick.
Nov 21 '05 #6
Nick,
I don't know if there is a relationship between BrowsableAttribute &
Localizable.

I would only expect protected or public controls of the base form to be
localizable from the derived form. However I have not tried localizing an
inherited form yet...

Hope this helps
Jay

"Nak" <a@a.com> wrote in message
news:OG**************@TK2MSFTNGP14.phx.gbl...
Hi Jay,
If the base form is in a different assembly, then as you found you need
to use "Protected" or "Protected Friend" to be able to set a controls
properties in the derived form.


Oh that would make sence why I was having problems seeing the objects
in the other assembly.
I have not tried it, can't you set the base form to be localizable &
localize just be base form, then localize just the derived form? Although
if you need to rearrange controls, I can see where the derived form would
need to change the location of base controls...


I'm not quite sure how that works to be honest with you, I was suprised
that it didn't localise in the first place, but then again I suppose all
it is doing is applying localisation to specific controls anyway. Unless
of course it is applying it to anything with the "browsable" attribute as
suggested by Phil. I shall have to take another look. Cheers loads for
the help!

Nick.

Nov 21 '05 #7
Jay, I've read all I can find on Localization but still don't really
understand it. I think it's a way of using different cultural info for
things like Text Properties. What is meant by Localizing a Form?

"Jay B. Harlow [MVP - Outlook]" wrote:
Nick,
I don't know if there is a relationship between BrowsableAttribute &
Localizable.

I would only expect protected or public controls of the base form to be
localizable from the derived form. However I have not tried localizing an
inherited form yet...

Hope this helps
Jay

"Nak" <a@a.com> wrote in message
news:OG**************@TK2MSFTNGP14.phx.gbl...
Hi Jay,
If the base form is in a different assembly, then as you found you need
to use "Protected" or "Protected Friend" to be able to set a controls
properties in the derived form.


Oh that would make sence why I was having problems seeing the objects
in the other assembly.
I have not tried it, can't you set the base form to be localizable &
localize just be base form, then localize just the derived form? Although
if you need to rearrange controls, I can see where the derived form would
need to change the location of base controls...


I'm not quite sure how that works to be honest with you, I was suprised
that it didn't localise in the first place, but then again I suppose all
it is doing is applying localisation to specific controls anyway. Unless
of course it is applying it to anything with the "browsable" attribute as
suggested by Phil. I shall have to take another look. Cheers loads for
the help!

Nick.


Nov 21 '05 #8
Dennis,
Localization is the process of converting your form so it displays correctly
in different cultures (languages). Closely related to Localization is
Globalization.

For example most of my forms are in US English, if someone in Austria wanted
to use my form they would probably want a German - Austria version of the
form, so they would want a form localized to culture "de-AT". However
someone in Germany would probably want a German - Germany form or culture
"de-DE". Now someone in the Netherlands might prefer a "nl-NL" form for
Dutch - The Netherlands...

Localization often entails more then just Text Properties as the placement
of controls can be affected, for example the size of your labels will often
increase (or decrease).

Localization should also entail the text you send in Exceptions, and
possibly the order of words.

For details on Localization see:

http://msdn.microsoft.com/library/de...Namespaces.asp

http://msdn.microsoft.com/library/de...mework_sdk.asp

http://msdn.microsoft.com/library/de...calization.asp

http://msdn.microsoft.com/library/de...isualBasic.asp

Hope this helps
Jay

"Dennis" <De****@discussions.microsoft.com> wrote in message
news:46**********************************@microsof t.com...
Jay, I've read all I can find on Localization but still don't really
understand it. I think it's a way of using different cultural info for
things like Text Properties. What is meant by Localizing a Form?

"Jay B. Harlow [MVP - Outlook]" wrote:
Nick,
I don't know if there is a relationship between BrowsableAttribute &
Localizable.

I would only expect protected or public controls of the base form to be
localizable from the derived form. However I have not tried localizing an
inherited form yet...

Hope this helps
Jay

"Nak" <a@a.com> wrote in message
news:OG**************@TK2MSFTNGP14.phx.gbl...
> Hi Jay,
>
>> If the base form is in a different assembly, then as you found you
>> need
>> to use "Protected" or "Protected Friend" to be able to set a controls
>> properties in the derived form.
>
> Oh that would make sence why I was having problems seeing the
> objects
> in the other assembly.
>
>> I have not tried it, can't you set the base form to be localizable &
>> localize just be base form, then localize just the derived form?
>> Although
>> if you need to rearrange controls, I can see where the derived form
>> would
>> need to change the location of base controls...
>
> I'm not quite sure how that works to be honest with you, I was
> suprised
> that it didn't localise in the first place, but then again I suppose
> all
> it is doing is applying localisation to specific controls anyway.
> Unless
> of course it is applying it to anything with the "browsable" attribute
> as
> suggested by Phil. I shall have to take another look. Cheers loads
> for
> the help!
>
> Nick.
>


Nov 21 '05 #9
Dennis,
I should add that some countries (such as Switzerland) actually support
multiple cultures (the country has 3 official languages!).

For example:
de-CH = German - Switzerland
fr-CH = French - Switzerland
it-CH = Italian - Switzerland

So localizing your app for Switzerland might actually entail translating it
into possible 3 languages...

NOTE: doing a quick google, shows that parts of Switzerland also speak
Romansh, however I don't see that listed as a valid .NET CultureInfo
class...

Hope this helps
Jay
"Dennis" <De****@discussions.microsoft.com> wrote in message
news:46**********************************@microsof t.com...
Jay, I've read all I can find on Localization but still don't really
understand it. I think it's a way of using different cultural info for
things like Text Properties. What is meant by Localizing a Form?

"Jay B. Harlow [MVP - Outlook]" wrote:
Nick,
I don't know if there is a relationship between BrowsableAttribute &
Localizable.

I would only expect protected or public controls of the base form to be
localizable from the derived form. However I have not tried localizing an
inherited form yet...

Hope this helps
Jay

"Nak" <a@a.com> wrote in message
news:OG**************@TK2MSFTNGP14.phx.gbl...
> Hi Jay,
>
>> If the base form is in a different assembly, then as you found you
>> need
>> to use "Protected" or "Protected Friend" to be able to set a controls
>> properties in the derived form.
>
> Oh that would make sence why I was having problems seeing the
> objects
> in the other assembly.
>
>> I have not tried it, can't you set the base form to be localizable &
>> localize just be base form, then localize just the derived form?
>> Although
>> if you need to rearrange controls, I can see where the derived form
>> would
>> need to change the location of base controls...
>
> I'm not quite sure how that works to be honest with you, I was
> suprised
> that it didn't localise in the first place, but then again I suppose
> all
> it is doing is applying localisation to specific controls anyway.
> Unless
> of course it is applying it to anything with the "browsable" attribute
> as
> suggested by Phil. I shall have to take another look. Cheers loads
> for
> the help!
>
> Nick.
>


Nov 21 '05 #10
Jay,
I should add that some countries (such as Switzerland) actually support
multiple cultures (the country has 3 official languages!).


Just for the record 3 are supported as localisation however the country has
4 official languages.

There is as well Raeto-Roman (A real official and used language).

To give a in my opinion better example in this, Belgium has 3 official
languages with 2 supported languages what would mean that they have to use
nl-BE
fr-BE
de-De or de-Lu

It is in your links however now I am busy as well to let others not
misunderstood ( I know that you know this), the languages are in the OS
version, in the Framework version or in the RESX. It is not enough to set
the localization to get different languages.

By the way, is Spanish an official language in the US or only an spoken
language, I did not see a
sp-US

:-)

Cor
Nov 21 '05 #11
Nak
Hi Cor,
It is in your links however now I am busy as well to let others not
misunderstood ( I know that you know this), the languages are in the OS
version, in the Framework version or in the RESX. It is not enough to set
the localization to get different languages.


How comes? I've tested it using standard controls on forms and it seems
to work fine just flupping between different cultures, or are you referring
to string lierals and the like that would need to be created by getting the
correct string from the resource file? If you could help me on this I would
be most appreciative as I need to get this localisation right to prevent a
tonne of work at a later date! Cheers Cor!

Nick.


Nov 21 '05 #12
Nick

What cultures languages you want to do, there in England they have only one
language and one culture I thought,

Cor
Nov 21 '05 #13
Thanks Jay. I now understand what it's for and I'll do a bit more research
on how to use it. I guess if you want localized Forms, you have to create a
form for each languate you need it for then at start-up of your application,
the appropriate Form is loaded dependent on some type of CulturalInfo
setting. This setting would then also be used when you create a
resourcemanager to get different exceptions and other text.

"Jay B. Harlow [MVP - Outlook]" wrote:
Dennis,
I should add that some countries (such as Switzerland) actually support
multiple cultures (the country has 3 official languages!).

For example:
de-CH = German - Switzerland
fr-CH = French - Switzerland
it-CH = Italian - Switzerland

So localizing your app for Switzerland might actually entail translating it
into possible 3 languages...

NOTE: doing a quick google, shows that parts of Switzerland also speak
Romansh, however I don't see that listed as a valid .NET CultureInfo
class...

Hope this helps
Jay
"Dennis" <De****@discussions.microsoft.com> wrote in message
news:46**********************************@microsof t.com...
Jay, I've read all I can find on Localization but still don't really
understand it. I think it's a way of using different cultural info for
things like Text Properties. What is meant by Localizing a Form?

"Jay B. Harlow [MVP - Outlook]" wrote:
Nick,
I don't know if there is a relationship between BrowsableAttribute &
Localizable.

I would only expect protected or public controls of the base form to be
localizable from the derived form. However I have not tried localizing an
inherited form yet...

Hope this helps
Jay

"Nak" <a@a.com> wrote in message
news:OG**************@TK2MSFTNGP14.phx.gbl...
> Hi Jay,
>
>> If the base form is in a different assembly, then as you found you
>> need
>> to use "Protected" or "Protected Friend" to be able to set a controls
>> properties in the derived form.
>
> Oh that would make sence why I was having problems seeing the
> objects
> in the other assembly.
>
>> I have not tried it, can't you set the base form to be localizable &
>> localize just be base form, then localize just the derived form?
>> Although
>> if you need to rearrange controls, I can see where the derived form
>> would
>> need to change the location of base controls...
>
> I'm not quite sure how that works to be honest with you, I was
> suprised
> that it didn't localise in the first place, but then again I suppose
> all
> it is doing is applying localisation to specific controls anyway.
> Unless
> of course it is applying it to anything with the "browsable" attribute
> as
> suggested by Phil. I shall have to take another look. Cheers loads
> for
> the help!
>
> Nick.
>


Nov 21 '05 #14
Dennis,
No, you create a single form (MainForm for example). Then you localize this
single form.

When you localize it, VS.NET will create a .resx file each culture that you
localize it to, plus a "neutral" culture. The "neutral" culture is the
culture that you originally designed in the form in. The "neutral" culture
is what will be displayed if one of the specific cultures does not override
that property. For all my forms use en-US for the "neutral" language, as
that is the culture I am most familiar with.

When you start the form the system sets different properties of MainForm
based on the CurrentUICulture, it will look for the specific culture first
(de-CH), it will then look for the parent culture (de), finally it looks for
the neutral culture (the culture the form was originally designed in).

Continuing my Switzerland example:

If you use "Project - View All Files" you will see something like the
following:

MainForm.vb
MainForm.resx
MainForm.de-CH.resx
MainForm.fr-CH.resx
MainForm.it-CH.resx

The .vb has all the code for your MainForm. The first .resx file contains
the resources (property settings) for the "neutral" culture. The other three
..resx files contains resources (property settings) specific to those
cultures. If I was target most/all of Europe I would probably include de,
de-CH, de-DE, and de-AT for example. Where the MainForm.de.resx file
contains resource (property settings) used in German as a whole, then de-CH
would include only Switzerland German specific information...

In other words only the property settings for each language are created, not
a separate form for language...

Hope this helps
Jay
"Dennis" <De****@discussions.microsoft.com> wrote in message
news:A2**********************************@microsof t.com...
Thanks Jay. I now understand what it's for and I'll do a bit more
research
on how to use it. I guess if you want localized Forms, you have to create
a
form for each languate you need it for then at start-up of your
application,
the appropriate Form is loaded dependent on some type of CulturalInfo
setting. This setting would then also be used when you create a
resourcemanager to get different exceptions and other text.

"Jay B. Harlow [MVP - Outlook]" wrote:
Dennis,
I should add that some countries (such as Switzerland) actually support
multiple cultures (the country has 3 official languages!).

For example:
de-CH = German - Switzerland
fr-CH = French - Switzerland
it-CH = Italian - Switzerland

So localizing your app for Switzerland might actually entail translating
it
into possible 3 languages...

NOTE: doing a quick google, shows that parts of Switzerland also speak
Romansh, however I don't see that listed as a valid .NET CultureInfo
class...

Hope this helps
Jay
"Dennis" <De****@discussions.microsoft.com> wrote in message
news:46**********************************@microsof t.com...
> Jay, I've read all I can find on Localization but still don't really
> understand it. I think it's a way of using different cultural info for
> things like Text Properties. What is meant by Localizing a Form?
>
> "Jay B. Harlow [MVP - Outlook]" wrote:
>
>> Nick,
>> I don't know if there is a relationship between BrowsableAttribute &
>> Localizable.
>>
>> I would only expect protected or public controls of the base form to
>> be
>> localizable from the derived form. However I have not tried localizing
>> an
>> inherited form yet...
>>
>> Hope this helps
>> Jay
>>
>> "Nak" <a@a.com> wrote in message
>> news:OG**************@TK2MSFTNGP14.phx.gbl...
>> > Hi Jay,
>> >
>> >> If the base form is in a different assembly, then as you found you
>> >> need
>> >> to use "Protected" or "Protected Friend" to be able to set a
>> >> controls
>> >> properties in the derived form.
>> >
>> > Oh that would make sence why I was having problems seeing the
>> > objects
>> > in the other assembly.
>> >
>> >> I have not tried it, can't you set the base form to be localizable
>> >> &
>> >> localize just be base form, then localize just the derived form?
>> >> Although
>> >> if you need to rearrange controls, I can see where the derived form
>> >> would
>> >> need to change the location of base controls...
>> >
>> > I'm not quite sure how that works to be honest with you, I was
>> > suprised
>> > that it didn't localise in the first place, but then again I suppose
>> > all
>> > it is doing is applying localisation to specific controls anyway.
>> > Unless
>> > of course it is applying it to anything with the "browsable"
>> > attribute
>> > as
>> > suggested by Phil. I shall have to take another look. Cheers loads
>> > for
>> > the help!
>> >
>> > Nick.
>> >
>>
>>
>>


Nov 21 '05 #15
Nick,

I tried it yesterday however was not anymore in the mood to write.
I have created a form
Put one label on it.
Set the localization to true
Have set the language to Dutch and wrote "Bier" in it
Have set the language to English and wrote "Beer" in it
I have inheritted this form
I have put an extra label on it
Have set the language to Dutch and wrote "Jenever" in it
Have set the language to Englis and wrote "Whiskey" in it
I have set the startup form to the inheritted form
I have runned it and it showed Bier and Jenever
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")
Than I see something strange because it gives Bier and Whiskey

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 should be in my opinion one file for a complete project and not for
every form class in my opinion. I can only think when I do something with it
at WILLIAM J. LEDERER AND EUGENE BURDICK who describe it in a fantastic way.
http://www.wwnorton.com/catalog/fall98/uglyamerican.htm

To give you more information. Both the Original and the inherited form have
now four RESX files
en
nl
nl-NL
the default one.

I hope this gives you some ideas

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.

Even Microsoft has no versions for there programs which work all over the
world. They have versions for every language and some products even very
limited.
(Although before I give them ideas, I and probably all people from Globalize
countries would not like a version of VSNET in their special language. The
reason, the documentation is than often very flaw and than you would have to
translate words as Bier to Beer to find documentation. The last word I know
in many languages, however there are as well words, which are translated by
people who don't know the meaning and than I never, find the documentation)
Cor

Nov 21 '05 #16
Nak
Hi Cor,
I tried it yesterday however was not anymore in the mood to write.
LOL, I know the feeling, after spending most of the morning getting
grief from the I.R I feel like that!
I have created a form
Put one label on it.
Set the localization to true
Have set the language to Dutch and wrote "Bier" in it
Have set the language to English and wrote "Beer" in it
I have inheritted this form
I have put an extra label on it
Have set the language to Dutch and wrote "Jenever" in it
Have set the language to Englis and wrote "Whiskey" in it
I have set the startup form to the inheritted form
I have runned it and it showed Bier and Jenever
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")
Than I see something strange because it gives Bier and Whiskey
Mines working in a slightly different way, my base form has no
localisation, I didn't feel this was necessary as I'm only using derived
instances of it anyway, hence making the controls I want to localise as
Protected. I thought that would be quite a strange issue having to set the
language in the base *and* derived forms independently, there seems to be
allot of scope for error, though this is the first time I've needed
localisation so I could be very wrong.
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.
Yes I agree, I have the benefit that I'm not going to be the one making
the necessary "foreign" localised resources so all I have to assure is that
when a different culture is selected it will be applied correctly.
There should be in my opinion one file for a complete project and not for
every form class in my opinion. I can only think when I do something with
it at WILLIAM J. LEDERER AND EUGENE BURDICK who describe it in a fantastic
way. http://www.wwnorton.com/catalog/fall98/uglyamerican.htm
That does sound like a good idea and I believe 3rd party solutions can
offer this can't they? I don't like relying on the IDE for too much, as
it's let me down in the past many a times, as I'm sure it has most people.
To give you more information. Both the Original and the inherited form
have now four RESX files
en
nl
nl-NL
the default one.


Yeah, lots of files, I have a default and en one now for my localised
forms, presumably when the resource assembly is made with the other cultures
in and placed in the bin directory in the necessary folder it will find
everything and all will be well?

bin\en\...
bin\nl-NL\...

Cheers for your help Cor, much appreciated!

Nick.
Nov 21 '05 #17
Nak
Hi Cor,
What cultures languages you want to do, there in England they have only
one language and one culture I thought,


LOL, that's quite funny actually, considering the diversity of the
English language in Great Britain alone, but then again this is all
AmericaniZed and seeing "English - United States" makes slightly itchy...

At the moment I'm not sure what languages it is being aimed at,
presumably the major European languages like, French, Spanish and German.

Nick.

Dim English as New Colour
Dim Americanize as New Color


Nov 21 '05 #18
> At the moment I'm not sure what languages it is being aimed at,
presumably the major European languages like, French, Spanish and German.

You don't get any answer anymore from me

:-)

It is even wrong in the EU it is
German (Germany, Austria, Italia, Luxemburg, Lichtenstein) and also in
Switserland
Than probably French (France, Belgia, Monaco) and also in Switserland
Than probably English (UK, Ierland, Malta)
Than probably Italian (Italia) and also in Switserland
Than Polish
Than Spanish
Than Dutch(Netherlands and Belgia)

While in Europe Russian is the major language.

Cor
Nov 21 '05 #19
Nak
Hi Cor,
You don't get any answer anymore from me
Woops!, I did mean most commonly spoken, not quality of nation, or I
would never have said France... ;-)
It is even wrong in the EU it is
German (Germany, Austria, Italia, Luxemburg, Lichtenstein) and also in
Switserland
Than probably French (France, Belgia, Monaco) and also in Switserland
Than probably English (UK, Ierland, Malta)
Than probably Italian (Italia) and also in Switserland
Than Polish
Than Spanish
Than Dutch(Netherlands and Belgia)

While in Europe Russian is the major language.


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.

I think the choice of languages is going to be dependant on marketing
choices so that is why I said the languages that I did. No offence meant
anyway.

Nick.
Nov 21 '05 #20
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/.../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


"Cor Ligthert" <no************@planet.nl> wrote in message
news:uL**************@TK2MSFTNGP09.phx.gbl... Nick,

I tried it yesterday however was not anymore in the mood to write.
I have created a form
Put one label on it.
Set the localization to true
Have set the language to Dutch and wrote "Bier" in it
Have set the language to English and wrote "Beer" in it
I have inheritted this form
I have put an extra label on it
Have set the language to Dutch and wrote "Jenever" in it
Have set the language to Englis and wrote "Whiskey" in it
I have set the startup form to the inheritted form
I have runned it and it showed Bier and Jenever
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")
Than I see something strange because it gives Bier and Whiskey

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 should be in my opinion one file for a complete project and not for
every form class in my opinion. I can only think when I do something with
it at WILLIAM J. LEDERER AND EUGENE BURDICK who describe it in a fantastic
way. http://www.wwnorton.com/catalog/fall98/uglyamerican.htm

To give you more information. Both the Original and the inherited form
have now four RESX files
en
nl
nl-NL
the default one.

I hope this gives you some ideas

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.

Even Microsoft has no versions for there programs which work all over the
world. They have versions for every language and some products even very
limited.
(Although before I give them ideas, I and probably all people from
Globalize countries would not like a version of VSNET in their special
language. The reason, the documentation is than often very flaw and than
you would have to translate words as Bier to Beer to find documentation.
The last word I know in many languages, however there are as well words,
which are translated by people who don't know the meaning and than I
never, find the documentation)
Cor


Nov 21 '05 #21
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/europ...es/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
Nov 21 '05 #22
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
Nov 21 '05 #23
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.

"Jay B. Harlow [MVP - Outlook]" wrote:
Dennis,
No, you create a single form (MainForm for example). Then you localize this
single form.

When you localize it, VS.NET will create a .resx file each culture that you
localize it to, plus a "neutral" culture. The "neutral" culture is the
culture that you originally designed in the form in. The "neutral" culture
is what will be displayed if one of the specific cultures does not override
that property. For all my forms use en-US for the "neutral" language, as
that is the culture I am most familiar with.

When you start the form the system sets different properties of MainForm
based on the CurrentUICulture, it will look for the specific culture first
(de-CH), it will then look for the parent culture (de), finally it looks for
the neutral culture (the culture the form was originally designed in).

Continuing my Switzerland example:

If you use "Project - View All Files" you will see something like the
following:

MainForm.vb
MainForm.resx
MainForm.de-CH.resx
MainForm.fr-CH.resx
MainForm.it-CH.resx

The .vb has all the code for your MainForm. The first .resx file contains
the resources (property settings) for the "neutral" culture. The other three
..resx files contains resources (property settings) specific to those
cultures. If I was target most/all of Europe I would probably include de,
de-CH, de-DE, and de-AT for example. Where the MainForm.de.resx file
contains resource (property settings) used in German as a whole, then de-CH
would include only Switzerland German specific information...

In other words only the property settings for each language are created, not
a separate form for language...

Hope this helps
Jay
"Dennis" <De****@discussions.microsoft.com> wrote in message
news:A2**********************************@microsof t.com...
Thanks Jay. I now understand what it's for and I'll do a bit more
research
on how to use it. I guess if you want localized Forms, you have to create
a
form for each languate you need it for then at start-up of your
application,
the appropriate Form is loaded dependent on some type of CulturalInfo
setting. This setting would then also be used when you create a
resourcemanager to get different exceptions and other text.

"Jay B. Harlow [MVP - Outlook]" wrote:
Dennis,
I should add that some countries (such as Switzerland) actually support
multiple cultures (the country has 3 official languages!).

For example:
de-CH = German - Switzerland
fr-CH = French - Switzerland
it-CH = Italian - Switzerland

So localizing your app for Switzerland might actually entail translating
it
into possible 3 languages...

NOTE: doing a quick google, shows that parts of Switzerland also speak
Romansh, however I don't see that listed as a valid .NET CultureInfo
class...

Hope this helps
Jay
"Dennis" <De****@discussions.microsoft.com> wrote in message
news:46**********************************@microsof t.com...
> Jay, I've read all I can find on Localization but still don't really
> understand it. I think it's a way of using different cultural info for
> things like Text Properties. What is meant by Localizing a Form?
>
> "Jay B. Harlow [MVP - Outlook]" wrote:
>
>> Nick,
>> I don't know if there is a relationship between BrowsableAttribute &
>> Localizable.
>>
>> I would only expect protected or public controls of the base form to
>> be
>> localizable from the derived form. However I have not tried localizing
>> an
>> inherited form yet...
>>
>> Hope this helps
>> Jay
>>
>> "Nak" <a@a.com> wrote in message
>> news:OG**************@TK2MSFTNGP14.phx.gbl...
>> > Hi Jay,
>> >
>> >> If the base form is in a different assembly, then as you found you
>> >> need
>> >> to use "Protected" or "Protected Friend" to be able to set a
>> >> controls
>> >> properties in the derived form.
>> >
>> > Oh that would make sence why I was having problems seeing the
>> > objects
>> > in the other assembly.
>> >
>> >> I have not tried it, can't you set the base form to be localizable
>> >> &
>> >> localize just be base form, then localize just the derived form?
>> >> Although
>> >> if you need to rearrange controls, I can see where the derived form
>> >> would
>> >> need to change the location of base controls...
>> >
>> > I'm not quite sure how that works to be honest with you, I was
>> > suprised
>> > that it didn't localise in the first place, but then again I suppose
>> > all
>> > it is doing is applying localisation to specific controls anyway.
>> > Unless
>> > of course it is applying it to anything with the "browsable"
>> > attribute
>> > as
>> > suggested by Phil. I shall have to take another look. Cheers loads
>> > for
>> > the help!
>> >
>> > Nick.
>> >
>>
>>
>>


Nov 21 '05 #24
B23
Can someone Please Help me. ?

I have made a Windows Custom Control, that i want to import as an (Activex)
Web Custom Control. when i have Compiled my control, and then in my webform
call it by the "Object" Enitity nothing happens.
How do i do that? any Idea, or have anyone a working example.
I will be greatful for any help.
Thanks

From http://www.developmentnow.com/g/38_2...ited-forms.htm

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com
Nov 21 '05 #25

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

Similar topics

16
by: WindAndWaves | last post by:
Hi there I have $initstartdate = date("d-m-Y"); in my code How can I get it to be date() + 1 or 7 for that matter. Because my server is in the US and I am in New Zealand, they are always...
12
by: Michel Vanderbeke | last post by:
Hello, Can you please help me? To produce a "&"-sign on the screen, I use "&&". Otherwise I get an underscore on the screen. However, when a text is in a database, and I use the same field to...
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
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
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
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...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.