This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/MSP430F5659: Multi language messages table

Part Number: MSP430F5659

Tool/software: Code Composer Studio

Good morning TI experts,

today I'm going to ask you a very important question about the design of my application.

I'm going to create a program which will have displayed a set of messages in 6 different languages (english, italian, french, spanish, german...)

This messages are going to be saved in ROM (Flash of my uP) and are going to be the same number for every language.

I also need to have a fast and smart way to address these messages. At the moment I'm thinking about something like a structure for each language where the messages strings are its element.

typedef struct {
  char mex_1[100];
  char mex_2[100];
  char mex_3[100];
  ...
  char mex_N[100]
} language;

language italiano={"Buongiorno", "Buonasera", "Buonanotte"};
language english={"Goodmorning", "Good evening", "Good night"};
language spanish={"Buenos dias", "Buenas tardes", "Buenas noche"}; 

Which is the best way to carry out this multi language project?

I think my idea isn't the smartest and easiest way to do what I need, so any advice and help would be really appreciated.

Best Regards,

Mery

  • Looks reasonable.  I think you should try it and see how well it works.

    Thanks and regards,

    -George

  • Maria Angela Cianci said:
    This messages are going to be saved in ROM (Flash of my uP) and are going to be the same number for every language.

    If the messages are not changed then:

    a. The variables should be const qualified so they get placed on flash, as otherwise they will take up space in flash and ram (where the run time library start-up code will initialise the variables in ram from initialisation tables in flash).

    b. In the structure use a character pointer rather than a fixed size array to reduce space.

    E.g. try:

    typedef struct {
      const char *mex_1;
      const char *mex_2;
      const char *mex_3;
      ...
      const char *mex_N;
    } language;
    
    const language italiano={"Buongiorno", "Buonasera", "Buonanotte"};
    const language english={"Goodmorning", "Good evening", "Good night"};
    const language spanish={"Buenos dias", "Buenas tardes", "Buenas noche"};