From ec87cd80546258c61a6fb21d58ef1189f64c8e4e Mon Sep 17 00:00:00 2001 From: Tomasz Sowa Date: Thu, 1 May 2008 12:29:44 +0000 Subject: [PATCH] added: new language: spanish translation made by Alejandro S. Valdezate alesanval at gmail dot com git-svn-id: svn://ttmath.org/publicrep/ttcalc/trunk@65 e52654a7-88a9-db11-a3e9-0013d4bc506e --- src/languages.cpp | 160 ++++++++++++++++++++++++++++++++++++++- src/languages.h | 3 +- src/mainwindow.cpp | 37 +++++++-- src/programresources.cpp | 3 + src/resource.h | 1 + src/resource.rc | 53 ++++++------- src/winmain.cpp | 1 + 7 files changed, 222 insertions(+), 36 deletions(-) diff --git a/src/languages.cpp b/src/languages.cpp index eee721c..75534ac 100644 --- a/src/languages.cpp +++ b/src/languages.cpp @@ -142,8 +142,35 @@ void Languages::InitErrorMessagesTab() InsertErrorPair(ttmath::err_too_big_factorial,"Zbyt duży argument dla funkcji factorial()"); +// sp + error_messages_tab.push_back( std::map() ); + InsertErrorPair(ttmath::err_ok,"ok"); + InsertErrorPair(ttmath::err_nothing_has_read,""); + InsertErrorPair(ttmath::err_unknown_character,"Un caracter desconocido"); + InsertErrorPair(ttmath::err_unexpected_final_bracket,"corchete final inesperado"); + InsertErrorPair(ttmath::err_stack_not_clear,"caracter desconocido a la izquierda"); + InsertErrorPair(ttmath::err_unknown_variable,"Variable desconocida"); + InsertErrorPair(ttmath::err_division_by_zero,"Division por cero"); + InsertErrorPair(ttmath::err_interrupt,"El calculo se ha colapsado"); + InsertErrorPair(ttmath::err_overflow,"Overflow"); + InsertErrorPair(ttmath::err_unknown_function,"Funcion desconocida"); + InsertErrorPair(ttmath::err_unknown_operator,"Operador desconocida"); + InsertErrorPair(ttmath::err_unexpected_semicolon_operator,"punto y coma inesperado"); + InsertErrorPair(ttmath::err_improper_amount_of_arguments,"numero de argumentos incorrecto"); + InsertErrorPair(ttmath::err_improper_argument,"argumento incorrecto"); + InsertErrorPair(ttmath::err_unexpected_end,"Fin inexperado"); + InsertErrorPair(ttmath::err_internal_error,"Error interno"); + + InsertErrorPair(ttmath::err_incorrect_name,"nombre incorrecto de variable o funcion"); + InsertErrorPair(ttmath::err_incorrect_value,"valor incorrecto de variable o funcion"); + InsertErrorPair(ttmath::err_variable_exists,"Variable ya existe"); + InsertErrorPair(ttmath::err_variable_loop,"Recurrencia entre variables"); + InsertErrorPair(ttmath::err_functions_loop,"Recurrencia entre funciones"); + InsertErrorPair(ttmath::err_must_be_only_one_value,"Variables o funciones solo pueden retornar un valor"); + InsertErrorPair(ttmath::err_still_calculating,"Calculando ..."); + InsertErrorPair(ttmath::err_too_big_factorial,"Argumento muy grande para la funcion factorial()"); } @@ -268,6 +295,7 @@ void Languages::InitGuiMessagesTab() InsertGuiPair(menu_view_always_on_top, "&Always on top"); InsertGuiPair(menu_view_lang_english, "&English"); InsertGuiPair(menu_view_lang_polish, "&Polish"); + InsertGuiPair(menu_view_lang_spanish, "&Spanish"); InsertGuiPair(menu_view_close_program, "&Close"); InsertGuiPair(menu_edit_undo, "&Undo"); InsertGuiPair(menu_edit_paste, "&Paste"); @@ -389,8 +417,9 @@ void Languages::InitGuiMessagesTab() InsertGuiPair(menu_view_normal_view, "Widok no&rmalny"); InsertGuiPair(menu_view_compact_view, "Widok &kompaktowy"); InsertGuiPair(menu_view_always_on_top, "Zawsze na &wierzchu"); - InsertGuiPair(menu_view_lang_english, "Język &angielski"); - InsertGuiPair(menu_view_lang_polish, "Język &polski"); + InsertGuiPair(menu_view_lang_english, "&Angielski"); + InsertGuiPair(menu_view_lang_polish, "&Polski"); + InsertGuiPair(menu_view_lang_spanish, "&Hiszpański"); InsertGuiPair(menu_view_close_program, "&Zamknij"); InsertGuiPair(menu_edit_undo, "&Cofnij"); InsertGuiPair(menu_edit_paste, "&Wklej"); @@ -434,6 +463,133 @@ void Languages::InitGuiMessagesTab() InsertGuiPair(unknown_error, "Nieznany kod błędu"); InsertGuiPair(cant_find_help, "Nie mogę znależć żadnych plików pomocy"); InsertGuiPair(cant_open_project_page, "Nie mogę otworzyć strony projektu"); + + +// sp + + gui_messages_tab.push_back( std::map() ); + + InsertGuiPair(button_ok,"Ok"); + InsertGuiPair(button_cancel,"Cancelar"); + InsertGuiPair(message_box_caption,"TTCalc"); + + InsertGuiPair(dialog_box_add_variable_caption,"Ańadir nueva variable"); + InsertGuiPair(dialog_box_edit_variable_caption,"Editar variable"); + InsertGuiPair(dialog_box_add_variable_incorrect_name,"Nombre incorrecto de variable"); + InsertGuiPair(dialog_box_add_variable_incorrect_value,"Valor incorrecto de variable"); + InsertGuiPair(dialog_box_add_variable_variable_exists,"Esta variable ya existe"); + InsertGuiPair(dialog_box_edit_variable_unknown_variable,"No hay variable en mi tabla!. Seguramente haya un error interno!"); + InsertGuiPair(dialog_box_delete_variable_confirm,"Quiere borrar las variables internas?"); + InsertGuiPair(dialog_box_variable_not_all_deleted,"Hay algunas variables que no se pueden borrar. Probablemente hay un error interno!"); + InsertGuiPair(dialog_box_add_function_caption,"Ańadir funcion"); + InsertGuiPair(dialog_box_edit_function_caption,"Editar funcion"); + InsertGuiPair(dialog_box_add_function_function_exists,"Esta funcion ya existe"); + InsertGuiPair(dialog_box_edit_function_unknown_function,"No existe esta funcion en mi tabla. Problablemente error interno!"); + InsertGuiPair(dialog_box_delete_function_confirm,"Quiere borrar estas funciones?"); + InsertGuiPair(dialog_box_function_not_all_deleted,"Hay algunas funciones que no se pueden borrar. Probablmenete error interno!"); + InsertGuiPair(dialog_box_add_function_incorrect_name,"Nombre incorrecto de la funcion"); + + InsertGuiPair(list_variables_header_1,"Nombre"); + InsertGuiPair(list_variables_header_2,"Valor"); + InsertGuiPair(list_functions_header_1,"Nombre"); + InsertGuiPair(list_functions_header_2,"Param."); + InsertGuiPair(list_functions_header_3,"Valor"); + + InsertGuiPair(button_add,"Ańadir"); + InsertGuiPair(button_edit,"Editar"); + InsertGuiPair(button_delete,"Borrar"); + InsertGuiPair(button_clear,"C"); + InsertGuiPair(tab_standard,"Standard"); + InsertGuiPair(tab_variables,"Variables"); + InsertGuiPair(tab_functions,"Funciones"); + InsertGuiPair(tab_precision,"Precision"); + InsertGuiPair(tab_display,"Pantalla"); + InsertGuiPair(tab_convert,"Convertir"); + + InsertGuiPair(radio_precision_1,"Pequeńo - 96 bits para la mantissa, 32 bits para el exponente"); + InsertGuiPair(radio_precision_2,"Mediano - 288 bits para la mantissa, 64 bits para el exponente"); + InsertGuiPair(radio_precision_3,"Grande - 864 bits para la mantissa, 128 bits para el exponente"); + + + InsertGuiPair(precision_1_info,"(+/-)6.9 e+646457021, 26 digitos validos (decimal)"); + InsertGuiPair(precision_2_info,"(+/-)3.4e+2776511644261678652, 85 digitos validos"); + InsertGuiPair(precision_3_info,"(+/-)6.7e+51217599719369681875006054625051616609, 258 digitos"); + + InsertGuiPair(overflow_during_printing,"Sobredimensión durante impresión"); + + InsertGuiPair(combo_rounding_none,"Ninguno"); + InsertGuiPair(combo_rounding_integer,"a entero"); + InsertGuiPair(combo_rounding_to_number,"a numero"); + InsertGuiPair(combo_rounding_after_comma,"digito(s)"); + InsertGuiPair(check_remove_zeroes,"Eliminar ceros no-significativos"); + + InsertGuiPair(display_input, "Entrada"); + InsertGuiPair(display_output, "Salida"); + InsertGuiPair(display_rounding, "Redondeo"); + InsertGuiPair(display_always_scientific,"Siempre"); + InsertGuiPair(display_not_always_scientific,"Cuando el exponente es mas grande que:"); + InsertGuiPair(display_group_scientific, "Imprimir el resultado como valor cientifico"); + InsertGuiPair(display_decimal_point, "Decimal point"); + InsertGuiPair(convert_type, "Tipo"); + InsertGuiPair(convert_input, "Entrada"); + InsertGuiPair(convert_output, "Salida"); + InsertGuiPair(convert_dynamic_output, "Auto prefijo"); + + InsertGuiPair(menu_view, "&Ver"); + InsertGuiPair(menu_edit, "&Editar"); + InsertGuiPair(menu_help, "&Ayuda"); + InsertGuiPair(menu_language, "&Idioma"); + InsertGuiPair(menu_view_new_window, "&Nueva ventana"); + InsertGuiPair(menu_view_normal_view, "Vista No&rmal"); + InsertGuiPair(menu_view_compact_view, "Vista C&ompacta"); + InsertGuiPair(menu_view_always_on_top, "&Siempre arriba"); + InsertGuiPair(menu_view_lang_english, "&Ingles"); + InsertGuiPair(menu_view_lang_polish, "&Polaco"); + InsertGuiPair(menu_view_lang_spanish, "&Espańol"); + InsertGuiPair(menu_view_close_program, "&Close"); + InsertGuiPair(menu_edit_undo, "&Deshacer"); + InsertGuiPair(menu_edit_paste, "&Pegar"); + InsertGuiPair(menu_edit_copy_result, "&Copiar resultado"); + InsertGuiPair(menu_help_help, "&Ayuda"); + InsertGuiPair(menu_help_project_page, "&Pagina del proyecto"); + InsertGuiPair(menu_help_about, "&Acerca de"); + InsertGuiPair(cant_init_calculations, "No se puede inicializar el modulo de calculo"); + InsertGuiPair(message_box_error_caption,"TTCalc"); + InsertGuiPair(cant_create_thread, "No se puede crear la segunda hebra para calcular"); + InsertGuiPair(cant_create_main_window, "No se puede crear la ventana principal par ala aplicacion"); + InsertGuiPair(cant_init_common_controls,"No se pueden inicializar los controles comunes (InitCommonControlsEx)"); + InsertGuiPair(about_text, + "Calculadora matematica TTCalc %d.%d.%d%s%s\r\n" + "Autor: Tomasz Sowa\r\n" + "Contacto: t.sowa@slimaczek.pl\r\n" + "Licencia: BSD (open source)\r\n" + "Pagina del proyecto: http://ttcalc.sourceforge.net\r\n" + "Biblioteca Bignum: TTMath %d.%d.%d%s\r\n" + "Lenguaje de programacion: C++\r\n" + "Compilador: %s\r\n" + "%s" // for upx + "\r\n" + "TTCalc usa la biblioteca TTMath bignum" + " la cual puede ser encontrada en http://sourceforge.net/projects/ttmath\r\n" + "\r\n" +#ifdef TTCALC_PORTABLE + "Esta es la version portatil del programa TTCalc. En esta version " + "se puede calcular con una precision tal que (96 bits para la " + "mantisa y 32 bits para el exponente) que es aproximadamente +/-6.9e+646457021.\r\n" + "\r\n" +#endif + "Si tienes preguntas, consejos o ideas interesantes sobre" + " este programa o si quieres unirte a este proyecto como" + " desarrollador o programador, no dudes en contactar con el autor." + ); + InsertGuiPair(about_text_portable_version, " version portatil"); + InsertGuiPair(about_text_exe_packer, "EXE Packer: UPX 3.00\r\n"); + InsertGuiPair(about_box_title, "Acerca de"); + InsertGuiPair(about_box_button_close, "Cerrar"); + InsertGuiPair(unknown_error, "Ocurrio un error desconocido"); + InsertGuiPair(cant_find_help, "No se encuentran los ficheros de ayuda"); + InsertGuiPair(cant_open_project_page, "No se puede abrir la pagina dle proyecto"); + } diff --git a/src/languages.h b/src/languages.h index 0d1d4d1..eb940b5 100644 --- a/src/languages.h +++ b/src/languages.h @@ -115,6 +115,7 @@ public: menu_view_always_on_top, menu_view_lang_english, menu_view_lang_polish, + menu_view_lang_spanish, menu_view_close_program, menu_edit_undo, menu_edit_paste, @@ -143,7 +144,7 @@ public: // (after conversion to 'int' we pass it into the std::vector) enum Country { - en = 0, pl + en = 0, pl, sp }; struct ConvType diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 5c48b2a..9e46703 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -404,6 +404,7 @@ HMENU menu = GetMenu(hWnd); SetMenuLanguageItem(menu, IDM_ALWAYS_ON_TOP, Languages::menu_view_always_on_top); SetMenuLanguageItem(menu, IDM_LANGUAGE_ENGLISH, Languages::menu_view_lang_english); SetMenuLanguageItem(menu, IDM_LANGUAGE_POLISH, Languages::menu_view_lang_polish); + SetMenuLanguageItem(menu, IDM_LANGUAGE_SPANISH, Languages::menu_view_lang_spanish); SetMenuLanguageItem(menu, IDM_CLOSE_PROGRAM, Languages::menu_view_close_program); SetMenuLanguageItem(menu, IDM_EDIT_UNDO, Languages::menu_edit_undo); SetMenuLanguageItem(menu, IDM_EDIT_PASTE, Languages::menu_edit_paste); @@ -738,16 +739,22 @@ void WmInitMenuPopUpView(HMENU menu) CheckMenuItem(menu,IDM_NORMAL_VIEW,MF_BYCOMMAND|MF_UNCHECKED); } + + + // languages + + CheckMenuItem(menu, IDM_LANGUAGE_ENGLISH, MF_BYCOMMAND|MF_UNCHECKED); + CheckMenuItem(menu, IDM_LANGUAGE_POLISH, MF_BYCOMMAND|MF_UNCHECKED); + CheckMenuItem(menu, IDM_LANGUAGE_SPANISH, MF_BYCOMMAND|MF_UNCHECKED); + if( GetPrgRes()->GetLanguages()->GetCurrentLanguage() == Languages::en ) - { CheckMenuItem(menu, IDM_LANGUAGE_ENGLISH, MF_BYCOMMAND|MF_CHECKED); - CheckMenuItem(menu, IDM_LANGUAGE_POLISH, MF_BYCOMMAND|MF_UNCHECKED); - } else - { - CheckMenuItem(menu, IDM_LANGUAGE_POLISH, MF_BYCOMMAND|MF_CHECKED); - CheckMenuItem(menu, IDM_LANGUAGE_ENGLISH, MF_BYCOMMAND|MF_UNCHECKED); - } + if( GetPrgRes()->GetLanguages()->GetCurrentLanguage() == Languages::pl ) + CheckMenuItem(menu, IDM_LANGUAGE_POLISH, MF_BYCOMMAND|MF_CHECKED); + else + if( GetPrgRes()->GetLanguages()->GetCurrentLanguage() == Languages::sp ) + CheckMenuItem(menu, IDM_LANGUAGE_SPANISH, MF_BYCOMMAND|MF_CHECKED); } @@ -1005,6 +1012,21 @@ return true; } +BOOL WmCommand_LanguageSpanish(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + GetPrgRes()->GetLanguages()->SetCurrentLanguage(Languages::sp); + + SetMenuLanguage(hWnd); + SetOutputEditLanguage(hWnd); + TabWindowFunctions::SetLanguage( GetDlgItem(hWnd, IDC_TAB) ); + +return true; +} + + + + + BOOL WmHelp(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { SHELLEXECUTEINFO exec; @@ -1071,6 +1093,7 @@ void CreateCommandMessagesTable(Messages & cmessages) cmessages.Associate(IDCANCEL, WmCommand_IDCANCEL); cmessages.Associate(IDM_LANGUAGE_ENGLISH, WmCommand_LanguageEnglish); cmessages.Associate(IDM_LANGUAGE_POLISH, WmCommand_LanguagePolish); + cmessages.Associate(IDM_LANGUAGE_SPANISH, WmCommand_LanguageSpanish); cmessages.Associate(IDM_HELP_HELP, WmHelp); cmessages.Associate(IDM_HELP_PROJECT_PAGE, WmProjectPage); } diff --git a/src/programresources.cpp b/src/programresources.cpp index 7bfcf64..d758c2f 100644 --- a/src/programresources.cpp +++ b/src/programresources.cpp @@ -685,6 +685,9 @@ std::string ini_value[20]; SetDisplayRounding( atoi(ini_value[11].c_str()) ); SetRemovingZeroes( bool(atoi(ini_value[15].c_str())) ); + if( ini_value[13] == "2" ) + languages.SetCurrentLanguage(Languages::sp); + else if( ini_value[13] == "1" ) languages.SetCurrentLanguage(Languages::pl); else diff --git a/src/resource.h b/src/resource.h index 4a22a77..eab1e5b 100644 --- a/src/resource.h +++ b/src/resource.h @@ -191,6 +191,7 @@ #define IDM_ALWAYS_ON_TOP 40004 #define IDM_LANGUAGE_ENGLISH 40010 #define IDM_LANGUAGE_POLISH 40011 +#define IDM_LANGUAGE_SPANISH 40012 #define IDM_CLOSE_PROGRAM 40020 #define IDM_EDIT_UNDO 40030 #define IDM_EDIT_PASTE 40031 diff --git a/src/resource.rc b/src/resource.rc index 1ce3d3a..389c9ac 100644 --- a/src/resource.rc +++ b/src/resource.rc @@ -24,6 +24,7 @@ BEGIN BEGIN MENUITEM "&English", 40010 MENUITEM "&Polish", 40011 + MENUITEM "&Spanish", 40012 END MENUITEM SEPARATOR MENUITEM "&Close", 40020 @@ -174,32 +175,32 @@ END #endif -114 DIALOG DISCARDABLE 0, 0, 255, 90 -STYLE DS_3DLOOK | DS_FIXEDSYS | WS_CHILD | WS_CAPTION | WS_GROUP | - WS_TABSTOP -CAPTION "tab5" -FONT 8, "Ms Shell Dlg" -BEGIN - COMBOBOX 1156,58,5,69,200,CBS_DROPDOWNLIST | WS_GROUP | - WS_TABSTOP - COMBOBOX 1157,58,19,69,200,CBS_DROPDOWNLIST | WS_TABSTOP - LTEXT "Input",1162,11,7,27,8 - LTEXT "Output",1163,11,22,29,8 - LTEXT "Rounding",1164,11,36,43,8 - LTEXT "Decimal point",1169,178,21,68,8 - COMBOBOX 1170,143,19,29,62,CBS_DROPDOWNLIST | WS_TABSTOP - CONTROL "remove trailing zeroes",IDC_CHECK_REMOVE_ZEROES,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,143,35,101,10 - COMBOBOX 1159,58,33,69,200,CBS_DROPDOWNLIST | WS_TABSTOP - CONTROL "Always",1160,"Button",BS_AUTORADIOBUTTON | BS_LEFT | - WS_GROUP | WS_TABSTOP,19,65,44,10 - CONTROL "When the exponent is greater than:",1161,"Button", - BS_AUTORADIOBUTTON | BS_LEFT,77,65,130,10 - EDITTEXT 1166,211,63,29,14,ES_NUMBER | WS_GROUP - CONTROL "",1165,"msctls_updown32",UDS_SETBUDDYINT | - UDS_ALIGNRIGHT | UDS_ARROWKEYS,201,73,11,14 - GROUPBOX "Print scientific value",1168,11,51,240,31 -END +114 DIALOG DISCARDABLE 0, 0, 255, 90 +STYLE DS_3DLOOK | DS_FIXEDSYS | WS_CHILD | WS_CAPTION | WS_GROUP | + WS_TABSTOP +CAPTION "tab5" +FONT 8, "Ms Shell Dlg" +BEGIN + COMBOBOX 1156,58,5,69,200,CBS_DROPDOWNLIST | WS_GROUP | + WS_TABSTOP + COMBOBOX 1157,58,19,69,200,CBS_DROPDOWNLIST | WS_TABSTOP + LTEXT "Input",1162,11,7,27,8 + LTEXT "Output",1163,11,22,29,8 + LTEXT "Rounding",1164,11,36,43,8 + LTEXT "Decimal point",1169,178,21,68,8 + COMBOBOX 1170,143,19,29,62,CBS_DROPDOWNLIST | WS_TABSTOP + CONTROL "remove trailing zeroes",1171,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,143,35,111,10 + COMBOBOX 1159,58,33,69,200,CBS_DROPDOWNLIST | WS_TABSTOP + CONTROL "Always",1160,"Button",BS_AUTORADIOBUTTON | BS_LEFT | + WS_GROUP | WS_TABSTOP,19,65,44,10 + CONTROL "When the exponent is greater than:",1161,"Button", + BS_AUTORADIOBUTTON | BS_LEFT,77,65,130,10 + EDITTEXT 1166,211,63,29,14,ES_NUMBER | WS_GROUP + CONTROL "",1165,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_ARROWKEYS,201,73,11,14 + GROUPBOX "Print scientific value",1168,11,51,240,31 +END diff --git a/src/winmain.cpp b/src/winmain.cpp index 327e7dc..b2c881c 100644 --- a/src/winmain.cpp +++ b/src/winmain.cpp @@ -46,6 +46,7 @@ #include + /*! here our application starts */