| 1 | #include "bapp_str_table.h" |
|---|
| 2 | #include "bapp_util.h" |
|---|
| 3 | BDBG_MODULE(bapp_str_table); /* Register software module with debug interface */ |
|---|
| 4 | |
|---|
| 5 | const char *s_str_table[eLANG_MAX][eTEXT_MAX] = |
|---|
| 6 | { |
|---|
| 7 | /* eLANG_ENGLISH */ |
|---|
| 8 | { |
|---|
| 9 | /*eTEXT_AUTO_POWER_POPUP_DESC, */"To conserve energy, your converter box will soon be shut off since %d hours have passed without any activity", |
|---|
| 10 | /*eTEXT_AUTO_POWER_RESTART_DESC, */"To conserve energy, your converter box is designed to automatically shut off after %d hours of no activity. To change this setting, press MENU on the remote control and then select Power Saver.", |
|---|
| 11 | /*eTEXT_NO_SIGNAL_DESC, */"Unable to tune to this channel. Please call 1.800.COMCAST.", |
|---|
| 12 | /*eTEXT_MUTE_TITLE, */"Mute", |
|---|
| 13 | /*eTEXT_AUTO_POWERED_OFF, */"System was automatically powered off. Do you want to disable automatic power saver?", |
|---|
| 14 | /*eTEXT_HUNTING, */"Device in Hunt Mode...", |
|---|
| 15 | /*eTEXT_PENDING_AUTH, */"Device in Pending Initialization Mode...", |
|---|
| 16 | /*eTEXT_DOWNLOADING, */"We are temporarily interrupting your serivce. We expect to return you to full service momentarily.", |
|---|
| 17 | /*eTEXT_SYS_INFO, */"Press INFO to exit Press CH- or CH+ to change page", |
|---|
| 18 | /*eTEXT_VENDOR, */"Broadcom", |
|---|
| 19 | /*eTEXT_MUTE, */"Mute", |
|---|
| 20 | /*eTEXT_VOLUME, */"Volume", |
|---|
| 21 | }, |
|---|
| 22 | /* eLANG_SPANISH */ |
|---|
| 23 | { |
|---|
| 24 | /*eTEXT_AUTO_POWER_POPUP_DESC, */"Para conservar energía, su convertidor se apagará pronto ya que han pasado %d horas sin actividad", |
|---|
| 25 | /*eTEXT_AUTO_POWER_RESTART_DESC, */"Para conservar energía, su convertidor está diseñado para apagarse automáticamente después de %d horas sin actividad. Para cambiar la selección, presione MENU en el control remoto y luego seleccione Ahorro de Energía.", |
|---|
| 26 | /*eTEXT_NO_SIGNAL_DESC, */"Incapaz de sintonizar este canal. Intente ajustar la antena para mejorar fuerza de la señal o para realizar una nueva exploración del canal.", |
|---|
| 27 | /*eTEXT_MUTE_TITLE, */"Mudo", |
|---|
| 28 | /*eTEXT_AUTO_POWERED_OFF, */"System was automatically powered off. Do you want to disable automatic power saver?", |
|---|
| 29 | /*eTEXT_HUNTING, */"Device in Hunt Mode...", |
|---|
| 30 | /*eTEXT_PENDING_AUTH, */"Device in Pending Initialization Mode...", |
|---|
| 31 | /*eTEXT_DOWNLOADING, */"We are temporarily interrupting your serivce. We expect to return you to full service momentarily.", |
|---|
| 32 | /*eTEXT_SYS_INFO, */"Press INFO to exit Press CH- or CH+ to change page", |
|---|
| 33 | /*eTEXT_VENDOR, */"Broadcom", |
|---|
| 34 | /*eTEXT_MUTE, */"Mute", |
|---|
| 35 | /*eTEXT_VOLUME, */"Volume", |
|---|
| 36 | }, |
|---|
| 37 | /*eLANG_FRENCH */ |
|---|
| 38 | { |
|---|
| 39 | /*eTEXT_AUTO_POWER_POPUP_DESC, */"Pour économiser l'énergie, votre boîtier décodeur s'éteindra bientôt, parce qu'il n'y a eu aucune activité pendant %d heures.", |
|---|
| 40 | /*eTEXT_AUTO_POWER_RESTART_DESC, */"Pour économiser l'énergie, votre boîtier décodeur est conçu pour s'éteindre après %d heures d'inactivité. Pour modifier ce réglage, appuyez sur la touche MENU de la télécommande puis sélectionnez Économiseur d'énergie.", |
|---|
| 41 | /*eTEXT_NO_SIGNAL_DESC, */"Impossible de se connecter à cette chaîne. Essayez d'ajuster l'antenne pour améliorer le signal ou effectuez une nouvelle recherche de chaînes.", |
|---|
| 42 | /*eTEXT_MUTE_TITLE, */"Silence", |
|---|
| 43 | /*eTEXT_AUTO_POWERED_OFF, */"System was automatically powered off. Do you want to disable automatic power saver?", |
|---|
| 44 | /*eTEXT_HUNTING, */"Device in Hunt Mode...", |
|---|
| 45 | /*eTEXT_PENDING_AUTH, */"Device in Pending Initialization Mode...", |
|---|
| 46 | /*eTEXT_DOWNLOADING, */"We are temporarily interrupting your serivce. We expect to return you to full service momentarily.", |
|---|
| 47 | /*eTEXT_SYS_INFO, */"Press INFO to exit Press CH- or CH+ to change page", |
|---|
| 48 | /*eTEXT_VENDOR, */"Broadcom", |
|---|
| 49 | /*eTEXT_MUTE, */"Mute", |
|---|
| 50 | /*eTEXT_VOLUME, */"Volume", |
|---|
| 51 | } |
|---|
| 52 | }; |
|---|
| 53 | |
|---|
| 54 | /** |
|---|
| 55 | Summary: |
|---|
| 56 | Construct a UNI string in the buffer provided from the cstring. |
|---|
| 57 | **/ |
|---|
| 58 | unsigned int c_to_uni_str( |
|---|
| 59 | unsigned char *str_p, /* Null terminated c-string */ |
|---|
| 60 | unsigned int *p_uni_str, /* buffer to use for contructing UNI string */ |
|---|
| 61 | unsigned int max_size) /* maximum buffer size in words */ |
|---|
| 62 | { |
|---|
| 63 | unsigned int i,num_chars; |
|---|
| 64 | unsigned char *p; |
|---|
| 65 | |
|---|
| 66 | num_chars = bapp_util_strlen(str_p); |
|---|
| 67 | if (num_chars > max_size) |
|---|
| 68 | num_chars = max_size; |
|---|
| 69 | |
|---|
| 70 | /* test last 4 bytes to see if it is unicode? */ |
|---|
| 71 | |
|---|
| 72 | if ((num_chars > 3) && (0 == (num_chars % 4)) && |
|---|
| 73 | (str_p[num_chars - 4] == '0') && (str_p[num_chars - 3] == '0') && |
|---|
| 74 | (str_p[num_chars - 2] == '0') && (str_p[num_chars - 1] == '0')) |
|---|
| 75 | { |
|---|
| 76 | num_chars = bapp_util_strlen(str_p) >> 2; /* four bytes each */ |
|---|
| 77 | p = str_p; |
|---|
| 78 | for (i = 0; i < num_chars; ++i, p += 4) |
|---|
| 79 | { |
|---|
| 80 | p_uni_str[i] = bapp_util_atoi(p, 4); |
|---|
| 81 | } |
|---|
| 82 | } |
|---|
| 83 | else |
|---|
| 84 | { |
|---|
| 85 | for (i = 0; i < bapp_util_strlen(str_p); ++i) |
|---|
| 86 | { |
|---|
| 87 | p_uni_str[i] = (unsigned int)(str_p[i]); |
|---|
| 88 | } |
|---|
| 89 | } |
|---|
| 90 | |
|---|
| 91 | return num_chars; |
|---|
| 92 | } |
|---|
| 93 | |
|---|
| 94 | /** |
|---|
| 95 | Summary: |
|---|
| 96 | Construct a UNI string in the buffer provided from the null terminated UTF-16 string. |
|---|
| 97 | **/ |
|---|
| 98 | unsigned int utf16_to_uni_str( |
|---|
| 99 | unsigned short *str_p, /* NULL terminated (0x0000) UTF - 16 string */ |
|---|
| 100 | unsigned int *p_uni_str, /* buffer to use for contructing UNI string */ |
|---|
| 101 | unsigned int max_size) /* maximum buffer size in words */ |
|---|
| 102 | { |
|---|
| 103 | unsigned int i = 0; |
|---|
| 104 | |
|---|
| 105 | while ((str_p[i] != 0x0000) && (i < max_size)) |
|---|
| 106 | { |
|---|
| 107 | p_uni_str[i] = (unsigned int)(str_p[i]); |
|---|
| 108 | |
|---|
| 109 | i++; |
|---|
| 110 | } |
|---|
| 111 | return i; |
|---|
| 112 | } |
|---|
| 113 | |
|---|
| 114 | /** |
|---|
| 115 | Summary: |
|---|
| 116 | Use the this function to retrieve a string from the string table. |
|---|
| 117 | **/ |
|---|
| 118 | |
|---|
| 119 | void bapp_str_get( |
|---|
| 120 | bapp_lang_t e_lang, /* Language enum */ |
|---|
| 121 | btext_id_t e_text_id, /* Text enum */ |
|---|
| 122 | unsigned int *p_uni_str, /* Buffer to put UNI string into */ |
|---|
| 123 | unsigned int *str_len /* On input the max length in words on output the actual size in characters. */ |
|---|
| 124 | ) |
|---|
| 125 | { |
|---|
| 126 | char *p_str; |
|---|
| 127 | |
|---|
| 128 | BDBG_MSG(("bscreen_get_string(%d,%d)\n", e_lang, e_text_id)); |
|---|
| 129 | if ((e_text_id >= eTEXT_MAX) || (e_lang >= eLANG_MAX)) |
|---|
| 130 | { |
|---|
| 131 | /* |
|---|
| 132 | BAPP_MSG(("bscreen_get_string(%d,%d)(%d,%d) failed\n", e_lang, e_text_id,eLANG_MAX,eTEXT_MAX)); |
|---|
| 133 | */ |
|---|
| 134 | *str_len = 0; |
|---|
| 135 | return; |
|---|
| 136 | } |
|---|
| 137 | |
|---|
| 138 | p_str = (char*)s_str_table[e_lang][e_text_id]; |
|---|
| 139 | BDBG_MSG(("bscreen_get_string(%s)\n", p_str)); |
|---|
| 140 | *str_len = c_to_uni_str((unsigned char*)p_str,p_uni_str,*str_len); |
|---|
| 141 | } |
|---|
| 142 | |
|---|