Foreign language display issue in CONNECT

I have migrated from old MDL application to the 64-bit MicroStation Connect environment. However there are still a lot of resources, such as tool dialogs and messages defined in traditional .R format. They were previously localized to multiple languages in MBCS (code-page) format and it worked in their own language platforms because those strings would display properly in non-Unicode applications if matching OS language settings.

Now, CONNECT is Unicode based application, and mdlResource_loadWString is the ONLY API to get a string from .rsc (we still built a .ma file paired with .dll file). It never read in the string right. I tried to provide .R file in mbcs (flat file), UTF-8, UTF-8 with BOM. None of them worked properly. Each have a different result but all are wrong. I need to see a sample with Asian language (such as Japanese translation) paired and demonstrated how to support localization with the old R files.

Parents
  • Thank you...I am in a pressure to get things to work and I thought there may be people in the community who had the same issue and solution.

  • Hi Peter,

    I tested with Chinese characters in .R file. It seems work fine. I just keep the "flat" character strings in .r file as below:

    MessageList STRINGID_Messages =
    {
        {
        { MSGID_CommandTable,   "Unable to load command table" },
        { MSGID_ListBox,        "列表框 行 %d, 列 %d" },
        }
    };

    The result is as below:



  • Hi ,

    I just wanted to follow up to see if 's response to try modifying the SDK Example (examples\DialogBoxes\DialogBoxDemo) helped you to test and/or resolve this issue.

    If the code you have migrated over is still exhibiting an issue please consider modifying one of these delivered examples that should also perform similarly to YongAn's approach.

         examples\DialogBoxes\myapp\English
         examples\Elements\exampletool\English

    Both SDK examples (and there are more) help to illustrate concepts discussed in the SDK help file (MicroStationAPI.chm) under parent help Topics:  "Dialog Resource Integration" and "Localization and Internationalization Guide".

    Thank you,
    Bob



  • please consider modifying one of these delivered examples that should also perform similarly to YongAn's approach.

    examples\DialogBoxes\myapp\English
    examples\Elements\exampletool\English

    Managing Language Resource Files

    I'd like to mention that the language folder (English in the above example) should be left as-is.  Create a new folder for your language.  For example:

    examples\DialogBoxes\myapp\Japanese
    examples\Elements\exampletool\Japanese

    Set the language specification (langSpec) macro in the bmake file to select the Japanese resources.  Copy the header and resource files from the English folder to the Japanese folder.  Translate those in the Japanese folder.  Now you can choose to build either an English version of your app. or a Japanese version.

    #----------------------------------------------------------------------
    #       The following section builds any translatable resource modules for
    #   the application.
    #----------------------------------------------------------------------
    $(o)$(appName)str.rsc           : $(langSpec)$(appName)str.r    \
                                        $(privateInc)$(appName).h

    I think that stuff is documented in help, but it's easily overlooked in the feverish excitement of development.

     
    Regards, Jon Summers
    LA Solutions

  • You are right, Jon.

    I just tried to test if Chinese character can be displayed correctly in CE. So modified English resource file directly in example DialogBoxDemo.



  • Thanks Yongan and Jon for the information.

    I wonder if I should save the .R file (and .H file containing the macros) as flat MBCS format, or UTF-8 encoding format (the later has two forms: one with BOM and one without). I tried all 3 ways and they yielded different results. MBCS would show the text like it is seen in western code page. UTF-8 without BOM will show wield characters. UTF-8 with BOM will show ?s for all Japanese characters.

    Both the dialogs and the call to mdlResource_loadWString do not get the right Unicode string in the program.

    Is there any special options in the building scripts that can make it do the right thing?

    Note that the old R and H files worked in the old versions because they were treated as MBCS -- and only displayed properly in the matching OS language settings (language for non-Unicode program). I was testing on a Japanese Windows 10.

  • See the red arrows. This kind of result is when I stored the .R and .H files (in english folder) as MBCS (ASCII plain) format.

    If I save the two files in UTF-8 format, then I get this:

    I won't show another image, but if I use UTF-8 with BOM, it will show lots of ? in place of non-ASCII characters.

  • Hi ,

    I am just following up on two items in this thread we did not receive feedback on to see if this helps resolve your issue.

    1. Did you have success with modifying the delivered examples language strings as I suggested?
    2. YongAn confirms modifying the sample DialogBoxDemo (DialogBoxes\DialogBoxDemo\transkit\dlogdtxt.h) worked for him. Using your favorite editor/tool can you confirm your Encoding and BOM markers align with our sample?
      1. Visual Studio Code indicates: UTF-8 CRLF
      2. Notepad++ indicates: Windows (CR,LF) UTF-8

    Thank you in advance,
    Bob



  • I posted results showing that it did not work with all 3 kinds of encoding format of the R and H files: mbcs (mbcs is the plain text format that can only show properly in the matching OS language settings when you use Notepad), UTF-8, UTF-8 BOM.

Reply Children
No Data