#include "bapp_str_table.h" #include "bapp_util.h" BDBG_MODULE(bapp_str_table); /* Register software module with debug interface */ const char *s_str_table[eLANG_MAX][eTEXT_MAX] = { /* eLANG_ENGLISH */ { /*eTEXT_AUTO_POWER_POPUP_DESC, */"To conserve energy, your converter box will soon be shut off since %d hours have passed without any activity", /*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.", /*eTEXT_NO_SIGNAL_DESC, */"Unable to tune to this channel. Please call 1.800.COMCAST.", /*eTEXT_MUTE_TITLE, */"Mute", /*eTEXT_AUTO_POWERED_OFF, */"System was automatically powered off. Do you want to disable automatic power saver?", /*eTEXT_HUNTING, */"Device in Hunt Mode...", /*eTEXT_PENDING_AUTH, */"Device in Pending Initialization Mode...", /*eTEXT_DOWNLOADING, */"We are temporarily interrupting your serivce. We expect to return you to full service momentarily.", /*eTEXT_SYS_INFO, */"Press INFO to exit Press CH- or CH+ to change page", /*eTEXT_VENDOR, */"Broadcom", /*eTEXT_MUTE, */"Mute", /*eTEXT_VOLUME, */"Volume", }, /* eLANG_SPANISH */ { /*eTEXT_AUTO_POWER_POPUP_DESC, */"Para conservar energía, su convertidor se apagará pronto ya que han pasado %d horas sin actividad", /*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.", /*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.", /*eTEXT_MUTE_TITLE, */"Mudo", /*eTEXT_AUTO_POWERED_OFF, */"System was automatically powered off. Do you want to disable automatic power saver?", /*eTEXT_HUNTING, */"Device in Hunt Mode...", /*eTEXT_PENDING_AUTH, */"Device in Pending Initialization Mode...", /*eTEXT_DOWNLOADING, */"We are temporarily interrupting your serivce. We expect to return you to full service momentarily.", /*eTEXT_SYS_INFO, */"Press INFO to exit Press CH- or CH+ to change page", /*eTEXT_VENDOR, */"Broadcom", /*eTEXT_MUTE, */"Mute", /*eTEXT_VOLUME, */"Volume", }, /*eLANG_FRENCH */ { /*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.", /*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.", /*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.", /*eTEXT_MUTE_TITLE, */"Silence", /*eTEXT_AUTO_POWERED_OFF, */"System was automatically powered off. Do you want to disable automatic power saver?", /*eTEXT_HUNTING, */"Device in Hunt Mode...", /*eTEXT_PENDING_AUTH, */"Device in Pending Initialization Mode...", /*eTEXT_DOWNLOADING, */"We are temporarily interrupting your serivce. We expect to return you to full service momentarily.", /*eTEXT_SYS_INFO, */"Press INFO to exit Press CH- or CH+ to change page", /*eTEXT_VENDOR, */"Broadcom", /*eTEXT_MUTE, */"Mute", /*eTEXT_VOLUME, */"Volume", } }; /** Summary: Construct a UNI string in the buffer provided from the cstring. **/ unsigned int c_to_uni_str( unsigned char *str_p, /* Null terminated c-string */ unsigned int *p_uni_str, /* buffer to use for contructing UNI string */ unsigned int max_size) /* maximum buffer size in words */ { unsigned int i,num_chars; unsigned char *p; num_chars = bapp_util_strlen(str_p); if (num_chars > max_size) num_chars = max_size; /* test last 4 bytes to see if it is unicode? */ if ((num_chars > 3) && (0 == (num_chars % 4)) && (str_p[num_chars - 4] == '0') && (str_p[num_chars - 3] == '0') && (str_p[num_chars - 2] == '0') && (str_p[num_chars - 1] == '0')) { num_chars = bapp_util_strlen(str_p) >> 2; /* four bytes each */ p = str_p; for (i = 0; i < num_chars; ++i, p += 4) { p_uni_str[i] = bapp_util_atoi(p, 4); } } else { for (i = 0; i < bapp_util_strlen(str_p); ++i) { p_uni_str[i] = (unsigned int)(str_p[i]); } } return num_chars; } /** Summary: Construct a UNI string in the buffer provided from the null terminated UTF-16 string. **/ unsigned int utf16_to_uni_str( unsigned short *str_p, /* NULL terminated (0x0000) UTF - 16 string */ unsigned int *p_uni_str, /* buffer to use for contructing UNI string */ unsigned int max_size) /* maximum buffer size in words */ { unsigned int i = 0; while ((str_p[i] != 0x0000) && (i < max_size)) { p_uni_str[i] = (unsigned int)(str_p[i]); i++; } return i; } /** Summary: Use the this function to retrieve a string from the string table. **/ void bapp_str_get( bapp_lang_t e_lang, /* Language enum */ btext_id_t e_text_id, /* Text enum */ unsigned int *p_uni_str, /* Buffer to put UNI string into */ unsigned int *str_len /* On input the max length in words on output the actual size in characters. */ ) { char *p_str; BDBG_MSG(("bscreen_get_string(%d,%d)\n", e_lang, e_text_id)); if ((e_text_id >= eTEXT_MAX) || (e_lang >= eLANG_MAX)) { /* BAPP_MSG(("bscreen_get_string(%d,%d)(%d,%d) failed\n", e_lang, e_text_id,eLANG_MAX,eTEXT_MAX)); */ *str_len = 0; return; } p_str = (char*)s_str_table[e_lang][e_text_id]; BDBG_MSG(("bscreen_get_string(%s)\n", p_str)); *str_len = c_to_uni_str((unsigned char*)p_str,p_uni_str,*str_len); }