diff --git a/apps/lang/english.lang b/apps/lang/english.lang index a706003e3d..125bb42f3c 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang @@ -6957,7 +6957,7 @@ *: none - e200,c200: "mSD:" + e200,c200: "MSD:" ondio*: "MMC:" @@ -11431,3 +11431,20 @@ *: "Empty list" + + id: LANG_NOT_PRESENT + desc: when external memory is not present + user: + + *: none + multivolume: "Not present" + + + *: none + multivolume: "Not present" + + + *: none + multivolume: "Not present" + + diff --git a/apps/lang/italiano.lang b/apps/lang/italiano.lang index 99f882f2e3..835b223ed5 100644 --- a/apps/lang/italiano.lang +++ b/apps/lang/italiano.lang @@ -4043,8 +4043,8 @@ *: none - e200,c200: "mSD" - ondio*: "MMC" + e200,c200: "MSD:" + ondio*: "MMC:" *: none @@ -11386,3 +11386,20 @@ *: "Lista vuota" + + id: LANG_NOT_PRESENT + desc: when external memory is not present + user: + + *: none + multivolume: "Not present" + + + *: none + multivolume: "Non presente" + + + *: none + multivolume: "Non presente" + + diff --git a/apps/menus/main_menu.c b/apps/menus/main_menu.c index 5231181296..e7c6d6c81a 100644 --- a/apps/menus/main_menu.c +++ b/apps/menus/main_menu.c @@ -118,7 +118,8 @@ static bool show_credits(void) #else #define SIZE_FMT "%s %s" #endif -struct info_data +struct info_data + { bool new_data; unsigned long size; @@ -128,27 +129,32 @@ struct info_data unsigned long free2; #endif }; -enum infoscreenorder +enum infoscreenorder + { - INFO_VERSION = 0, -#if CONFIG_RTC - INFO_TIME, - INFO_DATE, -#endif - INFO_BUFFER, - INFO_BATTERY, + INFO_BATTERY = 0, INFO_DISK1, /* capacity or internal capacity/free on hotswap */ INFO_DISK2, /* free space or external capacity/free on hotswap */ + INFO_BUFFER, + INFO_VERSION, +#if CONFIG_RTC + INFO_DATE, + INFO_TIME, +#endif INFO_COUNT -}; +}; + static char* info_getname(int selected_item, void *data, char *buffer) { - struct info_data *info = (struct info_data*)data; + struct info_data *info = (struct info_data*)data; + #if CONFIG_RTC - struct tm *tm; + struct tm *tm; + #endif - const unsigned char *kbyte_units[] = + const unsigned char *kbyte_units[] = + { ID2P(LANG_KILOBYTE), ID2P(LANG_MEGABYTE), @@ -180,14 +186,17 @@ static char* info_getname(int selected_item, void *data, char *buffer) tm = get_time(); snprintf(buffer, MAX_PATH, "%02d:%02d:%02d %s", global_settings.timeformat == 0 ? tm->tm_hour : tm->tm_hour-12, - tm->tm_min, + tm->tm_min, + tm->tm_sec, global_settings.timeformat == 0 ? "" : tm->tm_hour>11 ? "P" : "A"); break; case INFO_DATE: tm = get_time(); - snprintf(buffer, MAX_PATH, "%s %d %d", - str(LANG_MONTH_JANUARY + tm->tm_mon), + snprintf(buffer, MAX_PATH, "%s %d %d", + + str(LANG_MONTH_JANUARY + tm->tm_mon), + tm->tm_mday, tm->tm_year+1900); break; @@ -224,8 +233,8 @@ static char* info_getname(int selected_item, void *data, char *buffer) snprintf(buffer, MAX_PATH, "%s %s/%s", str(LANG_DISK_NAME_INTERNAL), s1, s2); #else - output_dyn_value(s1, sizeof s1, info->size, kbyte_units, true); - snprintf(buffer, MAX_PATH, SIZE_FMT, str(LANG_DISK_SIZE_INFO), s1); + output_dyn_value(s1, sizeof s1, info->free, kbyte_units, true); + snprintf(buffer, MAX_PATH, SIZE_FMT, str(LANG_DISK_FREE_INFO), s1); #endif break; case INFO_DISK2: /* disk usage 2 */ @@ -238,10 +247,13 @@ static char* info_getname(int selected_item, void *data, char *buffer) s1, s2); } else - return ""; + { + snprintf(buffer, MAX_PATH, "%s %s %s", str(LANG_DISK_NAME_MMC), + s1, str(LANG_NOT_PRESENT), s2); + } #else - output_dyn_value(s1, sizeof s1, info->free, kbyte_units, true); - snprintf(buffer, MAX_PATH, SIZE_FMT, str(LANG_DISK_FREE_INFO), s1); + output_dyn_value(s1, sizeof s1, info->size, kbyte_units, true); + snprintf(buffer, MAX_PATH, SIZE_FMT, str(LANG_DISK_SIZE_INFO), s1); #endif break; } @@ -254,7 +266,8 @@ static int info_speak_item(int selected_item, void * data) ID2P(LANG_KILOBYTE), ID2P(LANG_MEGABYTE), ID2P(LANG_GIGABYTE) - }; + }; + switch (selected_item) { case INFO_VERSION: /* version */ @@ -262,20 +275,27 @@ static int info_speak_item(int selected_item, void * data) talk_spell(appsversion, true); break; #if CONFIG_RTC - case INFO_TIME: - talk_id(LANG_CURRENT_TIME, false); + case INFO_TIME: + + talk_id(VOICE_CURRENT_TIME, false); talk_time(get_time(), true); break; case INFO_DATE: - talk_date(get_time(), true); + talk_date(get_time(), true); + break; #endif - case INFO_BUFFER: /* buffer */ + case INFO_BUFFER: /* buffer */ + { - talk_id(LANG_BUFFER_STAT, false); - long buflen = ((audiobufend - audiobuf) * 2) / 2097; /* avoid overflow */ - output_dyn_value(NULL, 0, buflen, kbyte_units, true); - break; + talk_id(LANG_BUFFER_STAT, false); + + long buflen = ((audiobufend - audiobuf) * 2) / 2097; /* avoid overflow */ + + output_dyn_value(NULL, 0, buflen, kbyte_units, true); + + break; + } case INFO_BATTERY: /* battery */ if (battery_level() >= 0) @@ -299,26 +319,28 @@ static int info_speak_item(int selected_item, void * data) } break; case INFO_DISK1: /* disk 1 */ -#ifdef HAVE_MULTIVOLUME talk_id(LANG_DISK_FREE_INFO, false); +#ifdef HAVE_MULTIVOLUME talk_id(LANG_DISK_NAME_INTERNAL, true); - output_dyn_value(NULL, 0, info->free, kbyte_units, true); -#else - talk_id(LANG_DISK_SIZE_INFO, false); - output_dyn_value(NULL, 0, info->size, kbyte_units, true); #endif + output_dyn_value(NULL, 0, info->free, kbyte_units, true); break; case INFO_DISK2: /* disk 2 */ #ifdef HAVE_MULTIVOLUME if (info->size2) { talk_id(LANG_DISK_FREE_INFO, false); - talk_id(LANG_DISK_NAME_MMC, false); + talk_id(LANG_DISK_NAME_MMC, true); output_dyn_value(NULL, 0, info->free2, kbyte_units, true); } + else + { + talk_id(LANG_DISK_NAME_MMC, false); + talk_id(LANG_NOT_PRESENT, true); + } #else - talk_id(LANG_DISK_FREE_INFO, false); - output_dyn_value(NULL, 0, info->free, kbyte_units, true); + talk_id(LANG_DISK_SIZE_INFO, false); + output_dyn_value(NULL, 0, info->size, kbyte_units, true); #endif break; } @@ -344,8 +366,10 @@ static int info_action_callback(int action, struct gui_synclist *lists) #ifdef HAVE_MULTIVOLUME if (fat_ismounted(1)) fat_recalc_free(1); -#endif -#else +#endif + +#else + (void) lists; #endif return ACTION_REDRAW;