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
This commit is contained in:
Stafford Mitchell Horne 2006-05-31 22:51:24 +00:00
parent 715a64d5fe
commit 049f2aae52
4 changed files with 57 additions and 52 deletions

View File

@ -19,7 +19,7 @@ xgettext \
--copyright-holder="Enlightenment development team" \ --copyright-holder="Enlightenment development team" \
--foreign-user \ --foreign-user \
--msgid-bugs-address="enlightenment-devel@lists.sourceforge.net" \ --msgid-bugs-address="enlightenment-devel@lists.sourceforge.net" \
-k -k_ -kd_ \ -k -k_ -kd_ -kN_ \
--from-code=UTF-8 \ --from-code=UTF-8 \
-o enlightenment.pot \ -o enlightenment.pot \
`find . -name "*.[ch]" -print` || exit 1 `find . -name "*.[ch]" -print` || exit 1

View File

@ -35,49 +35,49 @@ struct _CFText_Class
}; };
const E_Text_Class_Pair text_class_predefined_names[ ] = { const E_Text_Class_Pair text_class_predefined_names[ ] = {
{ NULL, "Window Manager"}, { NULL, N_("Window Manager")},
{ "title_bar", "Title Bar"}, { "title_bar", N_("Title Bar")},
{ "menu_item", "Menu Item"}, { "menu_item", N_("Menu Item")},
{ "tb_plain", "Textblock Plain"}, { "tb_plain", N_("Textblock Plain")},
{ "tb_light", "Textblock Light"}, { "tb_light", N_("Textblock Light")},
{ "tb_big", "Textblock Big"}, { "tb_big", N_("Textblock Big")},
{ "move_text", "Move Text"}, { "move_text", N_("Move Text")},
{ "resize_text", "Resize Text"}, { "resize_text", N_("Resize Text")},
{ "winlist_title", "Winlist Title"}, { "winlist_title", N_("Winlist Title")},
{ "configure", "Configure Heading"}, { "configure", N_("Configure Heading")},
{ "about_title", "About Title"}, { "about_title", N_("About Title")},
{ "about_version", "About Version"}, { "about_version", N_("About Version")},
{ "button_text", "About Text"}, { "button_text", N_("About Text")},
{ "desklock_title", "Desklock Title"}, { "desklock_title", N_("Desklock Title")},
{ "desklock_passwd", "Desklock Password"}, { "desklock_passwd", N_("Desklock Password")},
{ "dialog_error", "Dialog Error"}, { "dialog_error", N_("Dialog Error")},
{ "exebuf_command", "Exebuf Command"}, { "exebuf_command", N_("Exebuf Command")},
{ "init_title", "Splash Title"}, { "init_title", N_("Splash Title")},
{ "init_text", "Splash Text"}, { "init_text", N_("Splash Text")},
{ "init_version", "Splash Version"}, { "init_version", N_("Splash Version")},
{ NULL, "Widget"}, { NULL, N_("Widget")},
{ "frame", "Frame"}, { "frame", N_("Frame")},
{ "label", "Label"}, { "label", N_("Label")},
{ "button", "Buttons"}, { "button", N_("Buttons")},
{ "slider", "Slider"}, { "slider", N_("Slider")},
{ "radio_button", "Radio Buttons"}, { "radio_button", N_("Radio Buttons")},
{ "check_button", "Check Buttons"}, { "check_button", N_("Check Buttons")},
{ "tlist", "Text List Item"}, { "tlist", N_("Text List Item")},
{ "ilist_item", "List Item"}, { "ilist_item", N_("List Item")},
{ "ilist_header", "List Header"}, { "ilist_header", N_("List Header")},
{ NULL, "EFM"}, { NULL, N_("EFM")},
{ "fileman_typebuf", "Typebuf"}, { "fileman_typebuf", N_("Typebuf")},
{ "fileman_icon", "Icon"}, { "fileman_icon", N_("Icon")},
{ NULL, "Module"}, { NULL, N_("Module")},
{ "module_small", "Small"}, { "module_small", N_("Small")},
{ "module_normal", "Normal"}, { "module_normal", N_("Normal")},
{ "module_large", "Large"}, { "module_large", N_("Large")},
{ "module_small_s", "Small Styled"}, { "module_small_s", N_("Small Styled")},
{ "module_normal_s", "Normal Styled"}, { "module_normal_s", N_("Normal Styled")},
{ "module_large_s", "Large Styled"}, { "module_large_s", N_("Large Styled")},
{ NULL, NULL} { NULL, NULL}
}; };

View File

@ -67,25 +67,25 @@ _fill_data(E_Config_Dialog_Data *cfdata)
{ {
cfdata->paths_available = E_NEW(E_Path_Pair, 11); cfdata->paths_available = E_NEW(E_Path_Pair, 11);
cfdata->paths_available[0].path = path_data; 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = NULL;
cfdata->paths_available[10].path_description = 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->path = cfdata->paths_available[i].path;
pcd->cfdata = cfdata; pcd->cfdata = cfdata;
cfdata->pcd_list = evas_list_append(cfdata->pcd_list, pcd); 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); e_widget_ilist_go(ob);

View File

@ -6,6 +6,11 @@
#define _(str) gettext(str) #define _(str) gettext(str)
#define d_(str, dom) dgettext(PACKAGE dom, 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_Input_Method_Config E_Input_Method_Config;
typedef struct _E_Language_Pack E_Language_Pack; typedef struct _E_Language_Pack E_Language_Pack;