"Localizing" inherited forms?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Cor Ligthert

    #16
    Re: "Localizin g" inherited forms?

    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.Threa d.CurrentThread .CurrentUICultu re = New
    Globalization.C ultureInfo("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.


    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





    Comment

    • Nak

      #17
      Re: "Localizin g" inherited forms?

      Hi Cor,
      [color=blue]
      > I tried it yesterday however was not anymore in the mood to write.[/color]

      LOL, I know the feeling, after spending most of the morning getting
      grief from the I.R I feel like that!
      [color=blue]
      > 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.Threa d.CurrentThread .CurrentUICultu re = New
      > Globalization.C ultureInfo("en-US")
      > Than I see something strange because it gives Bier and Whiskey[/color]

      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.
      [color=blue]
      > 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.[/color]

      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.
      [color=blue]
      > 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[/color]

      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.
      [color=blue]
      > To give you more information. Both the Original and the inherited form
      > have now four RESX files
      > en
      > nl
      > nl-NL
      > the default one.[/color]

      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.


      Comment

      • Nak

        #18
        Re: "Localizin g" inherited forms?

        Hi Cor,
        [color=blue]
        > What cultures languages you want to do, there in England they have only
        > one language and one culture I thought,[/color]

        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




        Comment

        • Cor Ligthert

          #19
          Re: "Localizin g" inherited forms?

          > At the moment I'm not sure what languages it is being aimed at,[color=blue]
          > presumably the major European languages like, French, Spanish and German.
          >[/color]
          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(Netherlan ds and Belgia)

          While in Europe Russian is the major language.

          Cor


          Comment

          • Nak

            #20
            Re: "Localizin g" inherited forms?

            Hi Cor,
            [color=blue]
            > You don't get any answer anymore from me[/color]

            Woops!, I did mean most commonly spoken, not quality of nation, or I
            would never have said France... ;-)
            [color=blue]
            > 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(Netherlan ds and Belgia)
            >
            > While in Europe Russian is the major language.[/color]

            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.


            Comment

            • Jay B. Harlow [MVP - Outlook]

              #21
              Re: "Localizin g" inherited forms?

              Cor,[color=blue]
              > Now I have put in the sub new (direct after the mybase.new) of the
              > inherrited form
              > Threading.Threa d.CurrentThread .CurrentUICultu re = New
              > Globalization.C ultureInfo("en-US")[/color]
              You need to set CurrentUICultur e 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
              CurrentUICultur e, then your derived form used the new CurrentUICultur e. The
              code that actually reads the localized properties is in each form's
              InitializeCompo nent routine.

              [color=blue]
              > 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.[/color]
              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:



              I implemented my own localization for XSLT transforms:



              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).
              [color=blue]
              > 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.[/color]
              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 CurrentUICultur e 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" <notmyfirstname @planet.nl> wrote in message
              news:uLwKaCQCFH A.3592@TK2MSFTN GP09.phx.gbl...[color=blue]
              > 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.Threa d.CurrentThread .CurrentUICultu re = New
              > Globalization.C ultureInfo("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
              >
              >
              >
              >
              >[/color]


              Comment

              • Cor Ligthert

                #22
                Re: &quot;Localizin g&quot; inherited forms?

                Nick,
                [color=blue]
                > 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.
                >[/color]

                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.



                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.

                London Cockney rhyming slang, words, expressions, meanings, explanations and origins - Australian and American rhyming slang.


                Cor


                Comment

                • Cor Ligthert

                  #23
                  Re: &quot;Localizin g&quot; inherited forms?

                  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


                  Comment

                  • Dennis

                    #24
                    Re: &quot;Localizin g&quot; inherited forms?

                    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:
                    [color=blue]
                    > 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 CurrentUICultur e, 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.res x 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" <Dennis@discuss ions.microsoft. com> wrote in message
                    > news:A2927807-972D-41B9-BA73-55E624957AAE@mi crosoft.com...[color=green]
                    > > 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:
                    > >[color=darkred]
                    > >> 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" <Dennis@discuss ions.microsoft. com> wrote in message
                    > >> news:46C8E616-0C41-4A0D-B373-922DEFEEE4D5@mi crosoft.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 BrowsableAttrib ute &
                    > >> >> 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:OGkIK78BFH A.2428@TK2MSFTN GP14.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.
                    > >> >> >
                    > >> >>
                    > >> >>
                    > >> >>
                    > >>
                    > >>
                    > >>[/color][/color]
                    >
                    >
                    >[/color]

                    Comment

                    • B23

                      #25
                      &quot;Localizin g&quot; Web forms(TextBox)?

                      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
                      DevelopmentNow is an award-winning creative software development agency integrating mobile, web, hardware, mixed reality, and emerging technology.

                      Comment

                      Working...