From 049f2aae521e97ba700871c473ca1a00c0699c00 Mon Sep 17 00:00:00 2001 From: Stafford Mitchell Horne Date: Wed, 31 May 2006 22:51:24 +0000 Subject: [PATCH] Add macro for N_ for marking string for translation * Can be used to get static context strings translated * I guess this is the best way to do it, see here: http://www.gnu.org/software/gettext/manual/html_node/gettext_153.html http://www.gnu.org/software/gettext/manual/html_node/gettext_19.html SVN revision: 23039 --- autogen.sh | 2 +- src/bin/e_int_config_fonts.c | 80 ++++++++++++++++++------------------ src/bin/e_int_config_paths.c | 22 +++++----- src/bin/e_intl.h | 5 +++ 4 files changed, 57 insertions(+), 52 deletions(-) diff --git a/autogen.sh b/autogen.sh index c1c693047..4b61a5ba8 100755 --- a/autogen.sh +++ b/autogen.sh @@ -19,7 +19,7 @@ xgettext \ --copyright-holder="Enlightenment development team" \ --foreign-user \ --msgid-bugs-address="enlightenment-devel@lists.sourceforge.net" \ --k -k_ -kd_ \ +-k -k_ -kd_ -kN_ \ --from-code=UTF-8 \ -o enlightenment.pot \ `find . -name "*.[ch]" -print` || exit 1 diff --git a/src/bin/e_int_config_fonts.c b/src/bin/e_int_config_fonts.c index 6ca77f78f..72b2daf06 100644 --- a/src/bin/e_int_config_fonts.c +++ b/src/bin/e_int_config_fonts.c @@ -35,49 +35,49 @@ struct _CFText_Class }; const E_Text_Class_Pair text_class_predefined_names[ ] = { - { NULL, "Window Manager"}, - { "title_bar", "Title Bar"}, - { "menu_item", "Menu Item"}, - { "tb_plain", "Textblock Plain"}, - { "tb_light", "Textblock Light"}, - { "tb_big", "Textblock Big"}, - { "move_text", "Move Text"}, - { "resize_text", "Resize Text"}, - { "winlist_title", "Winlist Title"}, - { "configure", "Configure Heading"}, - { "about_title", "About Title"}, - { "about_version", "About Version"}, - { "button_text", "About Text"}, - { "desklock_title", "Desklock Title"}, - { "desklock_passwd", "Desklock Password"}, - { "dialog_error", "Dialog Error"}, - { "exebuf_command", "Exebuf Command"}, - { "init_title", "Splash Title"}, - { "init_text", "Splash Text"}, - { "init_version", "Splash Version"}, + { NULL, N_("Window Manager")}, + { "title_bar", N_("Title Bar")}, + { "menu_item", N_("Menu Item")}, + { "tb_plain", N_("Textblock Plain")}, + { "tb_light", N_("Textblock Light")}, + { "tb_big", N_("Textblock Big")}, + { "move_text", N_("Move Text")}, + { "resize_text", N_("Resize Text")}, + { "winlist_title", N_("Winlist Title")}, + { "configure", N_("Configure Heading")}, + { "about_title", N_("About Title")}, + { "about_version", N_("About Version")}, + { "button_text", N_("About Text")}, + { "desklock_title", N_("Desklock Title")}, + { "desklock_passwd", N_("Desklock Password")}, + { "dialog_error", N_("Dialog Error")}, + { "exebuf_command", N_("Exebuf Command")}, + { "init_title", N_("Splash Title")}, + { "init_text", N_("Splash Text")}, + { "init_version", N_("Splash Version")}, - { NULL, "Widget"}, - { "frame", "Frame"}, - { "label", "Label"}, - { "button", "Buttons"}, - { "slider", "Slider"}, - { "radio_button", "Radio Buttons"}, - { "check_button", "Check Buttons"}, - { "tlist", "Text List Item"}, - { "ilist_item", "List Item"}, - { "ilist_header", "List Header"}, + { NULL, N_("Widget")}, + { "frame", N_("Frame")}, + { "label", N_("Label")}, + { "button", N_("Buttons")}, + { "slider", N_("Slider")}, + { "radio_button", N_("Radio Buttons")}, + { "check_button", N_("Check Buttons")}, + { "tlist", N_("Text List Item")}, + { "ilist_item", N_("List Item")}, + { "ilist_header", N_("List Header")}, - { NULL, "EFM"}, - { "fileman_typebuf", "Typebuf"}, - { "fileman_icon", "Icon"}, + { NULL, N_("EFM")}, + { "fileman_typebuf", N_("Typebuf")}, + { "fileman_icon", N_("Icon")}, - { NULL, "Module"}, - { "module_small", "Small"}, - { "module_normal", "Normal"}, - { "module_large", "Large"}, - { "module_small_s", "Small Styled"}, - { "module_normal_s", "Normal Styled"}, - { "module_large_s", "Large Styled"}, + { NULL, N_("Module")}, + { "module_small", N_("Small")}, + { "module_normal", N_("Normal")}, + { "module_large", N_("Large")}, + { "module_small_s", N_("Small Styled")}, + { "module_normal_s", N_("Normal Styled")}, + { "module_large_s", N_("Large Styled")}, { NULL, NULL} }; diff --git a/src/bin/e_int_config_paths.c b/src/bin/e_int_config_paths.c index 3ebbb9b14..36fc56c18 100644 --- a/src/bin/e_int_config_paths.c +++ b/src/bin/e_int_config_paths.c @@ -67,25 +67,25 @@ _fill_data(E_Config_Dialog_Data *cfdata) { cfdata->paths_available = E_NEW(E_Path_Pair, 11); cfdata->paths_available[0].path = path_data; - cfdata->paths_available[0].path_description = "Data"; + cfdata->paths_available[0].path_description = _("Data"); cfdata->paths_available[1].path = path_images; - cfdata->paths_available[1].path_description = "Images"; + cfdata->paths_available[1].path_description = _("Images"); cfdata->paths_available[2].path = path_fonts; - cfdata->paths_available[2].path_description = "Fonts"; + cfdata->paths_available[2].path_description = _("Fonts"); cfdata->paths_available[3].path = path_themes; - cfdata->paths_available[3].path_description = "Themes"; + cfdata->paths_available[3].path_description = _("Themes"); cfdata->paths_available[4].path = path_init; - cfdata->paths_available[4].path_description = "Init"; + cfdata->paths_available[4].path_description = _("Init"); cfdata->paths_available[5].path = path_icons; - cfdata->paths_available[5].path_description = "Icons"; + cfdata->paths_available[5].path_description = _("Icons"); cfdata->paths_available[6].path = path_modules; - cfdata->paths_available[6].path_description = "Modules"; + cfdata->paths_available[6].path_description = _("Modules"); cfdata->paths_available[7].path = path_backgrounds; - cfdata->paths_available[7].path_description = "Backgrounds"; + cfdata->paths_available[7].path_description = _("Backgrounds"); cfdata->paths_available[8].path = path_input_methods; - cfdata->paths_available[8].path_description = "Input Methods"; + cfdata->paths_available[8].path_description = _("Input Methods"); cfdata->paths_available[9].path = path_messages; - cfdata->paths_available[9].path_description = "Messages"; + cfdata->paths_available[9].path_description = _("Messages"); cfdata->paths_available[10].path = NULL; cfdata->paths_available[10].path_description = NULL; @@ -146,7 +146,7 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf pcd->path = cfdata->paths_available[i].path; pcd->cfdata = cfdata; cfdata->pcd_list = evas_list_append(cfdata->pcd_list, pcd); - e_widget_ilist_append(ob, NULL, _(cfdata->paths_available[i].path_description), _ilist_path_cb_change, pcd, NULL); + e_widget_ilist_append(ob, NULL, cfdata->paths_available[i].path_description, _ilist_path_cb_change, pcd, NULL); } e_widget_ilist_go(ob); diff --git a/src/bin/e_intl.h b/src/bin/e_intl.h index 02ad22da9..7cdd6c9f2 100644 --- a/src/bin/e_intl.h +++ b/src/bin/e_intl.h @@ -6,6 +6,11 @@ #define _(str) gettext(str) #define d_(str, dom) dgettext(PACKAGE dom, str) +/* This macro is used to just mark string for translation, this is useful + * for string lists which are not dynamically allocated + */ +#define N_(str) (str) + typedef struct _E_Input_Method_Config E_Input_Method_Config; typedef struct _E_Language_Pack E_Language_Pack;