Following octavio's and luis's indications, i checked out branches/0.3 .
I started addicting the remaining _() in splashy_config-functions.c and
splashy_config-main.c , just to send you the diff and actually see if
this is the way to go. When you accept these small patches, i'll provide
the rest of it.
--
Best Regards,
--
Luis Matos
Index: src/splashy_config-functions.c
===================================================================
--- src/splashy_config-functions.c (revisão 1156)
+++ src/splashy_config-functions.c (cópia de trabalho)
@@ -110,13 +110,13 @@
magic_t cookie = magic_open (MAGIC_NONE);
if (cookie == NULL)
{
- printf ("ERROR: out of memory\n");
+ printf (_("ERROR: out of memory\n"));
return;
}
if (magic_load (cookie, NULL) == -1)
{
- printf ("ERROR: %s\n", magic_error (cookie));
+ printf (_("ERROR: %s\n"), magic_error (cookie));
return;
}
@@ -132,7 +132,7 @@
}
else
{
- if (g_strncasecmp (mime_type, "POSIX tar archive", 17)
+ if (g_strncasecmp (mime_type, _("POSIX tar archive"), 17)
!= 0)
{
PRINT_FAIL;
@@ -305,7 +305,7 @@
}
else
{
- DEBUG_PRINT ("splashy_config: Reading files from %s \n",
+ DEBUG_PRINT (_("splashy_config: Reading files from %s \n"),
path->str);
GError *ErrorDir = NULL;
GDir *_dir = g_dir_open (path->str, 0, &ErrorDir);
@@ -323,7 +323,7 @@
g_string_assign (buf, path->str);
g_string_append (buf, G_DIR_SEPARATOR_S);
g_string_append (buf, file);
- DEBUG_PRINT ("splashy_config: Removing file %s \n",
+ DEBUG_PRINT (_("splashy_config: Removing file %s \n"),
buf->str);
if (remove (buf->str) != 0)
@@ -355,13 +355,13 @@
information (void)
{
g_print (_(">Theme currently used:\n"));
- g_print (" %s\n",
+ g_print (_(" %s\n"),
splashy_get_config_string ("/splashy/current_theme"));
- g_print (" version %s\n",
+ g_print (_(" version %s\n"),
splashy_get_config_string ("/splashy/info/version"));
g_print (" %s\n",
splashy_get_config_string ("/splashy/info/description"));
- g_print (" URLs %s\n",
+ g_print (_(" URLs %s\n"),
splashy_get_config_string ("/splashy/info/urls"));
g_print (_(" by %s\n"),
splashy_get_config_string ("/splashy/info/author"));
@@ -370,7 +370,7 @@
const gchar *_theme = NULL;
const gchar *themes_dir = splashy_get_config_string (SPL_THEMES_DIR);
- DEBUG_PRINT ("splashy_config: Reading themes from %s \n", themes_dir);
+ DEBUG_PRINT (_("splashy_config: Reading themes from %s \n"), themes_dir);
GError *ErrorDir = NULL;
GDir *_dir = g_dir_open (themes_dir, 0, &ErrorDir);
if (ErrorDir != NULL)
@@ -385,7 +385,7 @@
gchar *_theme_config = g_build_filename (themes_dir, _theme,
SPL_THEME_CONFIG_FILE_NAME,
NULL);
- DEBUG_PRINT ("splashy_config: testing theme dir %s\n",
+ DEBUG_PRINT (_("splashy_config: testing theme dir %s\n"),
_theme_config);
if (g_file_test (_theme_config, G_FILE_TEST_IS_REGULAR))
{
@@ -433,7 +433,7 @@
// Check if a theme with the same name exists
DEBUG_PRINT
- ("splashy_config: Checking if '%s' already exists\n",
+ (_("splashy_config: Checking if '%s' already exists\n"),
theme_path);
if (g_strcasecmp
(theme_path, splashy_get_config_string (SPL_THEMES_DIR)) != 0)
@@ -450,20 +450,20 @@
magic_t cookie = magic_open (MAGIC_MIME);
if (cookie == NULL)
{
- printf ("ERROR: out of memory\n");
+ printf (_("ERROR: out of memory\n"));
return;
}
if (magic_load (cookie, NULL) == -1)
{
- printf ("ERROR: %s\n", magic_error (cookie));
+ printf (_("ERROR: %s\n"), magic_error (cookie));
return;
}
// Check if bg_boot is an existing file
DEBUG_PRINT
- ("splashy_config: Checking if the boot image '%s' exists\n",
+ (_("splashy_config: Checking if the boot image '%s' exists\n"),
NewTheme->bg_boot);
if (!g_file_test (NewTheme->bg_boot, G_FILE_TEST_EXISTS))
{
@@ -475,19 +475,19 @@
{
mime_type = magic_file (cookie, NewTheme->bg_boot);
DEBUG_PRINT
- ("splashy_config: Checking the boot image mime type: %s",
+ (_("splashy_config: Checking the boot image mime type: %s"),
mime_type);
if (g_strncasecmp (mime_type, "image/", 6) != 0)
{
PRINT_FAIL;
- g_print ("The boot image don't seem to be an image\n");
+ g_print (_("The boot image don't seem to be an image\n"));
return;
}
}
// Check if bg_shutdown is an existing file
DEBUG_PRINT
- ("splashy_config: Checking if the shutdown image '%s' exists\n",
+ (_("splashy_config: Checking if the shutdown image '%s' exists\n"),
NewTheme->bg_shutdown);
if (!g_file_test (NewTheme->bg_shutdown, G_FILE_TEST_EXISTS))
{
@@ -501,19 +501,19 @@
mime_type =
magic_file (cookie, NewTheme->bg_shutdown);
DEBUG_PRINT
- ("splashy_config: Checking the shutdown image mime type: %s",
+ (_("splashy_config: Checking the shutdown image mime type: %s"),
mime_type);
if (g_strncasecmp (mime_type, "image/", 6) != 0)
{
PRINT_FAIL;
- g_print ("The shutdown image don't seem to be an image\n");
+ g_print (_("The shutdown image don't seem to be an image\n"));
return;
}
}
// Check if bg_error is an existing file
DEBUG_PRINT
- ("splashy_config: Checking if the error image '%s' exists\n",
+ (_("splashy_config: Checking if the error image '%s' exists\n"),
NewTheme->bg_error);
if (!g_file_test (NewTheme->bg_error, G_FILE_TEST_EXISTS))
{
@@ -525,19 +525,19 @@
{
mime_type = magic_file (cookie, NewTheme->bg_error);
DEBUG_PRINT
- ("splashy_config: Checking the error image mime type: %s",
+ (_("splashy_config: Checking the error image mime type: %s"),
mime_type);
if (g_strncasecmp (mime_type, "image/", 6) != 0)
{
PRINT_FAIL;
- g_print ("The error image don't seem to be an image\n");
+ g_print (_("The error image don't seem to be an image\n"));
return;
}
}
// Check if bg_resume is an existing file
DEBUG_PRINT
- ("splashy_config: Checking if the resume image '%s' exists\n",
+ (_("splashy_config: Checking if the resume image '%s' exists\n"),
NewTheme->bg_resume);
if (!g_file_test (NewTheme->bg_resume, G_FILE_TEST_EXISTS))
{
@@ -549,19 +549,19 @@
{
mime_type = magic_file (cookie, NewTheme->bg_resume);
DEBUG_PRINT
- ("splashy_config: Checking the resume image mime type: %s",
+ (_("splashy_config: Checking the resume image mime type: %s"),
mime_type);
if (g_strncasecmp (mime_type, "image/", 6) != 0)
{
PRINT_FAIL;
- g_print ("The resume image don't seem to be an image\n");
+ g_print (_("The resume image don't seem to be an image\n"));
return;
}
}
// Check if bg_suspend is an existing file
DEBUG_PRINT
- ("splashy_config: Checking if the suspend image '%s' exists\n",
+ (_("splashy_config: Checking if the suspend image '%s' exists\n"),
NewTheme->bg_suspend);
if (!g_file_test (NewTheme->bg_suspend, G_FILE_TEST_EXISTS))
{
@@ -573,12 +573,12 @@
{
mime_type = magic_file (cookie, NewTheme->bg_suspend);
DEBUG_PRINT
- ("splashy_config: Checking the suspend image mime type: %s",
+ (_("splashy_config: Checking the suspend image mime type: %s"),
mime_type);
if (g_strncasecmp (mime_type, "image/", 6) != 0)
{
PRINT_FAIL;
- g_print ("The suspend image don't seem to be an image\n");
+ g_print (_("The suspend image don't seem to be an image\n"));
return;
}
}
@@ -593,7 +593,7 @@
else
{
DEBUG_PRINT
- ("splashy_config: Checking if '%s' exists (font file)\n",
+ (_("splashy_config: Checking if '%s' exists (font file)\n"),
NewTheme->textfont_file);
if (!g_file_test
(NewTheme->textfont_file, G_FILE_TEST_EXISTS))
@@ -631,7 +631,7 @@
if (NewTheme->author == NULL)
{
NewTheme->author =
- g_strdup ("Author <[EMAIL PROTECTED]>");
+ g_strdup (_("Author <[EMAIL PROTECTED]>"));
}
// Background resolution: width
@@ -1462,7 +1462,7 @@
if ((dest_file = fopen (dest_path, "w+")) == NULL)
{
- g_critical ("Error opening dest file %s\n", dest_path);
+ g_critical (_("Error opening dest file %s\n"), dest_path);
return FALSE;
}
fwrite (content, 1, filesize, dest_file);
Index: src/splashy_config-main.c
===================================================================
--- src/splashy_config-main.c (revisão 1156)
+++ src/splashy_config-main.c (cópia de trabalho)
@@ -153,8 +153,8 @@
if (!splashy_init_config (SPL_CONFIG_FILE))
{
ERROR_PRINT ("%s",
- "Error occured while starting Splashy\n"
- "Make sure that you can read Splashy's configuration file\n");
+ _("Error occured while starting Splashy\n")
+ _("Make sure that you can read Splashy's configuration file\n"));
return 1;
}
g_set_prgname (PROGNAME);
@@ -189,7 +189,7 @@
case 'c':
if (argv[optind] == NULL) // interactive mode */
/* create_theme (get_fields ()); */
- g_print (" NOT IMPLEMENTED \n");
+ g_print (_(" NOT IMPLEMENTED \n"));
else // inline mode
{