14 Replies Latest reply on Dec 8, 2011 7:05 AM by Alibented

    language used in computer

    Alibented

      Hi,

      I'm using Director MX, which still suits me well, to produce a CD in 5 different languages.
      I would like Director to check in which language the computer of the user is set, so I can set the text I use in this language.
      Can anyone help me writing a script to do this ?
      Thanks for any help,

      Ted

        • 1. Re: language used in computer
          Sean_Wilson Adobe Community Professional

          You can examine the osLanguage property of the environment:

          put (the environment)[#osLanguage]
          

          or you can use an xtra, like Buddy API's baLanguage() function (and compare the number returned from this function with the list in the xtra's documentation)

          • 2. Re: language used in computer
            Jim Wiley Level 1

            FYI - BuddyApi also has a baSubLanguage() command to decode the locale for a given base language.

            This, I believe, is undocumented, but useful for determining which country uses a particular dialect, i.e. Simplified or Traditional Chinese for example.

            • 3. Re: language used in computer
              Alibented Level 1

              Hi,

               

              Thank you for your reply.

              I have heard of this BuddyApi, but need to know for sure it will work.

              I would like to know if the user’s oslanguage is english, dutch, erench, spanish, german or other.

              If I ask in my message box using: put (environment)[#oslanguage], it replies:  “Other”

               

              However my computers language is Dutch

               

              I’m not sure what you mean by the BuddyApi being “undocumented”

               

              Somehow I feel it should be easy, as the time of the computer can also be displayed

              Ted

               

              Van: Jim Wiley forums@adobe.com

              Verzonden: dinsdag 29 november 2011 0:45

              Aan: Alibented

              Onderwerp: language used in computer

               

               

               

               

               

              Re: language used in computer

               

               

              created by Jim Wiley <http://forums.adobe.com/people/Jim+Wiley>  in Lingo - View the full discussion <http://forums.adobe.com/message/4051298#4051298

              • 4. Re: language used in computer
                Alibented Level 1

                Hi,

                 

                Thanks for your reply.

                I have put my questions in my  reply to Jim.

                Regards,

                 

                Ted

                 

                 

                 

                Van: Sean_Wilson forums@adobe.com

                Verzonden: maandag 28 november 2011 23:54

                Aan: Alibented

                Onderwerp: language used in computer

                 

                 

                 

                 

                 

                Re: language used in computer

                 

                 

                created by Sean_Wilson <http://forums.adobe.com/people/Sean_Wilson>  in Lingo - View the full discussion <http://forums.adobe.com/message/4051221#4051221

                • 5. Re: language used in computer
                  Jim Wiley Level 1

                  Hi Ted,

                  I have been using BuddyAPI for well over 10 years to detect language (and other functions). I have millions of user CD's out in the wild.

                  It decodes the Windows Locale API using the documented baLanguage() command. BuddyAPI decodes the 4 byte language code reported by Win OS's.

                  The first 2 lower bytes report the primary language, which BuddyAPI converts to a decimal.

                  The second 2 upper bytes define the sub-language or locale of the language. This is the undocumented part of the BuddyAPI - baSubLanguage() command.

                  I have used this for Win 98 to 7. BuddyAPI allows you to use 2 commands for free without licensing it.

                  The link below will give you a better idea how the codes and commands work.

                  http://msdn.microsoft.com/en-us/library/dd318693.aspx

                  Compare this to the baLanguge() command doc's.

                  Using the LCID (Language Culture ID) that MS uses eliminates Win version issues.

                  My user CD are now going from 12 languages to 32+

                   

                  Here's the code for a simple 2 language service CD.

                  on startMovie me

                  --Sets Lang to system language/locale

                  set winLangCode = baLanguage()

                  case (winLangCode) of

                   

                  "9": set Lang= "en"

                  "4": setLang= "zh-CN"

                   

                  end case

                  end

                  For other CD's I have added the baSubLanguage to identify weither to use Simplified or Traditional Chinese for the 5 Chinese locales.

                  sprite.setLang(Lang)

                  otherwise: set Lang="zh-CN"

                  • 6. Re: language used in computer
                    Alibented Level 1

                    Hi Jim,

                     

                    Thanks for your answer.

                    I’m afraid this is too complicated for my.

                    I don’t understand what you are trying to tell me.

                    Anyway 2 languages would not work for me and I don’t see how I can test the result.

                     

                    Ted

                     

                     

                     

                    Van: Jim Wiley forums@adobe.com

                    Verzonden: dinsdag 29 november 2011 18:28

                    Aan: Alibented

                    Onderwerp: language used in computer

                     

                     

                     

                     

                     

                    Re: language used in computer

                     

                     

                    created by Jim Wiley <http://forums.adobe.com/people/Jim+Wiley>  in Lingo - View the full discussion <http://forums.adobe.com/message/4052622#4052622

                    • 7. Re: language used in computer
                      Wolfgang Herold Level 2

                      sorry ali...., but i'm afraid, if you do not understand this simple case........ end case section, and do not know that you can enter as much lines for

                      differnt languages as you want, you will not be able to do any project. This is lowest programming knowledge.

                       

                       

                      • 8. Re: language used in computer
                        Jim Wiley Level 1

                        Hey Ted,

                        Just tell me the languages. I will write it - this time without the cut'n'paste errors.

                        If you can add a Xtra, you can use this.

                        I use the standard abbreviations for the languages used for defining language in a XML file or Flash String variables.

                        It will only take me a minute or two to write it for you.

                        - Jim -

                        • 9. Re: language used in computer
                          Alibented Level 1

                          Wolfgang,

                          I’m a bit disappointed in your reaction.

                          I did not say that I don’t know what a “case ... of” statement is.

                          There was no need to rub it in that my knowledge of lingo is rather low.

                          I have been producing a CD showing how electric clocks work for more than 10 years and now I’m trying to add text in the 5 languages I speak to do some more explaining.

                          And, yes, I use only simple lingo script.

                          I don’t have a background in programming, but learned by doing and people all over the world praise me for what I’m doing.

                          Ted

                           

                           

                           

                          Van: Wolfgang Herold forums@adobe.com

                          Verzonden: vrijdag 2 december 2011 22:29

                          Aan: Alibented

                          Onderwerp: language used in computer

                           

                           

                           

                           

                           

                          Re: language used in computer

                           

                           

                          created by Wolfgang Herold <http://forums.adobe.com/people/Wolfgang+Herold>  in Lingo - View the full discussion <http://forums.adobe.com/message/4060285#4060285

                          • 10. Re: language used in computer
                            Alibented Level 1

                            Hi Jim,

                             

                            Thank you for your generous offer.

                            It will take me some time to write down and explain exactly what I want.

                            Would it be a good idea to get into direct contact with each other ?

                            My e-mail address is boscoclocks@zonnet.nl

                            Ted

                             

                             

                             

                            PS

                             

                            I’m not sure my earlier reply (2 hours ago) went out

                            So this is a copy of this earlier reply to you

                             

                             

                             

                            Van: Jim Wiley forums@adobe.com

                            Verzonden: vrijdag 2 december 2011 22:38

                            Aan: Alibented

                            Onderwerp: language used in computer

                             

                             

                             

                             

                             

                            Re: language used in computer

                             

                             

                            created by Jim Wiley <http://forums.adobe.com/people/Jim+Wiley>  in Lingo - View the full discussion <http://forums.adobe.com/message/4060382#4060382

                            • 11. Re: language used in computer
                              Alibented Level 1

                              Hi Jim,

                               

                              I did notice some little cut'n'paste errors, but that's not the problem.

                              I kept getting a script warning "Variable used before assigned a value"

                              For some reason this warning has now disappeared, but I fail to understand what it does for me.

                              In the mean time I have downloaded Buddy API 3.79 & 4.07.
                              I understand I can use 2 applications in every Projector for free.
                              However, in the help file belonging to version 3.79, baLanguage is not to be found in its index and the help file of version 4.07 shows "navigation to this webpage is cancelled".

                              I do believe baLanguage() is now accessible to me, as the Message window will return the number 19 (being the country code for Holland) when put baLanguage() or put winLangcode is typed in.

                               

                              I have been a passionate collector of electric clocks for more than 3 decades now and, as part of writing about the history of old electric clocks, I make animations of these clocks to show how the different parts work.

                              See my website www.electric-clocks.eu.

                              At this moment I don’t use much text in these animations and all text is written in English.

                              Here is what I would like to be able to do:

                               

                              I like Director to read the language of the user’s computer and return a number or string so I can use this information to show my text either in English, German, French, Spanish or Dutch.

                              If the user’s computer is set in a different language I will use English text.

                              This is probably similar to checking the (long) time of the user’s computer to set the hands of my animated clocks in such a way they show the correct time in any time zone.

                              I will still need to find a proper way to test the result.

                              Probably the best way may be to send a trial version to some people in different countries.

                               

                              Based on what you suggested earlier, I wrote the following script, expecting the text to be shown in the language my computer is set, being Dutch.

                              {Cast Member Numbers 361-5 contain the same text in different languages and cast member 361 is placed in the score (sprite(41), so I hope this will be shown when another language is used}

                               

                              on startMovie

                              set winLangcode = baLanguage()

                                   case (winLangCode) of  

                                        "  9": set the memberNum of sprite(41) to 361             -- English   

                                        "12": set the memberNum of sprite(41) to 362             -- French   

                                        "  7": set the memberNum of sprite(41) to 363             -- German          

                                        "19": set the memberNum of sprite(41) to 364             -- Dutch         

                                        "10": set the memberNum of sprite(41) to 365             -- Spanish 

                                   end case

                              end

                               

                              Unfortunately this does not work, so I tried various different ways like:

                               

                              if winLangcode = 19 then    

                                   sprite(41).memberNum = 364

                              end if

                               

                              In both cases only the English text is shown.

                              Hope you can help.

                              Ted

                              • 12. Re: language used in computer
                                Jim Wiley Level 1

                                Hi Ted,

                                The easiest method is to have the command send you to a frame# that has the text and the background displayed as you like it -in the language you need. Have it stop and loop there. Just have it go to the frame. No need to call the sprite.

                                 

                                OR

                                .Set the sprite member or just the sprite visible or not

                                pSprite.visible = TRUE

                                pSprite.visible = FALSE

                                 

                                Jim

                                • 13. Re: language used in computer
                                  Jim Wiley Level 1

                                  Hi Again Ted,

                                  Forgot to add: Change the system's language setting from the Control Panel setting in Windows. Use 'Regions and Languages" - Format section in Win7. You will also notice that there are several choices per language for many languages. the baSubLanguage() will help resolve these differences. Remember to "Apply" the change and set it back before you finish your testing.

                                  Good Luck,

                                  Jim

                                  • 14. Re: language used in computer
                                    Alibented Level 1

                                    Hi Jim,

                                    I got it working in Director MX, but ....
                                    I misinformed by saying it did not.
                                    It works using the script the way I wrote on Dec 5th.
                                    I was over the moon with the result and started to work on the text I use in all the different languages.
                                    However, when creating a Projector or Publish, it does not work !!!
                                    It just shows the text placed on the score.
                                    So in the example I gave, it shows the text of cast number 361 (which I placed on the score, so this text would be used in languges not mentioned in the case of statement).
                                    It should shown cast number 364, as my compter's language is Dutch.
                                    I wonder if this has something to do with the fact that the help function of Buddy API 4.07 shows "Navigation to this webpage is cancalled" in its information window.
                                    I decided to download a trial version of Director 11.5, but here I get the same message in Xtras and the button Publish is made inactive, so I can't see if there is any difference.

                                     

                                     

                                     

                                    I'm really in despair now and hope you can help.
                                    Ted.