style
This commit is contained in:
1 parent
555fe1566f
commit
59bc927698
4 files changed
+40
-38
No files matched your search
+18
-16
@@ -106,22 +106,22 @@ static void showBanner_logo(LogoMode mode) {
|
||||
}
|
||||
|
||||
static uint8_t detect_current_lang(void) {
|
||||
#ifndef _WIN32
|
||||
const char* lang = setlocale(LC_ALL, "");
|
||||
if (lang == NULL) {
|
||||
return 1;
|
||||
}
|
||||
if (memcmp(lang, "fr", 2) == 0) {
|
||||
return 2;
|
||||
}
|
||||
if (memcmp(lang, "es", 2) == 0) {
|
||||
return 3;
|
||||
}
|
||||
#endif
|
||||
#ifndef _WIN32
|
||||
const char *lang = setlocale(LC_ALL, "");
|
||||
if (lang == NULL) {
|
||||
return 1;
|
||||
}
|
||||
if (memcmp(lang, "fr", 2) == 0) {
|
||||
return 2;
|
||||
}
|
||||
if (memcmp(lang, "es", 2) == 0) {
|
||||
return 3;
|
||||
}
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
static const char* get_quote(void) {
|
||||
static const char *get_quote(void) {
|
||||
|
||||
const char *quotes_en[] = {
|
||||
"Fund creativity, empower dreams",
|
||||
@@ -193,9 +193,11 @@ static const char* get_quote(void) {
|
||||
int r = rand() % ARRAYLEN(quotes_en);
|
||||
|
||||
uint8_t lang = detect_current_lang();
|
||||
switch(lang) {
|
||||
case 2: return quotes_fr[r];
|
||||
case 3: return quotes_es[r];
|
||||
switch (lang) {
|
||||
case 2:
|
||||
return quotes_fr[r];
|
||||
case 3:
|
||||
return quotes_es[r];
|
||||
case 1:
|
||||
default:
|
||||
return quotes_en[r];
|
||||
|
||||
Reference in new issue
Block a user