Skip to content

Using constants during MenuItem creation #2

@mrhydea4

Description

@mrhydea4

I'm writing an Arduino app and I want to be able to change the language of the menus. So I would have something like this:

EN.h
const char PROGMEM WELCOME[] = "Welcome"

DE.h
const char PROGMEM WELCOME[] = "Willkommen"

Main.ino
#include "./EN.h" // or #include "./DE.h"
MenuItem(miWelcome, WELCOME, Menu::NullItem, Menu::NullItem, Menu::NullItem, Menu::NullItem, ShowWelcome);

The problem is when I try to use the getLabel function, it just returns gibberish. I'm brand new to C++, so any help you could give would be appreciated.

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions