forked from hd-zero/hdzero-goggle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
109 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
#include "english.h" | ||
|
||
translate_t translate_english[TRANSLATE_STRING_NUM] = { | ||
{"Scan Now", "Scan Now"}, | ||
{"Source", "Source"}, | ||
{"Image Setting", "Image Setting"}, | ||
{"OSD", "OSD"}, | ||
{"Power", "Power"}, | ||
{"Fans", "Fans"}, | ||
{"Record Option", "Record Option"}, | ||
{"Auto Scan", "Auto Scan"}, | ||
{"ELRS", "ELRS"}, | ||
{"WiFi Module", "WiFi Module"}, | ||
{"Head Tracker", "Head Tracker"}, | ||
{"Playback", "Playback"}, | ||
{"Storage", "Storage"}, | ||
{"Firmware ", "Firmware "}, | ||
{"Focus Chart", "Focus Chart"}, | ||
{"Clock", "Clock"}, | ||
{"Input", "Input"}, | ||
{"Go Sleep!", "Go Sleep!"}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
#ifndef _ENGLISH_H_ | ||
#define _ENGLISH_H_ | ||
|
||
#include "language.h" | ||
|
||
extern translate_t translate_english[TRANSLATE_STRING_NUM]; | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#include "language.h" | ||
#include "english.h" | ||
#include "simplified_chinese.h" | ||
#include <log/log.h> | ||
|
||
lang_e LANGUAGE = lang_simplified_chinese; | ||
|
||
translate_t *translate_list[] = { | ||
translate_english, | ||
translate_simplified_chinese, | ||
}; | ||
|
||
char *translate_string(const char *str, lang_e lang) { | ||
int i, j; | ||
|
||
// search language | ||
i = 0; | ||
while (i != LANGUAGE) { | ||
if (i < lang_end) | ||
i++; | ||
} | ||
|
||
// if language is undefined | ||
if (i != LANGUAGE) | ||
return (char *)str; | ||
|
||
// search str translate | ||
for (j = 0; j < TRANSLATE_STRING_NUM; j++) { | ||
if (strcmp(str, translate_list[i][j].in_english) == 0) | ||
return translate_list[i][j].translate; | ||
} | ||
|
||
// if str is undefined | ||
return (char *)str; | ||
} | ||
|
||
void lv_label_set_text_lang(lv_obj_t *obj, const char *text, lang_e lang) { | ||
char *text_lang = _str(text, lang); | ||
lv_label_set_text(obj, text_lang); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
#include "simplified_chinese.h" | ||
|
||
translate_t translate_simplified_chinese[TRANSLATE_STRING_NUM] = { | ||
{"Scan Now", "扫频"}, | ||
{"Source", "信号源"}, | ||
{"Image Setting", "图像设置"}, | ||
{"OSD", "OSD"}, | ||
{"Power", "电源"}, | ||
{"Fans", "风扇"}, | ||
{"Record Option", "录像设置"}, | ||
{"Auto Scan", "自动扫频"}, | ||
{"ELRS", "ELRS"}, | ||
{"WiFi Module", "WiFi模块"}, | ||
{"Head Tracker", "头部追踪"}, | ||
{"Playback", "录像回放"}, | ||
{"Storage", "存储"}, | ||
{"Firmware ", "固件"}, | ||
{"Focus Chart", "焦点图"}, | ||
{"Clock", "时间"}, | ||
{"Input", "按键"}, | ||
{"Go Sleep!", "睡眠"}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
#ifndef _SIMPLIFIED_CHINESE_H_ | ||
#define _SIMPLIFIED_CHINESE_H_ | ||
|
||
#include "language.h" | ||
|
||
extern translate_t translate_simplified_chinese[TRANSLATE_STRING_NUM]; | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters