Add macro for N_ for marking string for translation
authorStafford Mitchell Horne <shorne@gmail.com>
Wed, 31 May 2006 22:51:24 +0000 (22:51 +0000)
committerStafford Mitchell Horne <shorne@gmail.com>
Wed, 31 May 2006 22:51:24 +0000 (22:51 +0000)
 * 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
src/bin/e_int_config_fonts.c
src/bin/e_int_config_paths.c
src/bin/e_intl.h

index c1c6930..4b61a5b 100755 (executable)
@@ -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
index 6ca77f7..72b2daf 100644 (file)
@@ -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}
 };
index 3ebbb9b..36fc56c 100644 (file)
@@ -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);
index 02ad22d..7cdd6c9 100644 (file)
@@ -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;