Esempio n. 1
0
File: ui.c Progetto: draziw-/uTox
STRING* maybe_i18nal_string_get(MAYBE_I18NAL_STRING *mis) {
    if(mis->plain.str) {
        return &mis->plain;
    } else {
        return SPTRFORLANG(LANG, mis->i18nal);
    }
}
Esempio n. 2
0
File: ui.c Progetto: Matsu616/uTox
STRING *maybe_i18nal_string_get(MAYBE_I18NAL_STRING *mis) {
    if (mis->plain.str) {
        return &mis->plain;
    }

    return SPTRFORLANG(settings.language, mis->i18nal);
}
Esempio n. 3
0
// Generic display function for list-based dropdowns,
// userdata of which is an array of DROP_ELEMENTs.
STRING* list_dropdown_ondisplay(uint16_t i, const DROPDOWN* dm)
{
    DROP_ELEMENT *e = &((DROP_ELEMENT*) dm->userdata)[i];
    if(e->name.str) {
        return &e->name;
    } else {
        return SPTRFORLANG(LANG, e->string_id);
    }
}
Esempio n. 4
0
// Generic display function for simple dropdowns,
// userdata of which is a simple array of UI_STRING_IDs.
STRING* simple_dropdown_ondisplay(uint16_t i, const DROPDOWN* dm)
{
    return SPTRFORLANG(LANG, ((UI_STRING_ID*) dm->userdata)[i]);
}
Esempio n. 5
0
static STRING* dropdown_language_ondisplay(uint16_t i, const DROPDOWN* UNUSED(dm))
{
    UI_LANG_ID l = (UI_LANG_ID)i;
    return SPTRFORLANG(l, STR_LANG_NATIVE_NAME);
}
Esempio n. 6
0
static STRING* contextmenu_localized_ondisplay(uint8_t i, const CONTEXTMENU* cm)
{
    return SPTRFORLANG(LANG, ((UI_STRING_ID*) cm->userdata)[i]);
}