From 45312373110686c28fec347d41e0ea4cb0277250 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Tue, 18 Apr 2000 11:21:45 +0000 Subject: [PATCH] r250: Completed marking translatable strings. Tested by reversing all the strings - seems to have full coverage. --- ROX-Filer/Help/Changes | 5 + ROX-Filer/src/action.c | 277 ++++++++++++++++++++++++-------------------- ROX-Filer/src/dir.c | 6 +- ROX-Filer/src/find.c | 93 ++++++++------- ROX-Filer/src/gtksavebox.c | 10 +- ROX-Filer/src/gui_support.c | 12 +- ROX-Filer/src/i18n.c | 5 +- ROX-Filer/src/main.c | 36 +++--- ROX-Filer/src/menu.c | 161 ++++++++++++------------- ROX-Filer/src/minibuffer.c | 4 +- ROX-Filer/src/options.c | 53 ++++----- ROX-Filer/src/po/make-mo | 2 +- ROX-Filer/src/run.c | 10 +- ROX-Filer/src/support.c | 6 +- ROX-Filer/src/type.c | 30 ++--- 15 files changed, 370 insertions(+), 340 deletions(-) diff --git a/ROX-Filer/Help/Changes b/ROX-Filer/Help/Changes index a8654762..5f7f1407 100644 --- a/ROX-Filer/Help/Changes +++ b/ROX-Filer/Help/Changes @@ -3,6 +3,11 @@ by Thomas Leonard +17-Apr-2000 +~~~~~~~~~~~ +Made lots of changes to the way menus are stored; this makes i18n of the +menus easier. + 16-Apr-2000 ~~~~~~~~~~~ Added GNU gettext support. diff --git a/ROX-Filer/src/action.c b/ROX-Filer/src/action.c index 67c287b4..4da273a2 100644 --- a/ROX-Filer/src/action.c +++ b/ROX-Filer/src/action.c @@ -169,21 +169,21 @@ static GtkWidget *create_options() vbox = gtk_vbox_new(FALSE, 0); gtk_container_set_border_width(GTK_CONTAINER(vbox), 4); - label = gtk_label_new("Auto-start (Quiet) these actions:"); + label = gtk_label_new(_("Auto-start (Quiet) these actions:")); gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, TRUE, 0); hbox = gtk_hbox_new(TRUE, 0); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, TRUE, 0); - w_auto_copy = gtk_check_button_new_with_label("Copy"); + w_auto_copy = gtk_check_button_new_with_label(_("Copy")); gtk_box_pack_start(GTK_BOX(hbox), w_auto_copy, FALSE, TRUE, 0); - w_auto_move = gtk_check_button_new_with_label("Move"); + w_auto_move = gtk_check_button_new_with_label(_("Move")); gtk_box_pack_start(GTK_BOX(hbox), w_auto_move, FALSE, TRUE, 0); - w_auto_link = gtk_check_button_new_with_label("Link"); + w_auto_link = gtk_check_button_new_with_label(_("Link")); gtk_box_pack_start(GTK_BOX(hbox), w_auto_link, FALSE, TRUE, 0); - w_auto_delete = gtk_check_button_new_with_label("Delete"); + w_auto_delete = gtk_check_button_new_with_label(_("Delete")); gtk_box_pack_start(GTK_BOX(hbox), w_auto_delete, FALSE, TRUE, 0); - w_auto_mount = gtk_check_button_new_with_label("Mount"); + w_auto_mount = gtk_check_button_new_with_label(_("Mount")); gtk_box_pack_start(GTK_BOX(hbox), w_auto_mount, FALSE, TRUE, 0); return vbox; @@ -264,7 +264,7 @@ static char *action_auto_quiet(char *data) o_auto_mount = state; break; default: - return "Unknown flag"; + return _("Unknown flag"); } } @@ -340,66 +340,66 @@ static void show_condition_help(gpointer data) help = gtk_window_new(GTK_WINDOW_DIALOG); gtk_container_set_border_width(GTK_CONTAINER(help), 10); gtk_window_set_title(GTK_WINDOW(help), - "Find expression reference"); + _("Find expression reference")); vbox = gtk_vbox_new(FALSE, 0); gtk_container_add(GTK_CONTAINER(help), vbox); - frame = gtk_frame_new("Quick Start"); + frame = gtk_frame_new(_("Quick Start")); text = gtk_label_new( -"Just put the name of the file you're looking for in single quotes:\n" -"'index.html' (to find a file called 'index.html')"); +_("Just put the name of the file you're looking for in single quotes:\n" +"'index.html' (to find a file called 'index.html')")); gtk_misc_set_padding(GTK_MISC(text), 4, 4); gtk_label_set_justify(GTK_LABEL(text), GTK_JUSTIFY_LEFT); gtk_container_add(GTK_CONTAINER(frame), text); gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 4); - frame = gtk_frame_new("Examples"); + frame = gtk_frame_new(_("Examples")); text = gtk_label_new( -"'*.htm', '*.html' (finds HTML files)\n" +_("'*.htm', '*.html' (finds HTML files)\n" "IsDir 'lib' (finds directories called 'lib')\n" "IsReg 'core' (finds a regular file called 'core')\n" "! (IsDir, IsReg) (is neither a directory nor a regualr file)\n" "mtime after 1 day ago and size > 1Mb (big, and recently modified)\n" "'CVS' prune, isreg (a regular file not in CVS)\n" -"IsReg system(grep -q fred \"%\") (contains the word 'fred')"); +"IsReg system(grep -q fred \"%\") (contains the word 'fred')")); gtk_widget_set_style(text, fixed_style); gtk_misc_set_padding(GTK_MISC(text), 4, 4); gtk_label_set_justify(GTK_LABEL(text), GTK_JUSTIFY_LEFT); gtk_container_add(GTK_CONTAINER(frame), text); gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 4); - frame = gtk_frame_new("Simple Tests"); + frame = gtk_frame_new(_("Simple Tests")); text = gtk_label_new( -"IsReg, IsLink, IsDir, IsChar, IsBlock, IsDev, IsPipe, IsSocket (types)\n" +_("IsReg, IsLink, IsDir, IsChar, IsBlock, IsDev, IsPipe, IsSocket (types)\n" "IsSUID, IsSGID, IsSticky, IsReadable, IsWriteable, IsExecutable (permissions)" "\n" "IsEmpty, IsMine\n" "\n" "A pattern in single quotes is a shell-style wildcard pattern to match. If it\n" "contains a slash then the match is agaist the full path; otherwise it is \n" -"agaist the leafname only."); +"agaist the leafname only.")); gtk_misc_set_padding(GTK_MISC(text), 4, 4); gtk_label_set_justify(GTK_LABEL(text), GTK_JUSTIFY_LEFT); gtk_container_add(GTK_CONTAINER(frame), text); gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 4); - frame = gtk_frame_new("Comparisons"); + frame = gtk_frame_new(_("Comparisons")); text = gtk_label_new( -"<, <=, =, !=, >, >=, After, Before (compare two values)\n" +_("<, <=, =, !=, >, >=, After, Before (compare two values)\n" "5 bytes, 1Kb, 2Mb, 3Gb (file sizes)\n" "2 secs|mins|hours|days|weeks|years ago|hence (times)\n" -"atime, ctime, mtime, now, size, inode, nlinks, uid, gid, blocks (values)"); +"atime, ctime, mtime, now, size, inode, nlinks, uid, gid, blocks (values)")); gtk_misc_set_padding(GTK_MISC(text), 4, 4); gtk_label_set_justify(GTK_LABEL(text), GTK_JUSTIFY_LEFT); gtk_container_add(GTK_CONTAINER(frame), text); gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 4); - frame = gtk_frame_new("Specials"); + frame = gtk_frame_new(_("Specials")); text = gtk_label_new( -"system(command) (true if 'command' returns with a zero exit status; a % \n" +_("system(command) (true if 'command' returns with a zero exit status; a % \n" "in 'command' is replaced with the path of the current file)\n" -"prune (false, and prevents searching the contents of a directory)." +"prune (false, and prevents searching the contents of a directory).") ); gtk_misc_set_padding(GTK_MISC(text), 4, 4); gtk_label_set_justify(GTK_LABEL(text), GTK_JUSTIFY_LEFT); @@ -410,9 +410,9 @@ static void show_condition_help(gpointer data) gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 0); text = gtk_label_new( - "See the ROX-Filer manual for full details."); + _("See the ROX-Filer manual for full details.")); gtk_box_pack_start(GTK_BOX(hbox), text, TRUE, TRUE, 0); - button = gtk_button_new_with_label("Close"); + button = gtk_button_new_with_label(_("Close")); gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, TRUE, 0); gtk_signal_connect_object(GTK_OBJECT(button), "clicked", gtk_widget_hide, GTK_OBJECT(help)); @@ -437,13 +437,13 @@ static void show_chmod_help(gpointer data) help = gtk_window_new(GTK_WINDOW_DIALOG); gtk_container_set_border_width(GTK_CONTAINER(help), 10); gtk_window_set_title(GTK_WINDOW(help), - "Permissions command reference"); + _("Permissions command reference")); vbox = gtk_vbox_new(FALSE, 0); gtk_container_add(GTK_CONTAINER(help), vbox); text = gtk_label_new( - "The format of a command is:\n" + _("The format of a command is:\n" "CHANGE, CHANGE, ...\n" "Each CHANGE is:\n" "WHO HOW PERMISSIONS\n" @@ -464,7 +464,7 @@ static void show_chmod_help(gpointer data) "u+s (set the SetUID bit - often has no effect on script files)\n" "755 (set the permissions directly)\n" - "\nSee the chmod(1) man page for full details."); + "\nSee the chmod(1) man page for full details.")); gtk_label_set_justify(GTK_LABEL(text), GTK_JUSTIFY_LEFT); gtk_box_pack_start(GTK_BOX(vbox), text, TRUE, TRUE, 0); @@ -473,7 +473,7 @@ static void show_chmod_help(gpointer data) sep = gtk_hseparator_new(); gtk_box_pack_start(GTK_BOX(hbox), sep, TRUE, TRUE, 0); - button = gtk_button_new_with_label("Close"); + button = gtk_button_new_with_label(_("Close")); gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, TRUE, 0); gtk_signal_connect_object(GTK_OBJECT(button), "clicked", gtk_widget_hide, GTK_OBJECT(help)); @@ -616,7 +616,7 @@ static void message_from_child(gpointer data, g_free(buffer); return; } - g_print("Child died in the middle of a message.\n"); + g_printerr("Child died in the middle of a message.\n"); } /* The child is dead */ @@ -630,16 +630,18 @@ static void message_from_child(gpointer data, if (gui_side->errors) { - GString *report; - report = g_string_new(NULL); - g_string_sprintf(report, "There %s %d error%s.\n", - gui_side->errors == 1 ? "was" : "were", - gui_side->errors, - gui_side->errors == 1 ? "" : "s"); + guchar *report; + + if (gui_side->errors == 1) + report = g_strdup(_("There was one error.\n")); + else + report = g_strdup_printf(_("There were %d errors.\n"), + gui_side->errors); + gtk_text_insert(GTK_TEXT(log), NULL, &red, NULL, - report->str, report->len); + report, -1); - g_string_free(report, TRUE); + g_free(report); } else if (gui_side->show_info == FALSE) gtk_widget_destroy(gui_side->window); @@ -655,7 +657,9 @@ static void for_dir_contents(ForDirCB *cb, char *src_dir, char *dest_path) d = mc_opendir(src_dir); if (!d) { - g_string_sprintf(message, "!ERROR reading '%s': %s\n", + /* Message displayed is "ERROR reading 'path': message" */ + g_string_sprintf(message, "!%s '%s': %s\n", + _("ERROR reading"), src_dir, g_strerror(errno)); send(); return; @@ -732,7 +736,7 @@ static gboolean send_dir(char *dir) static gboolean send_error() { - g_string_sprintf(message, "!ERROR: %s\n", g_strerror(errno)); + g_string_sprintf(message, "!%s: %s\n", _("ERROR"), g_strerror(errno)); return send(); } @@ -871,11 +875,11 @@ static gboolean reply(int fd, gboolean ignore_quiet) } break; case 'Y': - g_string_assign(message, "' Yes\n"); + g_string_sprintf(message, "' %s\n", _("Yes")); send(); return TRUE; case 'N': - g_string_assign(message, "' No\n"); + g_string_sprintf(message, "' %s\n", _("No")); send(); return FALSE; case 'E': @@ -889,7 +893,7 @@ static gboolean reply(int fd, gboolean ignore_quiet) if (asked) { - g_string_assign(message, "' Quiet\n"); + g_string_sprintf(message, "' %s\n", _("Quiet")); send(); } return TRUE; @@ -942,7 +946,7 @@ static GUIside *start_action(gpointer data, ActionChild *func, gboolean autoq) if (pipe(filedes)) { - report_error("ROX-Filer", g_strerror(errno)); + report_error(PROJECT, g_strerror(errno)); return NULL; } @@ -950,7 +954,7 @@ static GUIside *start_action(gpointer data, ActionChild *func, gboolean autoq) { close(filedes[0]); close(filedes[1]); - report_error("ROX-Filer", g_strerror(errno)); + report_error(PROJECT, g_strerror(errno)); return NULL; } @@ -958,7 +962,7 @@ static GUIside *start_action(gpointer data, ActionChild *func, gboolean autoq) switch (child) { case -1: - report_error("ROX-Filer", g_strerror(errno)); + report_error(PROJECT, g_strerror(errno)); return NULL; case 0: /* We are the child */ @@ -1009,7 +1013,7 @@ static GUIside *start_action(gpointer data, ActionChild *func, gboolean autoq) gui_side->vbox = vbox = gtk_vbox_new(FALSE, 0); gtk_container_add(GTK_CONTAINER(gui_side->window), vbox); - gui_side->dir = gtk_label_new(""); + gui_side->dir = gtk_label_new(_("")); gui_side->next_dir = NULL; gtk_misc_set_alignment(GTK_MISC(gui_side->dir), 0.5, 0.5); gtk_box_pack_start(GTK_BOX(vbox), gui_side->dir, FALSE, TRUE, 0); @@ -1028,25 +1032,25 @@ static GUIside *start_action(gpointer data, ActionChild *func, gboolean autoq) actions = gtk_hbox_new(TRUE, 4); gtk_box_pack_start(GTK_BOX(vbox), actions, FALSE, TRUE, 0); - gui_side->quiet = button = gtk_toggle_button_new_with_label("Quiet"); + gui_side->quiet = button = gtk_toggle_button_new_with_label(_("Quiet")); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), autoq); gtk_object_set_data(GTK_OBJECT(button), "send-code", "Q"); gtk_box_pack_start(GTK_BOX(actions), button, TRUE, TRUE, 0); gtk_signal_connect(GTK_OBJECT(button), "clicked", button_reply, gui_side); - gui_side->yes = button = gtk_button_new_with_label("Yes"); + gui_side->yes = button = gtk_button_new_with_label(_("Yes")); gtk_object_set_data(GTK_OBJECT(button), "send-code", "Y"); gtk_box_pack_start(GTK_BOX(actions), button, TRUE, TRUE, 0); gtk_signal_connect(GTK_OBJECT(button), "clicked", button_reply, gui_side); - gui_side->no = button = gtk_button_new_with_label("No"); + gui_side->no = button = gtk_button_new_with_label(_("No")); gtk_object_set_data(GTK_OBJECT(button), "send-code", "N"); gtk_box_pack_start(GTK_BOX(actions), button, TRUE, TRUE, 0); gtk_signal_connect(GTK_OBJECT(button), "clicked", button_reply, gui_side); SENSITIVE_YESNO(gui_side, FALSE); - button = gtk_button_new_with_label("Abort"); + button = gtk_button_new_with_label(_("Abort")); gtk_box_pack_start(GTK_BOX(actions), button, TRUE, TRUE, 0); gtk_signal_connect_object(GTK_OBJECT(button), "clicked", gtk_widget_destroy, GTK_OBJECT(gui_side->window)); @@ -1086,7 +1090,7 @@ static gboolean do_usage(char *src_path, char *dest_path) size_tally += info.st_size; else if (S_ISDIR(info.st_mode)) { - g_string_sprintf(message, "?Count contents of %s?", + g_string_sprintf(message, _("?Count contents of %s?"), src_path); if (reply(from_parent, FALSE)) { @@ -1118,15 +1122,15 @@ static gboolean do_delete(char *src_path, char *dest_path) : access(src_path, W_OK) != 0; if (write_prot || !quiet) { - g_string_sprintf(message, "?Delete %s'%s'?", - write_prot ? "WRITE-PROTECTED " : " ", + g_string_sprintf(message, _("?Delete %s'%s'?"), + write_prot ? _("WRITE-PROTECTED ") : " ", src_path); if (!reply(from_parent, write_prot && !o_force)) return FALSE; } else if (!o_brief) { - g_string_sprintf(message, "'Deleting '%s'\n", src_path); + g_string_sprintf(message, _("'Deleting '%s'\n"), src_path); send(); } @@ -1141,7 +1145,7 @@ static gboolean do_delete(char *src_path, char *dest_path) send_error(); return FALSE; } - g_string_sprintf(message, "'Directory '%s' deleted\n", + g_string_sprintf(message, _("'Directory '%s' deleted\n"), safe_path); send(); g_string_sprintf(message, "m%s", safe_path); @@ -1169,7 +1173,7 @@ static gboolean do_find(char *path, char *dummy) if (!quiet) { - g_string_sprintf(message, "?Check '%s'?", path); + g_string_sprintf(message, _("?Check '%s'?"), path); if (!reply(from_parent, FALSE)) return FALSE; } @@ -1188,10 +1192,10 @@ static gboolean do_find(char *path, char *dummy) if (find_condition) break; - g_string_assign(message, - "!Invalid find condition - change it and try again\n"); + g_string_assign(message, _("!Invalid find condition - " + "change it and try again\n")); send(); - g_string_sprintf(message, "?Check '%s'?", path); + g_string_sprintf(message, _("?Check '%s'?"), path); if (!reply(from_parent, TRUE)) return FALSE; } @@ -1199,7 +1203,7 @@ static gboolean do_find(char *path, char *dummy) if (mc_lstat(path, &info.stats)) { send_error(); - g_string_sprintf(message, "'(while checking '%s')\n", path); + g_string_sprintf(message, _("'(while checking '%s')\n"), path); send(); return FALSE; } @@ -1244,13 +1248,15 @@ static gboolean do_chmod(char *path, char *dummy) if (!quiet) { - g_string_sprintf(message, "?Change permissions of '%s'?", path); + g_string_sprintf(message, + _("?Change permissions of '%s'?"), path); if (!reply(from_parent, FALSE)) return FALSE; } else if (!o_brief) { - g_string_sprintf(message, "'Changing permissions of '%s'\n", + g_string_sprintf(message, + _("'Changing permissions of '%s'\n"), path); send(); } @@ -1271,9 +1277,10 @@ static gboolean do_chmod(char *path, char *dummy) break; g_string_assign(message, - "!Invalid mode command - change it and try again\n"); + _("!Invalid mode command - change it and try again\n")); send(); - g_string_sprintf(message, "?Change permissions of '%s'?", path); + g_string_sprintf(message, + _("?Change permissions of '%s'?"), path); if (!reply(from_parent, TRUE)) return FALSE; } @@ -1352,9 +1359,9 @@ static gboolean do_copy2(char *path, char *dest) merge = S_ISDIR(info.st_mode) && S_ISDIR(dest_info.st_mode); - g_string_sprintf(message, "?'%s' already exists - %s?", + g_string_sprintf(message, _("?'%s' already exists - %s?"), dest_path, - merge ? "merge contents" : "overwrite"); + merge ? _("merge contents") : _("overwrite")); if (!reply(from_parent, TRUE)) return FALSE; @@ -1372,20 +1379,21 @@ static gboolean do_copy2(char *path, char *dest) if (errno != ENOENT) return FALSE; g_string_sprintf(message, - "'Trying copy anyway...\n"); + _("'Trying copy anyway...\n")); send(); } } } else if (!quiet) { - g_string_sprintf(message, "?Copy %s as %s?", path, dest_path); + g_string_sprintf(message, + _("?Copy %s as %s?"), path, dest_path); if (!reply(from_parent, FALSE)) return FALSE; } else { - g_string_sprintf(message, "'Copying %s as %s\n", path, + g_string_sprintf(message, _("'Copying %s as %s\n"), path, dest_path); send(); } @@ -1409,8 +1417,8 @@ static gboolean do_copy2(char *path, char *dest) if (exists && !S_ISDIR(dest_info.st_mode)) { g_string_sprintf(message, - "!ERROR: Destination already exists, " - "but is not a directory\n"); + _("!ERROR: Destination already exists, " + "but is not a directory\n")); } else if (exists == FALSE && mkdir(dest_path, info.st_mode)) send_error(); @@ -1464,7 +1472,7 @@ static gboolean do_copy2(char *path, char *dest) if (error) { - g_string_sprintf(message, "!ERROR: %s\n", error); + g_string_sprintf(message, _("!ERROR: %s\n"), error); send(); retval = FALSE; } @@ -1481,7 +1489,7 @@ static gboolean do_copy(char *path, char *dest) if (is_sub_dir(make_dest_path(path, dest), path)) { g_string_sprintf(message, - "!ERROR: Can't copy directory into itself\n"); + _("!ERROR: Can't copy directory into itself\n")); send(); return FALSE; } @@ -1503,7 +1511,7 @@ static gboolean do_move(char *path, char *dest) if (is_sub_dir(dest, path)) { g_string_sprintf(message, - "!ERROR: Can't move directory into itself\n"); + _("!ERROR: Can't move directory into itself\n")); send(); return FALSE; } @@ -1525,7 +1533,8 @@ static gboolean do_move(char *path, char *dest) struct stat info; int err; - g_string_sprintf(message, "?'%s' already exists - overwrite?", + g_string_sprintf(message, + _("?'%s' already exists - overwrite?"), dest_path); if (!reply(from_parent, TRUE)) return FALSE; @@ -1547,19 +1556,20 @@ static gboolean do_move(char *path, char *dest) if (errno != ENOENT) return FALSE; g_string_sprintf(message, - "'Trying move anyway...\n"); + _("'Trying move anyway...\n")); send(); } } else if (!quiet) { - g_string_sprintf(message, "?Move %s as %s?", path, dest_path); + g_string_sprintf(message, + _("?Move %s as %s?"), path, dest_path); if (!reply(from_parent, FALSE)) return FALSE; } else { - g_string_sprintf(message, "'Moving %s as %s\n", path, + g_string_sprintf(message, _("'Moving %s as %s\n"), path, dest_path); send(); } @@ -1579,7 +1589,8 @@ static gboolean do_move(char *path, char *dest) } else { - g_string_sprintf(message, "!ERROR: Failed to move %s as %s\n", + g_string_sprintf(message, + _("!ERROR: Failed to move %s as %s\n"), path, dest_path); send(); retval = FALSE; @@ -1605,13 +1616,14 @@ static gboolean do_link(char *path, char *dest) if (quiet) { - g_string_sprintf(message, "'Linking %s as %s\n", path, + g_string_sprintf(message, _("'Linking %s as %s\n"), path, dest_path); send(); } else { - g_string_sprintf(message, "?Link %s as %s?", path, dest_path); + g_string_sprintf(message, + _("?Link %s as %s?"), path, dest_path); if (!reply(from_parent, FALSE)) return FALSE; } @@ -1629,22 +1641,27 @@ static gboolean do_link(char *path, char *dest) static void do_mount(FilerWindow *filer_window, DirItem *item) { char *argv[3] = {NULL, NULL, NULL}; - char *action; + gboolean mount = (item->flags & ITEM_FLAG_MOUNTED) == 0; check_flags(); - argv[0] = item->flags & ITEM_FLAG_MOUNTED ? "umount" : "mount"; - action = item->flags & ITEM_FLAG_MOUNTED ? "Unmount" : "Mount"; + argv[0] = mount ? "mount" : "umount"; argv[1] = make_path(filer_window->path, item->leafname)->str; if (quiet) { - g_string_sprintf(message, "'%sing %s\n", action, argv[1]); + g_string_sprintf(message, + mount ? _("'Mounting %s\n") + : _("'Unmounting %s\n"), + argv[1]); send(); } else { - g_string_sprintf(message, "?%s %s?", action, argv[1]); + g_string_sprintf(message, + mount ? _("?Mount %s?\n") + : _("?Unmount %s?\n"), + argv[1]); if (!reply(from_parent, FALSE)) return; } @@ -1658,7 +1675,7 @@ static void do_mount(FilerWindow *filer_window, DirItem *item) } else { - g_string_sprintf(message, "!ERROR: %s failed\n", action); + g_string_sprintf(message, _("!ERROR: Mount failed\n")); send(); } } @@ -1696,7 +1713,7 @@ static void usage_cb(gpointer data) left--; } - g_string_sprintf(message, "'\nTotal: %s\n", + g_string_sprintf(message, _("'\nTotal: %s\n"), format_size((unsigned long) total_size)); send(); } @@ -1731,12 +1748,12 @@ static void mount_cb(gpointer data) if (!mount_points) { g_string_sprintf(message, - "!No mount points selected!\n"); + _("!No mount points selected!\n")); send(); } } - g_string_sprintf(message, "'\nDone\n"); + g_string_sprintf(message, _("'\nDone\n")); send(); } #endif @@ -1767,7 +1784,7 @@ static void delete_cb(gpointer data) left--; } - g_string_sprintf(message, "'\nDone\n"); + g_string_sprintf(message, _("'\nDone\n")); send(); } @@ -1793,7 +1810,7 @@ static void find_cb(gpointer data) left--; } - g_string_sprintf(message, "'\nDone\n"); + g_string_sprintf(message, _("'\nDone\n")); send(); } @@ -1815,7 +1832,8 @@ static void chmod_cb(gpointer data) item = (DirItem *) collection->items[i].data; if (item->flags & ITEM_FLAG_SYMLINK) { - g_string_sprintf(message, "!'%s' is a symbolic link\n", + g_string_sprintf(message, + _("!'%s' is a symbolic link\n"), item->leafname); send(); } @@ -1828,7 +1846,7 @@ static void chmod_cb(gpointer data) left--; } - g_string_sprintf(message, "'\nDone\n"); + g_string_sprintf(message, _("'\nDone\n")); send(); } @@ -1849,7 +1867,7 @@ static void list_cb(gpointer data) paths = paths->next; } - g_string_sprintf(message, "'\nDone\n"); + g_string_sprintf(message, _("'\nDone\n")); send(); } @@ -1872,14 +1890,17 @@ void action_find(FilerWindow *filer_window) GUIside *gui_side; Collection *collection; GtkWidget *hbox, *label, *button, *scroller; - gchar *titles[] = {"Name", "Directory"}; + gchar *titles[2]; + + titles[0] = _("Name"); + titles[1] = _("Directory"); collection = filer_window->collection; if (collection->number_selected < 1) { - report_error("ROX-Filer", "You need to select some items " - "to search through"); + report_error(PROJECT, _("You need to select some items " + "to search through")); return; } @@ -1911,7 +1932,7 @@ void action_find(FilerWindow *filer_window) GTK_SIGNAL_FUNC(select_row_callback), gui_side); hbox = gtk_hbox_new(FALSE, 0); - label = gtk_label_new("Expression:"); + label = gtk_label_new(_("Expression:")); gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, TRUE, 4); gui_side->default_string = &last_find_string; gui_side->entry = gtk_entry_new(); @@ -1923,12 +1944,12 @@ void action_find(FilerWindow *filer_window) gtk_signal_connect(GTK_OBJECT(gui_side->entry), "changed", entry_changed, gui_side); gtk_box_pack_start(GTK_BOX(gui_side->vbox), hbox, FALSE, TRUE, 4); - button = gtk_button_new_with_label("Show expression reference"); + button = gtk_button_new_with_label(_("Show expression reference")); gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, TRUE, 4); gtk_signal_connect_object(GTK_OBJECT(button), "clicked", show_condition_help, NULL); - gtk_window_set_title(GTK_WINDOW(gui_side->window), "Find"); + gtk_window_set_title(GTK_WINDOW(gui_side->window), _("Find")); gtk_window_set_focus(GTK_WINDOW(gui_side->window), gui_side->entry); gtk_signal_connect_object(GTK_OBJECT(gui_side->entry), "activate", gtk_button_clicked, GTK_OBJECT(gui_side->quiet)); @@ -1946,8 +1967,8 @@ void action_usage(FilerWindow *filer_window) if (collection->number_selected < 1) { - report_error("ROX-Filer", "You need to select some items " - "to count"); + report_error(PROJECT, + _("You need to select some items to count")); return; } @@ -1957,7 +1978,7 @@ void action_usage(FilerWindow *filer_window) gui_side->show_info = TRUE; - gtk_window_set_title(GTK_WINDOW(gui_side->window), "Disk Usage"); + gtk_window_set_title(GTK_WINDOW(gui_side->window), _("Disk Usage")); number_of_windows++; gtk_widget_show_all(gui_side->window); } @@ -1973,8 +1994,8 @@ void action_mount(FilerWindow *filer_window, DirItem *item) if (item == NULL && collection->number_selected < 1) { - report_error("ROX-Filer", "You need to select some items " - "to mount or unmount"); + report_error(PROJECT, + _("You need to select some items to mount or unmount")); return; } @@ -1983,13 +2004,14 @@ void action_mount(FilerWindow *filer_window, DirItem *item) if (!gui_side) return; - gtk_window_set_title(GTK_WINDOW(gui_side->window), "Mount / Unmount"); + gtk_window_set_title(GTK_WINDOW(gui_side->window), + _("Mount / Unmount")); number_of_windows++; gtk_widget_show_all(gui_side->window); #else - report_error("ROX-Filer", - "ROX-Filer does not yet support mount points on your " - "system. Sorry."); + report_error(PROJECT, + _("ROX-Filer does not yet support mount points on your " + "system. Sorry.")); #endif /* DO_MOUNT_POINTS */ } @@ -2003,8 +2025,8 @@ void action_delete(FilerWindow *filer_window) if (collection->number_selected < 1) { - report_error("ROX-Filer", "You need to select some items " - "to delete"); + report_error(PROJECT, + _("You need to select some items to delete")); return; } @@ -2012,11 +2034,13 @@ void action_delete(FilerWindow *filer_window) if (!gui_side) return; - gtk_window_set_title(GTK_WINDOW(gui_side->window), "Delete"); + gtk_window_set_title(GTK_WINDOW(gui_side->window), _("Delete")); add_toggle(gui_side, - "Force - don't confirm deletion of non-writeable items", "F"); + _("Force - don't confirm deletion of non-writeable items"), + "F"); add_toggle(gui_side, - "Brief - only log directories being deleted", "B"); + _("Brief - only log directories being deleted"), + "B"); number_of_windows++; gtk_widget_show_all(gui_side->window); @@ -2033,8 +2057,9 @@ void action_chmod(FilerWindow *filer_window) if (collection->number_selected < 1) { - report_error("ROX-Filer", "You need to select the items " - "whose permissions you want to change"); + report_error(PROJECT, + _("You need to select the items " + "whose permissions you want to change")); return; } @@ -2046,11 +2071,11 @@ void action_chmod(FilerWindow *filer_window) return; add_toggle(gui_side, - "Brief - don't list processed files", "B"); + _("Brief - don't list processed files"), "B"); add_toggle(gui_side, - "Recurse - also change contents of subdirectories", "R"); + _("Recurse - also change contents of subdirectories"), "R"); hbox = gtk_hbox_new(FALSE, 0); - label = gtk_label_new("Command:"); + label = gtk_label_new(_("Command:")); gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, TRUE, 4); gui_side->default_string = &last_chmod_string; gui_side->entry = gtk_entry_new(); @@ -2061,13 +2086,13 @@ void action_chmod(FilerWindow *filer_window) gtk_signal_connect(GTK_OBJECT(gui_side->entry), "changed", entry_changed, gui_side); gtk_box_pack_start(GTK_BOX(gui_side->vbox), hbox, FALSE, TRUE, 0); - button = gtk_button_new_with_label("Show command reference"); + button = gtk_button_new_with_label(_("Show command reference")); gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, TRUE, 4); gtk_signal_connect_object(GTK_OBJECT(button), "clicked", show_chmod_help, NULL); gtk_window_set_focus(GTK_WINDOW(gui_side->window), gui_side->entry); - gtk_window_set_title(GTK_WINDOW(gui_side->window), "Permissions"); + gtk_window_set_title(GTK_WINDOW(gui_side->window), _("Permissions")); gtk_signal_connect_object(GTK_OBJECT(gui_side->entry), "activate", gtk_button_clicked, GTK_OBJECT(gui_side->yes)); @@ -2086,7 +2111,7 @@ void action_copy(GSList *paths, char *dest, char *leaf) if (!gui_side) return; - gtk_window_set_title(GTK_WINDOW(gui_side->window), "Copy"); + gtk_window_set_title(GTK_WINDOW(gui_side->window), _("Copy")); number_of_windows++; gtk_widget_show_all(gui_side->window); } @@ -2101,7 +2126,7 @@ void action_move(GSList *paths, char *dest) if (!gui_side) return; - gtk_window_set_title(GTK_WINDOW(gui_side->window), "Move"); + gtk_window_set_title(GTK_WINDOW(gui_side->window), _("Move")); number_of_windows++; gtk_widget_show_all(gui_side->window); } @@ -2116,7 +2141,7 @@ void action_link(GSList *paths, char *dest) if (!gui_side) return; - gtk_window_set_title(GTK_WINDOW(gui_side->window), "Link"); + gtk_window_set_title(GTK_WINDOW(gui_side->window), _("Link")); number_of_windows++; gtk_widget_show_all(gui_side->window); } diff --git a/ROX-Filer/src/dir.c b/ROX-Filer/src/dir.c index 4b46506a..2ed585db 100644 --- a/ROX-Filer/src/dir.c +++ b/ROX-Filer/src/dir.c @@ -87,7 +87,7 @@ void dir_attach(Directory *dir, DirCallback callback, gpointer data) start_scanning(dir, dir->pathname); if (dir->error) - delayed_error("ROX-Filer", dir->error); + delayed_error(PROJECT, dir->error); if (!dir->dir_handle) callback(dir, DIR_END_SCAN, NULL, data); @@ -282,7 +282,7 @@ static void start_scanning(Directory *dir, char *pathname) if (!dir->dir_handle) { - dir->error = g_strdup_printf("Can't open directory: %s", + dir->error = g_strdup_printf(_("Can't open directory: %s"), g_strerror(errno)); return; /* Report on attach */ } @@ -613,5 +613,5 @@ static void update(Directory *dir, gchar *pathname, gpointer data) start_scanning(dir, pathname); if (dir->error) - delayed_error("ROX-Filer", dir->error); + delayed_error(PROJECT, dir->error); } diff --git a/ROX-Filer/src/find.c b/ROX-Filer/src/find.c index 03e8cbc9..9e9052b0 100644 --- a/ROX-Filer/src/find.c +++ b/ROX-Filer/src/find.c @@ -470,7 +470,7 @@ static FindCondition *parse_case(guchar **expression) if (NEXT == '\0' || NEXT == ',' || NEXT == ')') return first; - (void) MATCH("And"); + (void) MATCH(_("And")); second = parse_case(expression); if (!second) @@ -494,7 +494,7 @@ static FindCondition *parse_condition(guchar **expression) SKIP; - if (NEXT == '!' || MATCH("Not")) + if (NEXT == '!' || MATCH(_("Not"))) { FindCondition *operand; @@ -537,7 +537,7 @@ static FindCondition *parse_condition(guchar **expression) return parse_match(expression); } - if (MATCH("system")) + if (MATCH(_("system"))) { SKIP; if (NEXT != '(') @@ -545,7 +545,7 @@ static FindCondition *parse_condition(guchar **expression) EAT; return parse_system(expression); } - else if (MATCH("prune")) + else if (MATCH(_("prune"))) { cond = g_new(FindCondition, 1); cond->test = test_prune; @@ -555,12 +555,10 @@ static FindCondition *parse_condition(guchar **expression) return cond; } - else if (g_strncasecmp(*expression, "Is", 2) == 0) - { - EAT; - EAT; - return parse_is(expression); - } + + cond = parse_is(expression); + if (cond) + return cond; return parse_comparison(expression); } @@ -631,9 +629,9 @@ static FindCondition *parse_comparison(guchar **expression) EAT; comp = COMP_NE; } - else if (MATCH("After")) + else if (MATCH(_("After"))) comp = COMP_GT; - else if (MATCH("Before")) + else if (MATCH(_("Before"))) comp = COMP_LT; else return NULL; @@ -656,42 +654,43 @@ static FindCondition *parse_comparison(guchar **expression) return cond; } +/* Returns NULL if expression is not an is-expression */ static FindCondition *parse_is(guchar **expression) { FindCondition *cond; IsTest test; - if (MATCH("Reg")) + if (MATCH(_("IsReg"))) test = IS_REG; - else if (MATCH("Link")) + else if (MATCH(_("IsLink"))) test = IS_LNK; - else if (MATCH("Dir")) + else if (MATCH(_("IsDir"))) test = IS_DIR; - else if (MATCH("Char")) + else if (MATCH(_("IsChar"))) test = IS_CHR; - else if (MATCH("Block")) + else if (MATCH(_("IsBlock"))) test = IS_BLK; - else if (MATCH("Dev")) + else if (MATCH(_("IsDev"))) test = IS_DEV; - else if (MATCH("Pipe")) + else if (MATCH(_("IsPipe"))) test = IS_FIFO; - else if (MATCH("Socket")) + else if (MATCH(_("IsSocket"))) test = IS_SOCK; - else if (MATCH("SUID")) + else if (MATCH(_("IsSUID"))) test = IS_SUID; - else if (MATCH("SGID")) + else if (MATCH(_("IsSGID"))) test = IS_SGID; - else if (MATCH("Sticky")) + else if (MATCH(_("IsSticky"))) test = IS_STICKY; - else if (MATCH("Readable")) + else if (MATCH(_("IsReadable"))) test = IS_READABLE; - else if (MATCH("Writeable")) + else if (MATCH(_("IsWriteable"))) test = IS_WRITEABLE; - else if (MATCH("Executable")) + else if (MATCH(_("IsExecutable"))) test = IS_EXEC; - else if (MATCH("Empty")) + else if (MATCH(_("IsEmpty"))) test = IS_EMPTY; - else if (MATCH("Mine")) + else if (MATCH(_("IsMine"))) test = IS_MINE; else return NULL; @@ -818,7 +817,7 @@ static Eval *parse_eval(guchar **expression) if (end == start) { - if (MATCH("Now")) + if (MATCH(_("Now"))) { value = 0; flags |= FLAG_HENCE; @@ -831,7 +830,7 @@ static Eval *parse_eval(guchar **expression) SKIP; - if (MATCH("Byte") || MATCH("Bytes")) + if (MATCH(_("Byte")) || MATCH(_("Bytes"))) ; else if (MATCH("Kb")) value <<= 10; @@ -839,17 +838,17 @@ static Eval *parse_eval(guchar **expression) value <<= 20; else if (MATCH("Gb")) value <<= 30; - else if (MATCH("Sec") || MATCH("Secs")) + else if (MATCH(_("Sec")) || MATCH(_("Secs"))) ; - else if (MATCH("Min") || MATCH("Mins")) + else if (MATCH(_("Min")) || MATCH(_("Mins"))) value *= 60; - else if (MATCH("Hour") || MATCH("Hours")) + else if (MATCH(_("Hour")) || MATCH(_("Hours"))) value *= 60 * 60; - else if (MATCH("Day") || MATCH("Days")) + else if (MATCH(_("Day")) || MATCH(_("Days"))) value *= 60 * 60 * 24; - else if (MATCH("Week") || MATCH("Weeks")) + else if (MATCH(_("Week")) || MATCH(_("Weeks"))) value *= 60 * 60 * 24 * 7; - else if (MATCH("Year") || MATCH("Years")) + else if (MATCH(_("Year")) || MATCH(_("Years"))) value *= 60 * 60 * 24 * 7 * 365.25; eval = g_new(Eval, 1); @@ -858,9 +857,9 @@ static Eval *parse_eval(guchar **expression) eval->data1 = g_memdup(&value, sizeof(value)); SKIP; - if (MATCH("Ago")) + if (MATCH(_("Ago"))) flags |= FLAG_AGO; - else if (MATCH("Hence")) + else if (MATCH(_("Hence"))) flags |= FLAG_HENCE; eval->data2 = (gpointer) flags; @@ -875,23 +874,23 @@ static Eval *parse_variable(guchar **expression) SKIP; - if (MATCH("atime")) + if (MATCH(_("atime"))) var = V_ATIME; - else if (MATCH("ctime")) + else if (MATCH(_("ctime"))) var = V_CTIME; - else if (MATCH("mtime")) + else if (MATCH(_("mtime"))) var = V_MTIME; - else if (MATCH("size")) + else if (MATCH(_("size"))) var = V_SIZE; - else if (MATCH("inode")) + else if (MATCH(_("inode"))) var = V_INODE; - else if (MATCH("nlinks")) + else if (MATCH(_("nlinks"))) var = V_NLINKS; - else if (MATCH("uid")) + else if (MATCH(_("uid"))) var = V_UID; - else if (MATCH("gid")) + else if (MATCH(_("gid"))) var = V_GID; - else if (MATCH("blocks")) + else if (MATCH(_("blocks"))) var = V_BLOCKS; else return NULL; diff --git a/ROX-Filer/src/gtksavebox.c b/ROX-Filer/src/gtksavebox.c index 2b172836..452535f4 100644 --- a/ROX-Filer/src/gtksavebox.c +++ b/ROX-Filer/src/gtksavebox.c @@ -316,7 +316,7 @@ button_press_over_icon (GtkWidget *drag_box, GdkEventButton *event, leafname = uri; } else - leafname = "Unnamed"; + leafname = _("Unnamed"); write_xds_property (context, leafname); @@ -386,8 +386,8 @@ drag_data_get (GtkWidget *widget, } else { - g_warning ("Remote application wants to use Direct Save, but I can't " - "read the XdndDirectSave0 (type text/plain) property.\n"); + g_warning (_("Remote application wants to use Direct Save, but I can't " + "read the XdndDirectSave0 (type text/plain) property.\n")); } if (to_send != 'E') @@ -555,8 +555,8 @@ static void do_save (GtkWidget *widget, GtkSavebox *savebox) dialog = gtk_dialog_new (); GTK_WINDOW (dialog)->type = GTK_WINDOW_DIALOG; - label = gtk_label_new ("Drag the icon to a directory viewer\n" - "(or enter a full pathname)"); + label = gtk_label_new (_("Drag the icon to a directory viewer\n" + "(or enter a full pathname)")); gtk_misc_set_padding (GTK_MISC (label), 8, 32); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), diff --git a/ROX-Filer/src/gui_support.c b/ROX-Filer/src/gui_support.c index 7536cf4c..4c64c42a 100644 --- a/ROX-Filer/src/gui_support.c +++ b/ROX-Filer/src/gui_support.c @@ -157,7 +157,7 @@ void report_error(char *title, char *message) g_return_if_fail(message != NULL); if (!title) - title = "Error"; + title = _("Error"); get_choice(title, message, 1, "OK"); } @@ -251,7 +251,7 @@ gboolean load_file(char *pathname, char **data_out, long *length_out) message = g_strdup_printf("open(%s): %s", pathname, g_strerror(errno)); - delayed_error("ROX-Filer", message); + delayed_error(PROJECT, message); g_free(message); return FALSE; } @@ -267,7 +267,7 @@ gboolean load_file(char *pathname, char **data_out, long *length_out) if (ferror(file)) { - delayed_error("Error reading file", + delayed_error(_("Error reading file"), g_strerror(errno)); g_free(buffer); } @@ -280,9 +280,9 @@ gboolean load_file(char *pathname, char **data_out, long *length_out) } } else - delayed_error("ROX-Filer", - "Can't allocate memory for buffer to " - "load this file"); + delayed_error(PROJECT, + _("Can't allocate memory for buffer to " + "load this file")); fclose(file); diff --git a/ROX-Filer/src/i18n.c b/ROX-Filer/src/i18n.c index 5acf0589..4700b73c 100644 --- a/ROX-Filer/src/i18n.c +++ b/ROX-Filer/src/i18n.c @@ -45,8 +45,9 @@ void i18n_init(void) { #ifdef HAVE_GETTEXT setlocale(LC_ALL, ""); - bindtextdomain("ROX-Filer", make_path(getenv("APP_DIR"), "po")->str); - textdomain("ROX-Filer"); + bindtextdomain(PROJECT, + make_path(getenv("APP_DIR"), "locale")->str); + textdomain(PROJECT); #endif } diff --git a/ROX-Filer/src/main.c b/ROX-Filer/src/main.c index db1b65e8..68cc36cb 100644 --- a/ROX-Filer/src/main.c +++ b/ROX-Filer/src/main.c @@ -66,28 +66,29 @@ char *home_dir; static void show_features(void); -#define VERSION "ROX-Filer 0.1.20\n" \ - "Copyright (C) 2000 Thomas Leonard.\n" \ +#define VERSION "ROX-Filer 0.1.20\n" +#define COPYING \ + N_("Copyright (C) 2000 Thomas Leonard.\n" \ "ROX-Filer comes with ABSOLUTELY NO WARRANTY,\n" \ "to the extent permitted by law.\n" \ "You may redistribute copies of ROX-Filer\n" \ "under the terms of the GNU General Public License.\n" \ "For more information about these matters, " \ - "see the file named COPYING.\n" + "see the file named COPYING.\n") #ifdef HAVE_GETOPT_LONG -# define USAGE "Try `ROX-Filer/AppRun --help' for more information.\n" +# define USAGE N_("Try `ROX-Filer/AppRun --help' for more information.\n") # define SHORT_ONLY_WARNING "" #else -# define USAGE "Try `ROX-Filer/AppRun -h' for more information.\n" +# define USAGE N_("Try `ROX-Filer/AppRun -h' for more information.\n") # define SHORT_ONLY_WARNING \ - "NOTE: Your system does not support long options - \n" \ - "you must use the short versions instead.\n\n" + _("NOTE: Your system does not support long options - \n" \ + "you must use the short versions instead.\n\n") #endif #define SHORT_OPS "t:b:ohv" -#define HELP "Usage: ROX-Filer/AppRun [OPTION]... [DIR]...\n" \ +#define HELP N_("Usage: ROX-Filer/AppRun [OPTION]... [DIR]...\n" \ "Open filer windows showing each directory listed, or $HOME \n" \ "if no directories are given.\n\n" \ " -h, --help display this help and exit\n" \ @@ -95,8 +96,7 @@ static void show_features(void); " -t, --top [DIR] open DIR as a top-edge panel\n" \ " -b, --bottom [DIR] open DIR as a bottom-edge panel\n" \ " -o, --override override window manager control of panels\n" \ - "\n" SHORT_ONLY_WARNING \ - "Report bugs to .\n" + "\nReport bugs to .\n") #ifdef HAVE_GETOPT_LONG static struct option long_opts[] = @@ -167,7 +167,7 @@ void stderr_cb(gpointer data, gint source, GdkInputCondition condition) window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_title(GTK_WINDOW(window), - "ROX-Filer message log"); + _("ROX-Filer message log")); gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER); gtk_window_set_default_size(GTK_WINDOW(window), 600, 300); gtk_signal_connect_object(GTK_OBJECT(window), "delete_event", @@ -240,10 +240,12 @@ int main(int argc, char **argv) break; case 'v': printf(VERSION); + printf(_(COPYING)); show_features(); return EXIT_SUCCESS; case 'h': - printf(HELP); + printf(_(HELP)); + printf(_(SHORT_ONLY_WARNING)); return EXIT_SUCCESS; case 't': case 'b': @@ -254,7 +256,7 @@ int main(int argc, char **argv) : optarg); break; default: - printf(USAGE); + printf(_(USAGE)); return EXIT_FAILURE; } } @@ -297,11 +299,11 @@ int main(int argc, char **argv) if (euid == 0) { - if (get_choice("!!!DANGER!!!", - "Running ROX-Filer as root is VERY dangerous. If I " + if (get_choice(_("!!!DANGER!!!"), + _("Running ROX-Filer as root is VERY dangerous. If I " "had a warranty (I don't) then doing this would " - "void it", 2, - "Don't click here", "Quit") != 0) + "void it"), 2, + _("Don't click here"), _("Quit")) != 0) exit(EXIT_SUCCESS); } diff --git a/ROX-Filer/src/menu.c b/ROX-Filer/src/menu.c index 6c785f14..77321322 100644 --- a/ROX-Filer/src/menu.c +++ b/ROX-Filer/src/menu.c @@ -335,17 +335,18 @@ static GtkWidget *create_options() table = gtk_table_new(2, 2, FALSE); gtk_container_set_border_width(GTK_CONTAINER(table), 4); - label = gtk_label_new("To set the keyboard short-cuts you simply open " + label = gtk_label_new( + _("To set the keyboard short-cuts you simply open " "the menu over a filer window, move the pointer over " "the item you want to use and press a key. The key " "will appear next to the menu item and you can just " "press that key without opening the menu in future. " "To save the current menu short-cuts for next time, " - "click the Save button at the bottom of this window."); + "click the Save button at the bottom of this window.")); gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 2, 0, 1); - label = gtk_label_new("'Xterm here' program:"); + label = gtk_label_new(_("'Xterm here' program:")); gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 1, 2); xterm_here_entry = gtk_entry_new(); gtk_table_attach_defaults(GTK_TABLE(table), xterm_here_entry, @@ -377,7 +378,7 @@ static void save_options() { char *menurc; - menurc = choices_find_path_save("menus", "ROX-Filer", TRUE); + menurc = choices_find_path_save("menus", PROJECT, TRUE); if (menurc) gtk_item_factory_dump_rc(menurc, NULL, TRUE); @@ -489,7 +490,7 @@ void show_filer_menu(FilerWindow *filer_window, GdkEventButton *event, switch (collection->number_selected) { case 0: - g_string_assign(buffer, "Next Click"); + g_string_assign(buffer, _("Next Click")); items_sensitive(TRUE); break; case 1: @@ -502,7 +503,7 @@ void show_filer_menu(FilerWindow *filer_window, GdkEventButton *event, break; default: items_sensitive(FALSE); - g_string_sprintf(buffer, "%d items", + g_string_sprintf(buffer, _("%d items"), collection->number_selected); break; } @@ -649,8 +650,8 @@ static void remove_link(gpointer data, guint action, GtkWidget *widget) if (window_with_focus->collection->number_selected > 1) { - report_error("ROX-Filer", "You can only remove one link " - "at a time"); + report_error(PROJECT, + _("You can only remove one link at a time")); return; } else if (window_with_focus->collection->number_selected == 0) @@ -666,13 +667,13 @@ static void remove_link(gpointer data, guint action, GtkWidget *widget) path = make_path(window_with_focus->path, item->leafname)->str; if (lstat(path, &info)) - report_error("ROX-Filer", g_strerror(errno)); + report_error(PROJECT, g_strerror(errno)); else if (!S_ISLNK(info.st_mode)) - report_error("ROX-Filer", - "You can only remove symbolic links this way - " - "try the 'Open Panel as Directory' item."); + report_error(PROJECT, + _("You can only remove symbolic links this way - " + "try the 'Open Panel as Directory' item.")); else if (unlink(path)) - report_error("ROX-Filer", g_strerror(errno)); + report_error(PROJECT, g_strerror(errno)); else filer_update_dir(window_with_focus, TRUE); } @@ -751,7 +752,7 @@ static gboolean copy_cb(guchar *current, guchar *new) if (new[0] != '/') { - report_error("ROX-Filer", "New pathname is not absolute"); + report_error(PROJECT, _("New pathname is not absolute")); return FALSE; } @@ -796,14 +797,14 @@ static void copy_item(gpointer data, guint action, GtkWidget *widget) collection = window_with_focus->collection; if (collection->number_selected > 1) { - report_error("ROX-Filer", "You cannot do this to more than " - "one item at a time"); + report_error(PROJECT, _("You cannot do this to more than " + "one item at a time")); return; } else if (collection->number_selected != 1) collection_target(collection, target_callback, copy_item); else - SHOW_SAVEBOX("Copy", copy_cb); + SHOW_SAVEBOX(_("Copy"), copy_cb); } static gboolean rename_cb(guchar *current, guchar *new) @@ -825,14 +826,14 @@ static void rename_item(gpointer data, guint action, GtkWidget *widget) collection = window_with_focus->collection; if (collection->number_selected > 1) { - report_error("ROX-Filer", "You cannot do this to more than " - "one item at a time"); + report_error(PROJECT, _("You cannot do this to more than " + "one item at a time")); return; } else if (collection->number_selected != 1) collection_target(collection, target_callback, rename_item); else - SHOW_SAVEBOX("Rename", rename_cb); + SHOW_SAVEBOX(_("Rename"), rename_cb); } static gboolean link_cb(guchar *initial, guchar *path) @@ -854,14 +855,14 @@ static void link_item(gpointer data, guint action, GtkWidget *widget) collection = window_with_focus->collection; if (collection->number_selected > 1) { - report_error("ROX-Filer", "You cannot do this to more than " - "one item at a time"); + report_error(PROJECT, _("You cannot do this to more than " + "one item at a time")); return; } else if (collection->number_selected != 1) collection_target(collection, target_callback, link_item); else - SHOW_SAVEBOX("Symlink", link_cb); + SHOW_SAVEBOX(_("Symlink"), link_cb); } static void open_file(gpointer data, guint action, GtkWidget *widget) @@ -873,8 +874,8 @@ static void open_file(gpointer data, guint action, GtkWidget *widget) collection = window_with_focus->collection; if (collection->number_selected > 1) { - report_error("ROX-Filer", "You cannot do this to more than " - "one item at a time"); + report_error(PROJECT, _("You cannot do this to more than " + "one item at a time")); return; } else if (collection->number_selected != 1) @@ -901,7 +902,7 @@ static void add_file_output(FileStatus *fs, close(source); fs->fd = -1; if (got < 0) - delayed_error("ROX-Filer: file(1) says...", + delayed_error(_("ROX-Filer: file(1) says..."), g_strerror(err)); return; } @@ -939,7 +940,7 @@ guchar *pretty_type(DirItem *file, guchar *path) file->mime_type->subtype, NULL); if (file->flags & ITEM_FLAG_APPDIR) - return g_strdup("ROX application"); + return g_strdup(_("ROX application")); if (file->flags & ITEM_FLAG_SYMLINK) { @@ -949,10 +950,10 @@ guchar *pretty_type(DirItem *file, guchar *path) if (got > 0 && got <= MAXPATHLEN) { p[got] = '\0'; - return g_strconcat("Symbolic link to ", p, NULL); + return g_strconcat(_("Symbolic link to "), p, NULL); } - return g_strdup("Symbolic link"); + return g_strdup(_("Symbolic link")); } if (file->flags & ITEM_FLAG_MOUNT_POINT) @@ -960,16 +961,17 @@ guchar *pretty_type(DirItem *file, guchar *path) MountPoint *mp; if ((file->flags & ITEM_FLAG_MOUNTED) && (mp = g_hash_table_lookup(mtab_mounts, path))) - return g_strconcat("Mount point for ", mp->name, NULL); + return g_strconcat(_("Mount point for "), + mp->name, NULL); - return g_strdup("Mount point"); + return g_strdup(_("Mount point")); } return g_strdup("-"); } #define LABEL(text, row) \ - label = gtk_label_new(text ":"); \ + label = gtk_label_new(text); \ gtk_misc_set_alignment(GTK_MISC(label), 1, .5); \ gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_RIGHT); \ gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, row, row + 1); @@ -997,8 +999,8 @@ static void show_file_info(gpointer data, guint action, GtkWidget *widget) collection = window_with_focus->collection; if (collection->number_selected > 1) { - report_error("ROX-Filer", "You cannot do this to more than " - "one item at a time"); + report_error(PROJECT, _("You cannot do this to more than " + "one item at a time")); return; } else if (collection->number_selected != 1) @@ -1011,7 +1013,7 @@ static void show_file_info(gpointer data, guint action, GtkWidget *widget) file->leafname)->str; if (lstat(path, &info)) { - delayed_error("ROX-Filer", g_strerror(errno)); + delayed_error(PROJECT, g_strerror(errno)); return; } @@ -1028,41 +1030,40 @@ static void show_file_info(gpointer data, guint action, GtkWidget *widget) gtk_table_set_col_spacings(GTK_TABLE(table), 4); value = gtk_label_new(file->leafname); - LABEL("Name", 0); + LABEL(_("Name:"), 0); VALUE(value, 0); g_string_sprintf(gstring, "%s, %s", user_name(info.st_uid), group_name(info.st_gid)); value = gtk_label_new(gstring->str); - LABEL("Owner, Group", 1); + LABEL(_("Owner, Group:"), 1); VALUE(value, 1); if (info.st_size >= PRETTY_SIZE_LIMIT) { - g_string_sprintf(gstring, "%s (%ld bytes)", + g_string_sprintf(gstring, "%s (%ld %s)", format_size((unsigned long) info.st_size), - (unsigned long) info.st_size); + (unsigned long) info.st_size, _("bytes")); } else { - g_string_sprintf(gstring, "%ld byte%s", - (unsigned long) info.st_size, - info.st_size == 1 ? "" : "s"); + g_string_assign(gstring, + format_size((unsigned long) info.st_size)); } value = gtk_label_new(gstring->str); - LABEL("Size", 2); + LABEL(_("Size:"), 2); VALUE(value, 2); value = gtk_label_new(pretty_time(&info.st_ctime)); - LABEL("Change time", 3); + LABEL(_("Change time:"), 3); VALUE(value, 3); value = gtk_label_new(pretty_time(&info.st_mtime)); - LABEL("Modify time", 4); + LABEL(_("Modify time:"), 4); VALUE(value, 4); value = gtk_label_new(pretty_time(&info.st_atime)); - LABEL("Access time", 5); + LABEL(_("Access time:"), 5); VALUE(value, 5); value = gtk_label_new(pretty_permissions(info.st_mode)); @@ -1072,23 +1073,23 @@ static void show_file_info(gpointer data, guint action, GtkWidget *widget) perm == 1 ? " ___ " : " ___"); gtk_widget_set_style(value, fixed_style); - LABEL("Permissions", 6); + LABEL(_("Permissions:"), 6); VALUE(value, 6); tmp = pretty_type(file, path); value = gtk_label_new(tmp); g_free(tmp); - LABEL("Type", 7); + LABEL(_("Type:"), 7); VALUE(value, 7); - frame = gtk_frame_new("file(1) says..."); + frame = gtk_frame_new(_("file(1) says...")); gtk_table_attach_defaults(GTK_TABLE(table), frame, 0, 2, 8, 9); - file_label = gtk_label_new(""); + file_label = gtk_label_new(_("")); gtk_misc_set_padding(GTK_MISC(file_label), 4, 4); gtk_label_set_line_wrap(GTK_LABEL(file_label), TRUE); gtk_container_add(GTK_CONTAINER(frame), file_label); - button = gtk_button_new_with_label("OK"); + button = gtk_button_new_with_label(_("OK")); gtk_window_set_focus(GTK_WINDOW(window), button); gtk_table_attach(GTK_TABLE(table), button, 0, 2, 10, 11, GTK_EXPAND | GTK_FILL | GTK_SHRINK, 0, 40, 4); @@ -1153,11 +1154,11 @@ static void app_show_help(char *path) help_dir = g_strconcat(path, "/Help", NULL); if (mc_stat(help_dir, &info)) - delayed_error("Application", - "This is an application directory - you can " + delayed_error(_("Application"), + _("This is an application directory - you can " "run it as a program, or open it (hold down " "Shift while you open it). Most applications provide " - "their own help here, but this one doesn't."); + "their own help here, but this one doesn't.")); else filer_opendir(help_dir, PANEL_NO); } @@ -1172,8 +1173,8 @@ static void help(gpointer data, guint action, GtkWidget *widget) collection = window_with_focus->collection; if (collection->number_selected > 1) { - report_error("ROX-Filer", "You cannot do this to more than " - "one item at a time"); + report_error(PROJECT, _("You cannot do this to more than " + "one item at a time")); return; } else if (collection->number_selected != 1) @@ -1186,13 +1187,13 @@ static void help(gpointer data, guint action, GtkWidget *widget) { case TYPE_FILE: if (item->flags & ITEM_FLAG_EXEC_FILE) - delayed_error("Executable file", - "This is a file with an eXecute bit " - "set - it can be run as a program."); + delayed_error(_("Executable file"), + _("This is a file with an eXecute bit " + "set - it can be run as a program.")); else - delayed_error("File", + delayed_error(_("File"), _( "This is a data file. Try using the " - "Info menu item to find out more..."); + "Info menu item to find out more...")); break; case TYPE_DIRECTORY: if (item->flags & ITEM_FLAG_APPDIR) @@ -1200,39 +1201,39 @@ static void help(gpointer data, guint action, GtkWidget *widget) make_path(window_with_focus->path, item->leafname)->str); else if (item->flags & ITEM_FLAG_MOUNT_POINT) - delayed_error("Mount point", + delayed_error(_("Mount point"), _( "A mount point is a directory which another " "filing system can be mounted on. Everything " "on the mounted filesystem then appears to be " - "inside the directory."); + "inside the directory.")); else - delayed_error("Directory", + delayed_error(_("Directory"), _( "This is a directory. It contains an index to " - "other items - open it to see the list."); + "other items - open it to see the list.")); break; case TYPE_CHAR_DEVICE: case TYPE_BLOCK_DEVICE: - delayed_error("Device file", + delayed_error(_("Device file"), _( "Device files allow you to read from or write " "to a device driver as though it was an " - "ordinary file."); + "ordinary file.")); break; case TYPE_PIPE: - delayed_error("Named pipe", + delayed_error(_("Named pipe"), _( "Pipes allow different programs to " "communicate. One program writes data to the " - "pipe while another one reads it out again."); + "pipe while another one reads it out again.")); break; case TYPE_SOCKET: - delayed_error("Socket", - "Sockets allow processes to communicate."); + delayed_error(_("Socket"), _( + "Sockets allow processes to communicate.")); break; default: - delayed_error("Unknown type", + delayed_error(_("Unknown type"), _( "I couldn't find out what kind of file this " "is. Maybe it doesn't exist anymore or you " "don't have search permission on the directory " - "it's in?"); + "it's in?")); break; } } @@ -1259,8 +1260,8 @@ static void real_vfs_open(char *fs) if (window_with_focus->collection->number_selected != 1) { - report_error("ROX-Filer", "You must select a single file " - "to open as a Virtual File System"); + report_error(PROJECT, _("You must select a single file " + "to open as a Virtual File System")); return; } @@ -1316,8 +1317,8 @@ static void new_directory(gpointer data, guint action, GtkWidget *widget) { g_return_if_fail(window_with_focus != NULL); - savebox_show("New Directory", - make_path(window_with_focus->path, "NewDir")->str, + savebox_show(_("New Directory"), + make_path(window_with_focus->path, _("NewDir"))->str, default_pixmap[TYPE_DIRECTORY], new_directory_cb); } @@ -1331,7 +1332,7 @@ static void xterm_here(gpointer data, guint action, GtkWidget *widget) g_return_if_fail(window_with_focus != NULL); if (!spawn_full(argv, window_with_focus->path)) - report_error("ROX-Filer", "Failed to fork() child " + report_error(PROJECT, "Failed to fork() child " "process"); } @@ -1372,9 +1373,9 @@ static void new_window(gpointer data, guint action, GtkWidget *widget) g_return_if_fail(window_with_focus != NULL); if (o_unique_filer_windows) - report_error("ROX-Filer", "You can't open a second view onto " + report_error(PROJECT, _("You can't open a second view onto " "this directory because the `Unique Windows' option " - "is turned on in the Options window."); + "is turned on in the Options window.")); else filer_opendir(window_with_focus->path, PANEL_NO); } diff --git a/ROX-Filer/src/minibuffer.c b/ROX-Filer/src/minibuffer.c index e1eabdd4..df389603 100644 --- a/ROX-Filer/src/minibuffer.c +++ b/ROX-Filer/src/minibuffer.c @@ -566,8 +566,8 @@ static void shell_return_pressed(FilerWindow *filer_window, GdkEventKey *event) switch (child) { case -1: - delayed_error("ROX-Filer", "Failed to create " - "child process"); + delayed_error(PROJECT, _("Failed to create " + "child process")); break; case 0: /* Child */ dup2(to_error_log, STDOUT_FILENO); diff --git a/ROX-Filer/src/options.c b/ROX-Filer/src/options.c index a0a01185..146464a1 100644 --- a/ROX-Filer/src/options.c +++ b/ROX-Filer/src/options.c @@ -55,7 +55,7 @@ void options_init() window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER); - gtk_window_set_title(GTK_WINDOW(window), "ROX-Filer options"); + gtk_window_set_title(GTK_WINDOW(window), _("ROX-Filer options")); gtk_signal_connect(GTK_OBJECT(window), "delete_event", GTK_SIGNAL_FUNC(hide_dialog_event), window); gtk_container_set_border_width(GTK_CONTAINER(window), 4); @@ -79,41 +79,41 @@ void options_init() sections_vbox = gtk_vbox_new(FALSE, 4); gtk_container_add(GTK_CONTAINER(border), sections_vbox); - save_path = choices_find_path_save("...", "ROX-Filer", FALSE); + save_path = choices_find_path_save("...", PROJECT, FALSE); if (save_path) { - string = g_strconcat("Choices will be saved as ", + string = g_strconcat(_("Choices will be saved as "), save_path, NULL); label = gtk_label_new(string); g_free(string); } else - label = gtk_label_new("Choices saving is disabled by " - "CHOICESPATH variable"); + label = gtk_label_new(_("Choices saving is disabled by " + "CHOICESPATH variable")); gtk_box_pack_start(GTK_BOX(tl_vbox), label, FALSE, TRUE, 0); actions = gtk_hbox_new(TRUE, 16); gtk_box_pack_start(GTK_BOX(tl_vbox), actions, FALSE, TRUE, 0); - button = gtk_button_new_with_label("Save"); + button = gtk_button_new_with_label(_("Save")); gtk_box_pack_start(GTK_BOX(actions), button, FALSE, TRUE, 0); if (!save_path) gtk_widget_set_sensitive(button, FALSE); gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(save_options), (gpointer) BUTTON_SAVE); - button = gtk_button_new_with_label("OK"); + button = gtk_button_new_with_label(_("OK")); gtk_box_pack_start(GTK_BOX(actions), button, FALSE, TRUE, 0); gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(save_options), (gpointer) BUTTON_OK); - button = gtk_button_new_with_label("Apply"); + button = gtk_button_new_with_label(_("Apply")); gtk_box_pack_start(GTK_BOX(actions), button, FALSE, TRUE, 0); gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(save_options), (gpointer) BUTTON_APPLY); - button = gtk_button_new_with_label("Cancel"); + button = gtk_button_new_with_label(_("Cancel")); gtk_box_pack_start(GTK_BOX(actions), button, FALSE, TRUE, 0); gtk_signal_connect_object(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(gtk_widget_hide), GTK_OBJECT(window)); @@ -144,7 +144,7 @@ void options_load(void) need_init = FALSE; } - path = choices_find_path_load("options", "ROX-Filer"); + path = choices_find_path_load("options", PROJECT); if (!path) return; /* Nothing to load */ @@ -177,16 +177,14 @@ void parse_file(char *path, ParseFunc *parse_line) message = g_string_new(NULL); g_string_sprintf(message, - "Error in options file at line %d: " - "\n\"%s\"\n" - "This may be due to upgrading from " - "a previous version of ROX-Filer. " - "Open the Options window and click " - "on Save.\n" - "Further errors will be ignored.", + _("Error in options file at line %d: " + "\n\"%s\"\n" + "This may be due to upgrading from a previous version of " + "ROX-Filer. Open the Options window and click on Save.\n" + "Further errors will be ignored."), line_number, error); - delayed_error("ROX-Filer", message->str); + delayed_error(PROJECT, message->str); g_string_free(message, TRUE); seen_error = TRUE; } @@ -225,7 +223,7 @@ static char *process_option_line(guchar *line) eq = strchr(line, '='); if (!eq) - return "Missing '='"; + return _("Missing '='"); c = eq - 1; while (c > line && (*c == ' ' || *c == '\t')) @@ -237,7 +235,7 @@ static char *process_option_line(guchar *line) func = (OptionFunc *) g_hash_table_lookup(option_hash, line); if (!func) - return "Unknown option"; + return _("Unknown option"); return func(c); } @@ -258,18 +256,17 @@ static void save_options(GtkWidget *widget, gpointer data) { char *path; - path = choices_find_path_save("options", "ROX-Filer", TRUE); + path = choices_find_path_save("options", PROJECT, TRUE); g_return_if_fail(path != NULL); save_file = fopen(path, "wb"); if (!save_file) { char *str; - str = g_strconcat("Unable to open '", path, - "' for writing: ", - g_strerror(errno), - NULL); - report_error("ROX-Filer", str); + str = g_strdup_printf( + _("Unable to open '%s' for writing: %s"), + path, g_strerror(errno)); + report_error(PROJECT, str); g_free(str); return; } @@ -284,7 +281,7 @@ static void save_options(GtkWidget *widget, gpointer data) if (save_file && fclose(save_file) == EOF) { - report_error("ROX-Filer", g_strerror(errno)); + report_error(PROJECT, g_strerror(errno)); return; } } @@ -322,7 +319,7 @@ void option_write(char *name, char *value) len = strlen(string); if (fwrite(string, sizeof(char), len, save_file) < len) { - delayed_error("Saving options", g_strerror(errno)); + delayed_error(_("Saving options"), g_strerror(errno)); fclose(save_file); save_file = NULL; } diff --git a/ROX-Filer/src/po/make-mo b/ROX-Filer/src/po/make-mo index f2e41314..4089dc6a 100755 --- a/ROX-Filer/src/po/make-mo +++ b/ROX-Filer/src/po/make-mo @@ -1,7 +1,7 @@ #!/bin/sh if [ $# = 1 ]; then - DIR=../../po/$1 + DIR=../../locale/$1 if [ ! -d $DIR ]; then mkdir $DIR fi diff --git a/ROX-Filer/src/run.c b/ROX-Filer/src/run.c index f79253af..c6bcee4b 100644 --- a/ROX-Filer/src/run.c +++ b/ROX-Filer/src/run.c @@ -62,7 +62,7 @@ void run_app(char *path) argv[0] = g_string_append(apprun, "/AppRun")->str; if (!spawn_full(argv, home_dir)) - report_error("ROX-Filer", "Failed to fork() child process"); + report_error(PROJECT, "Failed to fork() child process"); g_string_free(apprun, TRUE); } @@ -79,7 +79,7 @@ void run_with_files(char *path, GSList *uri_list) if (stat(path, &info)) { - delayed_error("ROX-Filer", "Program not found - deleted?"); + delayed_error(PROJECT, _("Program not found - deleted?")); return; } @@ -106,7 +106,7 @@ void run_with_files(char *path, GSList *uri_list) argv[argc++] = NULL; if (!spawn_full(argv, home_dir)) - delayed_error("ROX-Filer", "Failed to fork() child process"); + delayed_error(PROJECT, _("Failed to fork() child process")); } /* Run the program as ' -', piping the data to it via stdin. @@ -121,7 +121,7 @@ void run_with_data(char *path, gpointer data, gulong length) if (stat(path, &info)) { - delayed_error("ROX-Filer", "Program not found - deleted?"); + delayed_error(PROJECT, _("Program not found - deleted?")); return; } @@ -196,7 +196,7 @@ static void write_data(gpointer data, gint fd, GdkInputCondition cond) { if (errno == EAGAIN) return; - delayed_error("ROX-Filer - Sending data to program", + delayed_error(_("ROX-Filer - Sending data to program"), g_strerror(errno)); goto finish; } diff --git a/ROX-Filer/src/support.c b/ROX-Filer/src/support.c index 7dc5f9c6..aaf85edc 100644 --- a/ROX-Filer/src/support.c +++ b/ROX-Filer/src/support.c @@ -219,7 +219,7 @@ char *format_size(unsigned long size) units = "K"; } else - units = "bytes"; + units = _("bytes"); if (buffer) g_free(buffer); @@ -502,7 +502,7 @@ err: mc_close(read_fd); if (write_fd != -1) mc_close(write_fd); - return error ? g_strerror(error) : "Copy error"; + return error ? g_strerror(error) : _("Copy error"); } #endif @@ -510,7 +510,7 @@ err: argv[3] = to; if (fork_exec_wait(argv)) - return "Copy failed"; + return _("Copy failed"); return NULL; } diff --git a/ROX-Filer/src/type.c b/ROX-Filer/src/type.c index 95c170f0..5a749531 100644 --- a/ROX-Filer/src/type.c +++ b/ROX-Filer/src/type.c @@ -125,7 +125,7 @@ static char *import_extensions(guchar *line) if (isspace(*line)) { if (!current_type) - return "Missing MIME-type"; + return _("Missing MIME-type"); while (*line && isspace(*line)) line++; @@ -160,7 +160,7 @@ static char *import_extensions(guchar *line) while (*line && isspace(*line)) line++; if (*line) - return "Trailing chars after MIME-type"; + return _("Trailing chars after MIME-type"); current_type = g_strdup(type); } return NULL; @@ -169,29 +169,29 @@ static char *import_extensions(guchar *line) char *basetype_name(DirItem *item) { if (item->flags & ITEM_FLAG_SYMLINK) - return "Sym link"; + return _("Sym link"); else if (item->flags & ITEM_FLAG_MOUNT_POINT) - return "Mount point"; + return _("Mount point"); else if (item->flags & ITEM_FLAG_APPDIR) - return "App dir"; + return _("App dir"); switch (item->base_type) { case TYPE_FILE: - return "File"; + return _("File"); case TYPE_DIRECTORY: - return "Dir"; + return _("Dir"); case TYPE_CHAR_DEVICE: - return "Char dev"; + return _("Char dev"); case TYPE_BLOCK_DEVICE: - return "Block dev"; + return _("Block dev"); case TYPE_PIPE: - return "Pipe"; + return _("Pipe"); case TYPE_SOCKET: - return "Socket"; + return _("Socket"); } - return "Unknown"; + return _("Unknown"); } /* MIME-type guessing */ @@ -240,7 +240,7 @@ gboolean type_open(char *path, MIME_type *type) if (stat(open, &info)) { - report_error("ROX-Filer", g_strerror(errno)); + report_error(PROJECT, g_strerror(errno)); return FALSE; } @@ -251,8 +251,8 @@ gboolean type_open(char *path, MIME_type *type) if (!spawn_full(argv, home_dir)) { - report_error("ROX-Filer", - "Failed to fork() child process"); + report_error(PROJECT, + _("Failed to fork() child process")); retval = FALSE; } -- 2.11.4.GIT