Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Multilanguages resource file (one file)

Multilanguages resource file (one file)

Scheduled Pinned Locked Moved C / C++ / MFC
questionlearning
9 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    fregolo52
    wrote on last edited by
    #1

    Hello, I want to display automatically my application in OS language. I do not want to use satellite DLL. I would like to have all resource strings in several string table in one resource file. Is it possible ? Thank you, Freg

    B 1 Reply Last reply
    0
    • F fregolo52

      Hello, I want to display automatically my application in OS language. I do not want to use satellite DLL. I would like to have all resource strings in several string table in one resource file. Is it possible ? Thank you, Freg

      B Offline
      B Offline
      Bernhard
      wrote on last edited by
      #2

      Yes it is possible. BUT.. I am just able to talk about VC6 / no Unicode builds, because this is what we use here. We didn't had a problem with this so far.. It can be a little bit tricky with different codepages. But we never had to include Asian languages. No clue if you are going to have problems with those.


      All the label says is that this stuff contains chemicals "... known to the State of California to cause cancer in rats and low-income test subjects."
      Roger Wright
      http://www.codeproject.com/lounge.asp?select=965687&exp=5&fr=1#xx965687xx -- modified at 3:54 Thursday 9th February, 2006

      T 1 Reply Last reply
      0
      • B Bernhard

        Yes it is possible. BUT.. I am just able to talk about VC6 / no Unicode builds, because this is what we use here. We didn't had a problem with this so far.. It can be a little bit tricky with different codepages. But we never had to include Asian languages. No clue if you are going to have problems with those.


        All the label says is that this stuff contains chemicals "... known to the State of California to cause cancer in rats and low-income test subjects."
        Roger Wright
        http://www.codeproject.com/lounge.asp?select=965687&exp=5&fr=1#xx965687xx -- modified at 3:54 Thursday 9th February, 2006

        T Offline
        T Offline
        toxcct
        wrote on last edited by
        #3

        so bernhard, your solution is...?


        TOXCCT >>> GEII power
        [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]

        B 1 Reply Last reply
        0
        • T toxcct

          so bernhard, your solution is...?


          TOXCCT >>> GEII power
          [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]

          B Offline
          B Offline
          Bernhard
          wrote on last edited by
          #4

          as he said.. insert the string table in the resource file. Translate the strings. There are some programs out there which aid you in translating those files. But in general this is it. I think the asked "Is it possible to do this?" And I said: "Yes you can, as long as you don't use languages which need more than 1 byte per character"


          All the label says is that this stuff contains chemicals "... known to the State of California to cause cancer in rats and low-income test subjects."
          Roger Wright
          http://www.codeproject.com/lounge.asp?select=965687&exp=5&fr=1#xx965687xx

          T 1 Reply Last reply
          0
          • B Bernhard

            as he said.. insert the string table in the resource file. Translate the strings. There are some programs out there which aid you in translating those files. But in general this is it. I think the asked "Is it possible to do this?" And I said: "Yes you can, as long as you don't use languages which need more than 1 byte per character"


            All the label says is that this stuff contains chemicals "... known to the State of California to cause cancer in rats and low-income test subjects."
            Roger Wright
            http://www.codeproject.com/lounge.asp?select=965687&exp=5&fr=1#xx965687xx

            T Offline
            T Offline
            toxcct
            wrote on last edited by
            #5

            yeah ok... i just understood more than he asked... i thought he was asking for "how to do this...". ;) but tell me, ,as you already do it like this, could you explain a brief piece of code (considering we already have several resource string tables, and we already know how to load/display the needed strings) on how we can switch from one language to one other ?


            TOXCCT >>> GEII power
            [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]

            B 1 Reply Last reply
            0
            • T toxcct

              yeah ok... i just understood more than he asked... i thought he was asking for "how to do this...". ;) but tell me, ,as you already do it like this, could you explain a brief piece of code (considering we already have several resource string tables, and we already know how to load/display the needed strings) on how we can switch from one language to one other ?


              TOXCCT >>> GEII power
              [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]

              B Offline
              B Offline
              Bernhard
              wrote on last edited by
              #6

              Normally it takes the system preference's language. So you shouldn't need to worry about this. But you can change the behavior by hand when calling: SetThreadLocale(MAKELCID(LANG_ENGLISH,SORT_DEFAULT)); This would force the program to use the English strings after the call. One small problem you are going to encounter (at least in our setup): If the strings are in a different codepage, you are not going to see the "real" strings out of this. But as soon as the computer is set up to correct codepage, you see the strings correctly. If you'd use a unicode app, this problem should be solved (at least as much as I know.. never had the chance to try it).


              All the label says is that this stuff contains chemicals "... known to the State of California to cause cancer in rats and low-income test subjects."
              Roger Wright
              http://www.codeproject.com/lounge.asp?select=965687&exp=5&fr=1#xx965687xx

              F T 2 Replies Last reply
              0
              • B Bernhard

                Normally it takes the system preference's language. So you shouldn't need to worry about this. But you can change the behavior by hand when calling: SetThreadLocale(MAKELCID(LANG_ENGLISH,SORT_DEFAULT)); This would force the program to use the English strings after the call. One small problem you are going to encounter (at least in our setup): If the strings are in a different codepage, you are not going to see the "real" strings out of this. But as soon as the computer is set up to correct codepage, you see the strings correctly. If you'd use a unicode app, this problem should be solved (at least as much as I know.. never had the chance to try it).


                All the label says is that this stuff contains chemicals "... known to the State of California to cause cancer in rats and low-income test subjects."
                Roger Wright
                http://www.codeproject.com/lounge.asp?select=965687&exp=5&fr=1#xx965687xx

                F Offline
                F Offline
                fregolo52
                wrote on last edited by
                #7

                Ok, I'm going to try this solution.:)

                1 Reply Last reply
                0
                • B Bernhard

                  Normally it takes the system preference's language. So you shouldn't need to worry about this. But you can change the behavior by hand when calling: SetThreadLocale(MAKELCID(LANG_ENGLISH,SORT_DEFAULT)); This would force the program to use the English strings after the call. One small problem you are going to encounter (at least in our setup): If the strings are in a different codepage, you are not going to see the "real" strings out of this. But as soon as the computer is set up to correct codepage, you see the strings correctly. If you'd use a unicode app, this problem should be solved (at least as much as I know.. never had the chance to try it).


                  All the label says is that this stuff contains chemicals "... known to the State of California to cause cancer in rats and low-income test subjects."
                  Roger Wright
                  http://www.codeproject.com/lounge.asp?select=965687&exp=5&fr=1#xx965687xx

                  T Offline
                  T Offline
                  toxcct
                  wrote on last edited by
                  #8

                  one last question : where to call SetThreadLocale() ? anywhere after OnInitDialog() ? what are this macros (how are they defined) ? : MAKELCID(), LANG_ENGLISH, SORT_DEFAULT. thanks for the prompt and concise answer... :rose: ps: i don't have any visual studio installed, and am quite bored about msdn today, so here is why i ask all this to someone who seems to wqell know the subject...


                  TOXCCT >>> GEII power
                  [toxcct][VisualCalc 2.20][VCalc 3.0 soon...] -- modified at 4:19 Thursday 9th February, 2006

                  B 1 Reply Last reply
                  0
                  • T toxcct

                    one last question : where to call SetThreadLocale() ? anywhere after OnInitDialog() ? what are this macros (how are they defined) ? : MAKELCID(), LANG_ENGLISH, SORT_DEFAULT. thanks for the prompt and concise answer... :rose: ps: i don't have any visual studio installed, and am quite bored about msdn today, so here is why i ask all this to someone who seems to wqell know the subject...


                    TOXCCT >>> GEII power
                    [toxcct][VisualCalc 2.20][VCalc 3.0 soon...] -- modified at 4:19 Thursday 9th February, 2006

                    B Offline
                    B Offline
                    Bernhard
                    wrote on last edited by
                    #9

                    We are calling it the InitInstance of the application. Then all the dialogs / views are set up with the correct strings. If you want to change the language at runtime, you have to call this language first and then "refresh" all your views / menus whatever. (Set the item texts with the new strings from the resource table) (But this whole process depends on the structure of the program) More information on SetThreadLocal http://msdn.microsoft.com/library/default.asp?url=/library/en-us/intl/nls\_52lh.asp Regarding your exact question: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/intl/nls\_7qck.asp


                    All the label says is that this stuff contains chemicals "... known to the State of California to cause cancer in rats and low-income test subjects."
                    Roger Wright
                    http://www.codeproject.com/lounge.asp?select=965687&exp=5&fr=1#xx965687xx

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups