All pastes #651988 Raw Edit

Tidied up identation

public text v1 · immutable
#651988 ·published 2007-08-10 06:38 UTC
rendered paste body
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index 4fd4ecf..e778dc9 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -11018,3 +11018,54 @@
     *: ""
   </voice>
 </phrase>
+ <phrase>
+   id: VOICE_OCLOCK
+   desc: spoken only, for wall clock announce
+   user:
+   <source>
+     *: none
+     rtc: ""
+   </source>
+   <dest>
+     *: none
+     rtc: ""
+   </dest>
+   <voice>
+     *: none
+     rtc: "o'clock"
+   </voice>
+ </phrase>
+ <phrase>
+   id: VOICE_PM
+   desc: spoken only, for wall clock announce
+   user:
+   <source>
+     *: none
+     rtc: ""
+   </source>
+   <dest>
+     *: none
+     rtc: ""
+   </dest>
+   <voice>
+     *: none
+     rtc: "Pm"
+   </voice>
+ </phrase>
+ <phrase>
+   id: VOICE_AM
+   desc: spoken only, for wall clock announce
+   user:
+   <source>
+     *: none
+     rtc: ""
+   </source>
+   <dest>
+     *: none
+     rtc: ""
+   </dest>
+   <voice>
+     *: none
+     rtc: "A M"
+   </voice>
+ </phrase>
\ No newline at end of file
diff --git a/apps/menus/main_menu.c b/apps/menus/main_menu.c
index 9f6d9a5..1dcc1f2 100644
--- a/apps/menus/main_menu.c
+++ b/apps/menus/main_menu.c
@@ -213,9 +213,78 @@ static bool show_info(void)
                 {
                     struct tm* tm = get_time();
                     talk_id(VOICE_CURRENT_TIME, true);
+                    if ( global_settings.timeformat ==1)
+                    {
+                        if (tm->tm_hour == 12)
+                        {
+                            talk_value(tm->tm_hour, UNIT_INT, true); 
+                            if (tm->tm_min ==0)
+                            {
+                                talk_id(VOICE_OCLOCK, true);
+                            }
+                            else
+                            {                    
+                                talk_value(tm->tm_min, UNIT_INT, true);
+                            }
+                        }
+                        else if (tm->tm_hour > 12)
+                        {
+                            talk_value(tm->tm_hour-12, UNIT_INT, true); 
+                            if (tm->tm_min ==0)
+                            {
+                                talk_id(VOICE_OCLOCK, true);
+                            }
+                            else
+                            {
+                                talk_value(tm->tm_min, UNIT_INT, true);
+                            }
+                        }
+                        else if (tm->tm_hour ==0)
+                        {
+                            talk_value(tm->tm_hour+12, UNIT_INT, true);
+                            if (tm->tm_min ==0)
+                            {
+                                talk_id(VOICE_OCLOCK, true);
+                            }
+                            else
+                            {
+                                talk_value(tm->tm_min, UNIT_INT, true);
+                            }
+                        }
+                        else
+                        {
+                            talk_value(tm->tm_hour, UNIT_INT, true);
+                            if (tm->tm_min ==0)
+                            {
+                                talk_id(VOICE_OCLOCK, true);
+                            }
+                            else
+                            {
+                                talk_value(tm->tm_min, UNIT_INT, true);
+                            }
+                        }
+                        if (tm->tm_hour >12)
+                        {
+                            talk_id(VOICE_PM, true);
+                        }
+                        else if(tm->tm_hour ==0)
+                        {
+                            talk_id(VOICE_AM, true);
+                        }
+                        else if(tm->tm_hour ==12)
+                        {
+                            talk_id(VOICE_PM, true);
+                        }
+                        else
+                        {
+                            talk_id(VOICE_AM, true);
+                        }
+                    }
+                    if ( global_settings.timeformat ==0)
+                    {
                     talk_value(tm->tm_hour, UNIT_HOUR, true);
                     talk_value(tm->tm_min, UNIT_MIN, true);
-                    talk_value(tm->tm_sec, UNIT_SEC, true);
+                    }
                     talk_id(LANG_MONTH_JANUARY + tm->tm_mon, true);
                     talk_number(tm->tm_mday, true);
                     talk_number(1900 + tm->tm_year, true);