How to trigger the specific language from csv file in the sample code "WIDGET_MultiLanguageCSV" provided by emwin ???

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

    • How to trigger the specific language from csv file in the sample code "WIDGET_MultiLanguageCSV" provided by emwin ???

      Hi,

      I have recently started working with emwim and I am going through the same projects given.

      Recently I have gone through the "WIDGET_MultiLanguageCSV". I have understood the workflow and functions.
      [1]. I have given the binary format of the csv file and they are changing the languages as per the input. How can I get to know the format of actual csv file. They have used 3 languages English, German, Italian, how can I know how they have kept in the csv file.

      [2]. GUI_LANG_SetLang(LANG_ENGLISH);
      The above command is used to set the language. But what is "LANG_ENGLISH" here. Is that the library used for English language.

      [3]. what is the actual trigger point for getting the specific language. what are the actual libraries for the languages. How they are correctly triggered from the csv file??.

      Thanks in advance.

      Regards,
      Arjuman Banu.
    • Hi Arjuman,

      let me answer your questions. The format of the CSV is based on some rules that you can find in the manual under "32.2.4 Rules for CSV files". Let me show you an example CSV file:

      Source Code

      1. "Deutsch","English","Espanol"
      2. "Das","This","Eso"
      3. "ist","is","es"
      4. "ein","a","una"
      5. "Test","test","prueba"

      According to the rules, each line equals one record, meaning one set words. The quotes are not mandatory, although if used once, they have to be used for each field in the CSV file. The separator is crucial, by default it is a comma, but you can set it by using GUI_LANG_SetSep().
      Now, the file reader reads three words per line, so the program knows there are three columns. Each column is an own language and gets a zero-based index. This is what LANG_ENGLISH is for, it is an define resolving to 0, since English has the index 0 in this example.

      I hope I answered all your questions.

      Best regards,

      Florian
      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.
    • Hi,

      Instead of the binary format, we are trying to access the csv file directly.

      We are facing issue to read the csv file.
      NumLanguagesCSV = GUI_LANG_LoadCSVEx(_GetData, &_ResFileName[0]);
      GUI_LANG_LoadTextEx(_GetData, &_ResFileName[1], NumLanguagesCSV);
      But its not loading the respective file. Its jus giving some junk values.

      can anyone tell me how to load a csv and get the data from the file?

      Can you provide any example how to load and get data from local directory?



    • Hi Arjuman,

      the manual explains how to use GetData() functions and provides examples under "9.5 Getting data with the ...Ex() functions".

      Best regards,

      Florian
      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.