13 Replies Latest reply on Apr 11, 2011 9:47 AM by kaienkira

    The mxmlc compiler displays the compilation errors in Japanese - and I want them in English!

    Xeal
      Working in a Japanese company I have to use a machine with Windows XP in Japanese. The thing is that I can barely read this language so it's really depressing when most Java apps (and Flex, through Eclipse, is one of them) outsmart themselves and default to displaying their UI strings/messages in Japanese without giving the user the ability to select another language.

      When compiling Flex apps using Flex Builder 2, the mxmlc compiler is internally called by the IDE to perform the compilation and then its output is displayed in the Problems View.
      Well, the English version of mxmlc, has all its messages (compilation warnings, errors etc) translated into Japanese (as far as I can tell, they are hardwired into the exe). So although I'm using the English version of the FB2, with -locale en_US specified as an argument for the compiler, all the compilation erros are reported in Japanese!

      Even after changes in "flex-config.xml" and "jvm.config" as you can see below, the compilation errors are still in Japanese. I started to doubt that there's a solution to this problem but I really hope there is one.

      TIA,
      .x.

      Here are the relevant portions of my config files and an example of mxmlc's output (Japanese might not display correctly):

      -- C:\Program Files\Adobe\Flex Builder 2\Flex SDK 2\frameworks\flex-config.xml --

      <flex-config>
      <compiler>
      <!-- Turn on generatation of accessible swfs. -->
      <accessible>false</accessible>
      <!-- Specifies the locale for internationalization. -->
      <locale>en_US</locale>
      ...
      </compiler>
      </flex-config>


      -- C:\Program Files\Adobe\Flex Builder 2\Flex SDK 2\bin\jvm.config --

      # Arguments to VM

      java.args=-Xmx384m -Dsun.io.useCanonCaches=false -Duser.language=en


      -- mxmlc invoked on the command line --

      mxmlc -o ASCIIArt -locale en_US ASCIIArt.mxml
      Loading configuration file C:\Program Files\Adobe\Flex Builder 2\Flex SDK 2\frameworks\flex-config.xml
      ASCIIArt\AsciiArtBuilder.as(7): col: 45 Error: 定義 com.example.programmingas3.asciiArt:BitmapToAsciiConverter が見つかりません。

      import com.example.programmingas3.asciiArt.BitmapToAsciiConverter;
      ^

      ASCIIArt\AsciiArtBuilder.as(8): col: 45 Error: 定義 com.example.programmingas3.asciiArt:Image が見つかりません。

      import com.example.programmingas3.asciiArt.Image;
        • 1. Re: The mxmlc compiler displays the compilation errors in Japanese - and I want them in English!
          jpwrunyan Level 1
          I'm also working at a Japanese company and so am in the same boat as you.
          I have two suggestions:
          1) Can you install Eclipse in English and compile in Flex Builder that way? I had to install Eclipse and THEN install the files to turn it into Japanese so I can't help but wonder if someone just gave you Eclipse with the japanese language set-up. Just download Eclipse and re-install and everything should be in English. That *might* take care of the compiler messages when compiling from the plug-in.

          2) Translate the messages from Japanese into English. I'm not being sarcastic. You should try cutting and pasting messages into online translation sites. My favorite is ALC : http://www.alc.co.jp/ It's got a lot of techincal definitions and is a life saver at work (although it's useless for translating daily speech).
          Of course, the messages have to be getting displayed somewhere that you can cut and paste them which may be a problem if you're using the command prompt.

          Good luck.
          • 2. Re: The mxmlc compiler displays the compilation errors in Japanese - and I want them in English!
            Xeal Level 1
            I am sorry if I was not clear enough but I have the English version of Flex Builder 2 (stand-alone). I don't even think there's a non-English version out yet. The UI is in English, but the compiler messages are in Japanese because the too-smartie JRE is detecting my Japanese OS and is setting the Locale to Japanese.
            And it's driving me nuts because I am doing exactly what you are saying. Copying and pasting the error messages to translation sites.

            Today I discovered this page with all the compiler errors&warnings and I'm searching for the error code in order to understand what's the problem. It feels so silly :)
            • 3. Re: The mxmlc compiler displays the compilation errors in Japanese - and I want them in English!
              inlineblue Level 1
              Yes, Java apps these days can be fairly easily internationalized. This is supposed to be a "good thing"...most of the time. Anyway, I don't know about your edition of XP, but the North American edition that I use allows me to change my current locale fairly easily. Control Panel -> Regional and Language Options -> Advanced tab. There's a drop-down that allows you to select the language for "non-unicode programs". I've found that this switch actually changes the OS's locale. At one point I had it set to "Chinese (PRC)" and the command-line Java apps I was using began spouting messages and log files in Chinese. Don't know if this is applicable in your case, though. :-/
              • 4. Re: The mxmlc compiler displays the compilation errors in Japanese - and I want them in English!
                Xeal Level 1
                > inlineblue:

                All editions of XP allow one to change the language for "non-unicode programs". That not only changes the system locale, code page, etc, but also changes the system fonts used by the OS and applications so a lot of programs will display "mojibake" (garbled characters) instead of Japanese characters or will not be able to locate the %userprofile%\Start Menu (because it's %userprofile%\スタート メニュー :)) and the list of problems can go on and on...

                So I have to stick to Japanese locale because everything is in Japanese here (documents, emails, etc). However, I really want my development tools to be in English, that's why I was really surprised when my English installation of Flex Builder 2 started to spit out Japanese

                As far as I can tell, mxmlc is ignoring the -locale parameter (both from command line and from flex-config.xml) and this looks like a bug. Because I don't think it's normal to run mxmlc with -locale en_US and to get the compiler messages in Japanese.
                • 5. Re: The mxmlc compiler displays the compilation errors in Japanese - and I want them in English!
                  jpwrunyan Level 1
                  I think you misunderstood me. There is no japanese version of Flex Builder out yet so you're right, that's not the problem.
                  What I suggested was installing the English version of ECLIPSE.
                  However, that was assuming you were using Flex Builder as the Eclipse Plug-in and not stand alone. However, even then, it's a bit of a shot in the dark. Maybe you should just try asking what the errors mean in a forum. There are Japanese people who look at this forum (since there is no Japanese Flex forum--at least that I have found). Not sure where you would make such a post, though... but maybe that is your best bet assuming the moderators don't delete it.

                  I guess what I am trying to say is that it may be more time-efficient to learn what the errors are than try to configure the computer to display in English...
                  • 6. Re: The mxmlc compiler displays the compilation errors in Japanese - and I want them in English!
                    Xeal Level 1
                    > jpwrunyan:

                    I have Eclipse 3.2 English version but I do not use FB2 as a plugin because it has some issues with version 3.2 of Eclipse. Are you running FB2 as an Eclipse plugin or standalone? Since you also have a Japanese XP, what language do you see the compiler messages in?

                    I also discovered this page: http://livedocs.macromedia.com/flex/2/langref/compilerErrors.html with all the compiler errors&warnings. This is what I'm using now for "translations". Until the locale issue gets fixed
                    • 7. Re: The mxmlc compiler displays the compilation errors in Japanese - and I want them in English!
                      inlineblue Level 1
                      quote:

                      Originally posted by: Xeal
                      As far as I can tell, mxmlc is ignoring the -locale parameter (both from command line and from flex-config.xml) and this looks like a bug. Because I don't think it's normal to run mxmlc with -locale en_US and to get the compiler messages in Japanese.

                      Not that this helps, but according to the docs, the "locale" compiler option "Specifies the locale that should be packaged in the SWF file". It's a localization switch for the compiled application, not the compiler.
                      • 8. Re: The mxmlc compiler displays the compilation errors in Japanese - and I want them in English!
                        jpwrunyan Level 1
                        Yeah, I am using 3.1.1 not 3.2. The messages I get are in Japanese--I assume because I installed the Japanese language set for my version of Eclipse. I came at it with opposite thinking. I figured if I DIDN'T install the Japanese set then all messages would be in English. Since I am setting this up for Japanese developers I need it to display in Japanese (which it does). I hadn't thought about what effect the operating system, etc, might have.

                        Is there any particular reason you have to use 3.2? It might be worth trying 3.1+FBPG just as an experiment to see what happens.
                        • 9. Re: The mxmlc compiler displays the compilation errors in Japanese - and I want them in English!
                          Xeal Level 1
                          inlineblue you are right about the "-locale" switch. I've just found this page on live docs:
                          http://livedocs.macromedia.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=L iveDocs_Parts&file=00001500.html
                          with all the compiler options

                          I thought that "-metadata.language <code>" (alias "-language") sets the language, but it seems that it's only for metadata.

                          So -locale is out. Thanks for clearing this for me. There's one more path left...

                          As I wrote in my first message, besides the "-locale en_US" compiler option, I am also setting the "user.language" flag in jvm.config to "en":

                          -- C:\Program Files\Adobe\Flex Builder 2\Flex SDK 2\bin\jvm.config --

                          # Arguments to VM

                          java.args=-Xmx384m -Dsun.io.useCanonCaches=false -Duser.language=en

                          According to the docs: http://livedocs.macromedia.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=L iveDocs_Parts&file=00001462.html this is the standard (only?) way to pass arguments to the JVM. And AFAIK "-Duser.language=en" is supposed to set the user language to English. But it does not happen... I have to investigate this more...
                          • 10. The mxmlc compiler displays the compilation errors in Japanese - and I want them in English!
                            Xeal Level 1
                            I found it!

                            Setting "-Duser.language=en" in jvm.config is not the right approach to get English messages for the Flex compilers:

                            java.args=-Xmx384m -Dsun.io.useCanonCaches=false -Duser.language=en

                            You have to set "-Duser.country=<anything-but-JP>" in order to get English compiler messages. Any other country except Japan is ok.

                            So this works just fine:

                            java.args=-Xmx384m -Dsun.io.useCanonCaches=false -Duser.country=RO

                            Phew!

                            I think the logic for determining the Locale in mxmlc is flawed. Why set it by country instead of language?

                            Anyway, I am quite happy that it speaks English now! :)
                            • 11. Re: The mxmlc compiler displays the compilation errors in Japanese - and I want them in English!
                              Xeal Level 1
                              I forgot to mention that changing "jvm.config" will localize only the command line version of the compilers.

                              In order to see the compiler messages in English, in the Flex Builder 2 IDE, the following JVM parameters need to be added to "FlexBuilder.ini":

                              -Duser.language=en
                              -Duser.country=US

                              For "user.country", any country code, except "JP", is okay.
                              • 12. Re: The mxmlc compiler displays the compilation errors in Japanese - and I want them in English!
                                jpwrunyan Level 1
                                I'm glad you found th eanswer and I am also glad you posted it. I'm sure this will be an issue for others as well (I'm glad to know for future reference). Anyway, thanks for posting the answer!
                                • 13. Re: The mxmlc compiler displays the compilation errors in Japanese - and I want them in English!
                                  kaienkira

                                  your article help me a lot.

                                  and for more

                                   

                                  (1)in flex 4.x, you can use -tools-locale=en for mxmlc to get english messages

                                  (but it only changes a part of output to english,it maybe a bug)

                                   

                                  (2)do not add java args in $FLEX_HOME/bin/jvm.config. it does *not* work,

                                  you must change the $FLEX_HOME/bin/mxmlc(which is a shell script)

                                   

                                  find VMARGS and add '-Duser.language=en -Duser.country=US'