New ML support - language.c - fixed return origial string for zero length translation
This commit is contained in:
parent
55157640c5
commit
def9ab56f6
1 changed files with 2 additions and 0 deletions
|
@ -39,6 +39,8 @@ const char* lang_get_translation(const char* s)
|
||||||
uint16_t ui = pgm_read_word(((uint16_t*)s)); //read string id
|
uint16_t ui = pgm_read_word(((uint16_t*)s)); //read string id
|
||||||
if (ui == 0xffff) return s + 2; //translation not found
|
if (ui == 0xffff) return s + 2; //translation not found
|
||||||
ui = pgm_read_word(((uint16_t*)(((char*)lang_table + 16 + ui*2)))); //read relative offset
|
ui = pgm_read_word(((uint16_t*)(((char*)lang_table + 16 + ui*2)))); //read relative offset
|
||||||
|
if (pgm_read_byte(((uint8_t*)((char*)lang_table + ui))) == 0)
|
||||||
|
return s + 2;//not translated string
|
||||||
return (const char*)((char*)lang_table + ui); //return calculated pointer
|
return (const char*)((char*)lang_table + ui); //return calculated pointer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue