Combine GUI_LANG_LoadCSVEx with GUI_LANG_LoadTextEx()?

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Combine GUI_LANG_LoadCSVEx with GUI_LANG_LoadTextEx()?

    Hi,

    Is it possible first to load few language with one call of GUI_LANG_LoadCSVEx()
    and then load additional languages with GUI_LANG_LoadTextEx()?

    The Segger tutorial LANG_UTF8_CSV_TXT.c does it so.
    But in contrast the emWin documentation says not to do so! ?(
    Under "32.2.6.2 CSV file functions" is said: "It is not possible to use a text file including one language and a CSV file including further languages. Either text files or CSV files should be used."

    Is the order the only crucial?
    Will 1. LoadCSV and then 2. LoadTexts work?

    Best regards
    Matz.
  • Hi Matz,

    You are absolutely right, it is possible to load from both resource file types in one application. The order is important. When loading a CSV file emWin sets the language beginning with index 0, no matter if a language is already set. When loading a Text file you have to set an index on your own, what also means you can use an index higher than the last index from used for the CSV file.

    If you look at the example (LANG_UTF8_CSV_TXT.c) we do it the same way, using the return value (in this case 2) of GUI_LANG_LoadCSVEx() as index for GUI_LANG_LoadTextEx():

    C Source Code

    1. NumLanguagesCSV = GUI_LANG_LoadCSVEx(_GetData, &_ResFileName[0]);
    2. GUI_LANG_LoadTextEx(_GetData, &_ResFileName[1], NumLanguagesCSV);


    In CSV files you can save more than one language in one file, so it is not necessary to set an index. With text files this is not possible.

    With the next release of emWin we will make this more clear in the manual.

    Regards,
    Sven
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.