00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #include "gLanguageMenu.h"
00029 #include "uMenu.h"
00030 #include "tLocale.h"
00031 #include "tConfiguration.h"
00032
00033 static tString sg_FirstLanguage("American English"), sg_SecondLanguage("American English");
00034
00035 static tConfItemLine sg_fl("LANGUAGE_FIRST",sg_FirstLanguage);
00036 static tConfItemLine sg_sl("LANGUAGE_SECOND",sg_SecondLanguage);
00037
00038 static void sg_UpdateLanguage( tString & language )
00039 {
00040
00041 if ( language == "English" )
00042 language = "British English";
00043
00044 if ( language == "American" )
00045 language = "American English";
00046 }
00047
00048 void sg_LanguageInit()
00049 {
00050 sg_UpdateLanguage( sg_FirstLanguage );
00051 sg_UpdateLanguage( sg_SecondLanguage );
00052 tLanguage::Find(sg_FirstLanguage )->SetFirstLanguage();
00053 tLanguage::Find(sg_SecondLanguage)->SetSecondLanguage();
00054 }
00055
00056
00057 void sg_LanguageMenu()
00058 {
00059 if (!tLanguage::FirstLanguage())
00060 return;
00061
00062 uMenu menu("$language_menu_title", false);
00063
00064
00065 uMenuItemExit exit(&menu, "$menuitem_accept", "$menuitem_accept_help");
00066
00067 uMenuItemSelection<tString> second(&menu,
00068 "$language_menu_item_second",
00069 "$language_menu_item_second_help",
00070 sg_SecondLanguage);
00071
00072 uMenuItemSelection<tString> first(&menu,
00073 "$language_menu_item_fist",
00074 "$language_menu_item_first_help",
00075 sg_FirstLanguage);
00076
00077 tLanguage* run = tLanguage::FirstLanguage();
00078
00079
00080 while (run)
00081 {
00082 first.NewChoice(run->Name(),"", run->Name());
00083 second.NewChoice(run->Name(),"", run->Name());
00084 run = run->Next();
00085 }
00086
00087 menu.Enter();
00088
00089 sg_LanguageInit();
00090 }
00091
00092
00093