[libgsf] I18n: translate error strings.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgsf] I18n: translate error strings.
- Date: Fri, 8 Mar 2013 20:49:05 +0000 (UTC)
commit b53477609dc2ca2c7114c638e0fbc8a21953034a
Author: Morten Welinder <terra gnome org>
Date: Fri Mar 8 15:48:50 2013 -0500
I18n: translate error strings.
NEWS | 1 +
gsf/gsf-infile-ar.c | 4 ++--
gsf/gsf-infile-msole.c | 21 ++++++++++++---------
gsf/gsf-infile-msvba.c | 17 +++++++++--------
gsf/gsf-infile-tar.c | 12 ++++++------
gsf/gsf-infile-zip.c | 17 +++++++----------
gsf/gsf-input-bzip.c | 9 +++++----
gsf/gsf-input-gzip.c | 14 +++++++-------
gsf/gsf-input-memory.c | 7 ++++---
gsf/gsf-input.c | 4 ++--
gsf/gsf-msole-utils.c | 16 ++++++++--------
gsf/gsf-output-bzip.c | 5 +++--
gsf/gsf-output-gio.c | 8 +-------
gsf/gsf-output-gzip.c | 1 +
gsf/gsf-output-stdio.c | 3 ++-
15 files changed, 70 insertions(+), 69 deletions(-)
---
diff --git a/NEWS b/NEWS
index 026c192..97a1e00 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,7 @@ Morten:
* Introspection fixes.
* Property documentation fixes.
* I18n fixes for property strings.
+ * I18n fixes for error strings.
* Fix uncompress problem with bzip'd files.
* Add modtime support for GsfInput, GsfInputStdio, GsfInputGzip.
* Add modtime support for GsfInfileZip, GsfInfileTar, GsfInfileMSOle.
diff --git a/gsf/gsf-infile-ar.c b/gsf/gsf-infile-ar.c
index cf945d2..8490588 100644
--- a/gsf/gsf-infile-ar.c
+++ b/gsf/gsf-infile-ar.c
@@ -332,7 +332,7 @@ gsf_infile_ar_dup (GsfInput *src_input, GError **err)
if (dst == NULL) {
if (err != NULL)
*err = g_error_new (gsf_input_error_id (), 0,
- "Something went wrong in ar_dup.");
+ _("Something went wrong in ar_dup"));
return NULL;
}
@@ -343,7 +343,7 @@ gsf_infile_ar_dup (GsfInput *src_input, GError **err)
g_object_unref (dst);
if (err != NULL)
*err = g_error_new (gsf_input_error_id (), 0,
- "Something went wrong in ar_child_init.");
+ _("Something went wrong in ar_child_init"));
return NULL;
}
diff --git a/gsf/gsf-infile-msole.c b/gsf/gsf-infile-msole.c
index c945f32..2ed7b88 100644
--- a/gsf/gsf-infile-msole.c
+++ b/gsf/gsf-infile-msole.c
@@ -28,6 +28,7 @@
#include <gsf/gsf-infile-msole.h>
#include <gsf/gsf.h>
#include <gsf/gsf-msole-impl.h>
+#include <glib/gi18n-lib.h>
#include <string.h>
#include <stdio.h>
@@ -470,7 +471,7 @@ ole_dup (GsfInfileMSOle const *src, GError **err)
if (input == NULL) {
if (err != NULL)
*err = g_error_new (gsf_input_error_id (), 0,
- "Failed to duplicate input stream");
+ _("Failed to duplicate input stream"));
return NULL;
}
@@ -504,7 +505,7 @@ ole_init_info (GsfInfileMSOle *ole, GError **err)
0 != memcmp (header, signature, sizeof (signature))) {
if (err != NULL)
*err = g_error_new (gsf_input_error_id (), 0,
- "No OLE2 signature");
+ _("No OLE2 signature"));
return TRUE;
}
@@ -524,7 +525,7 @@ ole_init_info (GsfInfileMSOle *ole, GError **err)
(gsf_input_size (ole->input) >> bb_shift) < 1) {
if (err != NULL)
*err = g_error_new (gsf_input_error_id (), 0,
- "Unreasonable block sizes");
+ _("Unreasonable block sizes"));
return TRUE;
}
@@ -560,7 +561,7 @@ ole_init_info (GsfInfileMSOle *ole, GError **err)
g_free (info);
if (err != NULL)
*err = g_error_new (gsf_input_error_id (), 0,
- "Insufficient memory");
+ _("Insufficient memory"));
return TRUE;
}
@@ -619,7 +620,7 @@ ole_init_info (GsfInfileMSOle *ole, GError **err)
if (fail) {
if (err != NULL)
*err = g_error_new (gsf_input_error_id (), 0,
- "Inconsistent block allocation table");
+ _("Inconsistent block allocation table"));
return TRUE;
}
@@ -627,7 +628,7 @@ ole_init_info (GsfInfileMSOle *ole, GError **err)
if (ole_make_bat (&info->bb.bat, 0, dirent_start, &ole->bat)) {
if (err != NULL)
*err = g_error_new (gsf_input_error_id (), 0,
- "Problems making block allocation table");
+ _("Problems making block allocation table"));
return TRUE;
}
@@ -639,7 +640,7 @@ ole_init_info (GsfInfileMSOle *ole, GError **err)
if (ole->dirent == NULL) {
if (err != NULL)
*err = g_error_new (gsf_input_error_id (), 0,
- "Problems reading directory");
+ _("Problems reading directory"));
return TRUE;
}
@@ -798,7 +799,7 @@ gsf_infile_msole_new_child (GsfInfileMSOle *parent,
if (!sb_file) {
if (err != NULL)
*err = g_error_new (gsf_input_error_id (), 0,
- "Failed to access child");
+ _("Failed to access child"));
g_object_unref (child);
return NULL;
}
@@ -829,7 +830,9 @@ gsf_infile_msole_new_child (GsfInfileMSOle *parent,
child->stream.buf + (i << info->sb.shift))) == NULL) {
g_warning ("failure reading block %d for '%s'", i, dirent->name);
- if (err) *err = g_error_new (gsf_input_error_id (), 0, "failure reading
block");
+ if (err) *err = g_error_new
+ (gsf_input_error_id (), 0,
+ _("failure reading block"));
g_object_unref (child);
return NULL;
}
diff --git a/gsf/gsf-infile-msvba.c b/gsf/gsf-infile-msvba.c
index 3dc925b..5189ed6 100644
--- a/gsf/gsf-infile-msvba.c
+++ b/gsf/gsf-infile-msvba.c
@@ -30,6 +30,7 @@
#include <gsf-config.h>
#include <gsf/gsf-infile-msvba.h>
#include <gsf/gsf.h>
+#include <glib/gi18n-lib.h>
#include <string.h>
@@ -165,7 +166,7 @@ vba_dir_read (GsfInfileMSVBA *vba, GError **err)
/* 0. get the stream */
dir = gsf_infile_child_by_name (vba->source, "dir");
if (dir == NULL) {
- msg = "Can't find the VBA directory stream.";
+ msg = _("Can't find the VBA directory stream");
goto fail_stream;
}
@@ -212,7 +213,7 @@ vba_dir_read (GsfInfileMSVBA *vba, GError **err)
* and sometimes some trailing junk
**/
if ((ptr + 6) > end) {
- msg = "vba project header problem";
+ msg = _("vba project header problem");
goto fail_content;
}
tag = GSF_LE_GET_GUINT16 (ptr);
@@ -220,7 +221,7 @@ vba_dir_read (GsfInfileMSVBA *vba, GError **err)
ptr += 6;
if ((ptr + len) > end) {
- msg = "vba project header problem";
+ msg = _("vba project header problem");
goto fail_content;
}
@@ -378,7 +379,7 @@ vba_project_read (GsfInfileMSVBA *vba, GError **err)
if (dir == NULL) {
if (err != NULL)
*err = g_error_new (gsf_input_error_id (), 0,
- "Can't find the VBA directory stream.");
+ _("Can't find the VBA directory stream"));
return FALSE;
}
@@ -387,7 +388,7 @@ vba_project_read (GsfInfileMSVBA *vba, GError **err)
0 != memcmp (data, signature, sizeof (signature))) {
if (err != NULL)
*err = g_error_new (gsf_input_error_id (), 0,
- "No VBA signature");
+ _("No VBA signature"));
return FALSE;
}
@@ -398,8 +399,8 @@ vba_project_read (GsfInfileMSVBA *vba, GError **err)
if (i >= G_N_ELEMENTS (versions)) {
if (err != NULL)
*err = g_error_new (gsf_input_error_id (), 0,
- "Unknown VBA version signature 0x%x%x%x%x",
- data[2], data[3], data[4], data[5]);
+ _("Unknown VBA version signature 0x%x%x%x%x"),
+ data[2], data[3], data[4], data[5]);
return FALSE;
}
@@ -498,7 +499,7 @@ gsf_infile_msvba_new (GsfInfile *source, GError **err)
if (err != NULL && *err == NULL)
*err = g_error_new (gsf_input_error_id (), 0,
- "Unable to parse VBA header");
+ _("Unable to parse VBA header"));
g_object_unref (vba);
return NULL;
diff --git a/gsf/gsf-infile-tar.c b/gsf/gsf-infile-tar.c
index e0051d5..33068d2 100644
--- a/gsf/gsf-infile-tar.c
+++ b/gsf/gsf-infile-tar.c
@@ -106,7 +106,7 @@ unpack_octal (GsfInfileTar *tar, const char *s, size_t len)
break;
if (c < '0' || c > '7') {
tar->err = g_error_new (gsf_input_error_id (), 0,
- "Invalid tar header");
+ _("Invalid tar header"));
return 0;
}
res = (res << 3) + (c - '0');
@@ -214,7 +214,7 @@ tar_init_info (GsfInfileTar *tar)
if (memcmp (header->filler, end.filler, sizeof (end.filler))) {
tar->err = g_error_new (gsf_input_error_id (), 0,
- "Invalid tar header");
+ _("Invalid tar header"));
break;
}
@@ -263,14 +263,14 @@ tar_init_info (GsfInfileTar *tar)
if (pending_longname ||
strcmp (name, MAGIC_LONGNAME) != 0) {
tar->err = g_error_new (gsf_input_error_id (), 0,
- "Invalid longname header");
+ _("Invalid longname header"));
break;
}
n = gsf_input_read (tar->source, length, NULL);
if (!n) {
tar->err = g_error_new (gsf_input_error_id (), 0,
- "Failed to read longname");
+ _("Failed to read longname"));
break;
}
@@ -290,7 +290,7 @@ tar_init_info (GsfInfileTar *tar)
if (!tar->err &&
gsf_input_seek (tar->source, offset + length, G_SEEK_SET)) {
tar->err = g_error_new (gsf_input_error_id (), 0,
- "Seek failed");
+ _("Seek failed"));
break;
}
}
@@ -298,7 +298,7 @@ tar_init_info (GsfInfileTar *tar)
if (pending_longname) {
if (!tar->err)
tar->err = g_error_new (gsf_input_error_id (), 0,
- "Truncated archive");
+ _("Truncated archive"));
g_free (pending_longname);
}
diff --git a/gsf/gsf-infile-zip.c b/gsf/gsf-infile-zip.c
index 0e7b5f7..82dbfba 100644
--- a/gsf/gsf-infile-zip.c
+++ b/gsf/gsf-infile-zip.c
@@ -327,14 +327,14 @@ zip_read_dirents (GsfInfileZip *zip)
offset = zip_find_trailer (zip);
if (offset < 0) {
zip->err = g_error_new (gsf_input_error_id (), 0,
- "No Zip trailer");
+ _("No Zip trailer"));
return TRUE;
}
if (gsf_input_seek (zip->source, offset, G_SEEK_SET) ||
NULL == (trailer = gsf_input_read (zip->source, ZIP_TRAILER_SIZE, NULL))) {
zip->err = g_error_new (gsf_input_error_id (), 0,
- "Error reading Zip signature");
+ _("Error reading Zip signature"));
return TRUE;
}
@@ -355,7 +355,7 @@ zip_read_dirents (GsfInfileZip *zip)
d = zip_dirent_new_in (zip, &offset);
if (d == NULL) {
zip->err = g_error_new (gsf_input_error_id (), 0,
- "Error reading zip dirent");
+ _("Error reading zip dirent"));
return TRUE;
}
@@ -409,7 +409,7 @@ zip_child_init (GsfInfileZip *child, GError **errmsg)
{ 'P', 'K', 0x03, 0x04 };
guint8 const *data = NULL;
guint16 name_len, extras_len;
- char *err = NULL;
+ const char *err = NULL;
GsfZipDirent *dirent = child->vdir->dirent;
@@ -418,13 +418,11 @@ zip_child_init (GsfInfileZip *child, GError **errmsg)
**/
if (gsf_input_seek (child->source, (gsf_off_t) dirent->offset, G_SEEK_SET))
- err = g_strdup_printf ("Error seeking to zip header @ %" GSF_OFF_T_FORMAT,
- dirent->offset);
+ err = _("Error seeking to zip header");
else if (NULL == (data = gsf_input_read (child->source, ZIP_FILE_HEADER_SIZE, NULL)))
err = g_strdup_printf ("Error reading %d bytes in zip header", ZIP_FILE_HEADER_SIZE);
else if (0 != memcmp (data, header_signature, sizeof (header_signature))) {
- err = g_strdup_printf ("Error incorrect zip header @ %" GSF_OFF_T_FORMAT,
- dirent->offset);
+ err = _("Error incorrect zip header");
g_print ("Header is :\n");
gsf_mem_dump (data, sizeof (header_signature));
g_print ("Header should be :\n");
@@ -434,7 +432,6 @@ zip_child_init (GsfInfileZip *child, GError **errmsg)
if (NULL != err) {
if (errmsg != NULL)
*errmsg = g_error_new_literal (gsf_input_error_id (), 0, err);
- g_free (err);
return TRUE;
}
@@ -458,7 +455,7 @@ zip_child_init (GsfInfileZip *child, GError **errmsg)
if (err != Z_OK) {
if (errmsg != NULL)
*errmsg = g_error_new (gsf_input_error_id (), 0,
- "problem uncompressing stream");
+ _("problem uncompressing stream"));
return TRUE;
}
}
diff --git a/gsf/gsf-input-bzip.c b/gsf/gsf-input-bzip.c
index 5da1412..90efd6b 100644
--- a/gsf/gsf-input-bzip.c
+++ b/gsf/gsf-input-bzip.c
@@ -22,6 +22,7 @@
#include <gsf-config.h>
#include <gsf-input-bzip.h>
#include <gsf.h>
+#include <glib/gi18n-lib.h>
#include <string.h>
@@ -44,7 +45,7 @@ gsf_input_memory_new_from_bzip (GsfInput *source, GError **err)
(void)source;
if (err)
*err = g_error_new (gsf_input_error_id (), 0,
- "BZ2 support not enabled");
+ _("BZ2 support not enabled"));
return NULL;
#else
bz_stream bzstm;
@@ -59,7 +60,7 @@ gsf_input_memory_new_from_bzip (GsfInput *source, GError **err)
if (BZ_OK != BZ2_bzDecompressInit (&bzstm, 0, 0)) {
if (err)
*err = g_error_new (gsf_input_error_id (), 0,
- "BZ2 decompress init failed");
+ _("BZ2 decompress init failed"));
return NULL;
}
@@ -78,7 +79,7 @@ gsf_input_memory_new_from_bzip (GsfInput *source, GError **err)
if (bzerr != BZ_OK && bzerr != BZ_STREAM_END) {
if (err)
*err = g_error_new (gsf_input_error_id (), 0,
- "BZ2 decompress failed");
+ _("BZ2 decompress failed"));
BZ2_bzDecompressEnd (&bzstm);
gsf_output_close (sink);
g_object_unref (sink);
@@ -95,7 +96,7 @@ gsf_input_memory_new_from_bzip (GsfInput *source, GError **err)
if (BZ_OK != BZ2_bzDecompressEnd (&bzstm)) {
if (err)
*err = g_error_new (gsf_input_error_id (), 0,
- "BZ2 decompress end failed");
+ _("BZ2 decompress end failed"));
g_object_unref (sink);
return NULL;
}
diff --git a/gsf/gsf-input-gzip.c b/gsf/gsf-input-gzip.c
index f66399b..8b67c05 100644
--- a/gsf/gsf-input-gzip.c
+++ b/gsf/gsf-input-gzip.c
@@ -166,7 +166,7 @@ init_zip (GsfInputGZip *gzip, GError **err)
if (Z_OK != inflateInit2 (&(gzip->stream), -MAX_WBITS)) {
if (err != NULL)
*err = g_error_new (gsf_input_error_id (), 0,
- "Unable to initialize zlib");
+ _("Unable to initialize zlib"));
return TRUE;
}
@@ -174,14 +174,14 @@ init_zip (GsfInputGZip *gzip, GError **err)
if (gsf_input_seek (gzip->source, 0, G_SEEK_SET)) {
if (err)
*err = g_error_new (gsf_input_error_id (), 0,
- "Failed to rewind source");
+ _("Failed to rewind source"));
return TRUE;
}
if (check_header (gzip) != FALSE) {
if (err != NULL)
*err = g_error_new (gsf_input_error_id (), 0,
- "Invalid gzip header");
+ _("Invalid gzip header"));
if (gsf_input_seek (gzip->source, cur_pos, G_SEEK_SET)) {
g_warning ("attempt to restore position failed ??");
}
@@ -310,7 +310,7 @@ gsf_input_gzip_read (GsfInput *input, size_t num_bytes, guint8 *buffer)
g_clear_error (&gzip->err);
gzip->err = g_error_new
(gsf_input_error_id (), 0,
- "truncated source");
+ _("truncated source"));
return NULL;
}
/* zlib requires an extra byte. */
@@ -327,7 +327,7 @@ gsf_input_gzip_read (GsfInput *input, size_t num_bytes, guint8 *buffer)
g_clear_error (&gzip->err);
gzip->err = g_error_new
(gsf_input_error_id (), 0,
- "Failed to read from source");
+ _("Failed to read from source"));
return NULL;
}
gzip->stream.avail_in = n;
@@ -471,11 +471,11 @@ gsf_input_gzip_constructor (GType type,
if (!gzip->source) {
g_clear_error (&gzip->err);
gzip->err = g_error_new (gsf_input_error_id (), 0,
- "NULL source");
+ _("NULL source"));
} else if (gzip->raw && gzip->uncompressed_size < 0) {
g_clear_error (&gzip->err);
gzip->err = g_error_new (gsf_input_error_id (), 0,
- "Uncompressed size not set");
+ _("Uncompressed size not set"));
} else if (init_zip (gzip, &gzip->err) != FALSE) {
/* Nothing more. */
}
diff --git a/gsf/gsf-input-memory.c b/gsf/gsf-input-memory.c
index 30801a7..c059de2 100644
--- a/gsf/gsf-input-memory.c
+++ b/gsf/gsf-input-memory.c
@@ -22,6 +22,7 @@
#include <gsf-config.h>
#include <gsf/gsf-input-memory.h>
#include <gsf/gsf.h>
+#include <glib/gi18n-lib.h>
#include <glib/gstdio.h>
@@ -225,7 +226,7 @@ gsf_input_mmap_new (char const *filename, GError **err)
if (err != NULL) {
char *utf8name = g_filename_display_name (filename);
*err = g_error_new (gsf_input_error_id (), 0,
- "%s: Is not a regular file",
+ _("%s: Is not a regular file"),
utf8name);
g_free (utf8name);
}
@@ -238,7 +239,7 @@ gsf_input_mmap_new (char const *filename, GError **err)
if (err != NULL) {
char *utf8name = g_filename_display_name (filename);
*err = g_error_new (gsf_input_error_id (), 0,
- "%s: File too large to be memory mapped",
+ _("%s: File too large to be memory mapped"),
utf8name);
g_free (utf8name);
}
@@ -280,7 +281,7 @@ gsf_input_mmap_new (char const *filename, GError **err)
(void)filename;
if (err != NULL)
*err = g_error_new (gsf_input_error_id (), 0,
- "mmap not supported");
+ _("mmap not supported"));
return NULL;
#endif
}
diff --git a/gsf/gsf-input.c b/gsf/gsf-input.c
index 39cb695..09ed888 100644
--- a/gsf/gsf-input.c
+++ b/gsf/gsf-input.c
@@ -278,14 +278,14 @@ gsf_input_dup (GsfInput *input, GError **err)
if (dst->size != input->size) {
if (err != NULL)
*err = g_error_new (gsf_input_error_id (), 0,
- "Duplicate size mismatch");
+ _("Duplicate size mismatch"));
g_object_unref (dst);
return NULL;
}
if (gsf_input_seek (dst, input->cur_offset, G_SEEK_SET)) {
if (err != NULL)
*err = g_error_new (gsf_input_error_id (), 0,
- "Seek failed");
+ _("Seek failed"));
g_object_unref (dst);
return NULL;
}
diff --git a/gsf/gsf-msole-utils.c b/gsf/gsf-msole-utils.c
index bf6cc72..c95e8a3 100644
--- a/gsf/gsf-msole-utils.c
+++ b/gsf/gsf-msole-utils.c
@@ -1124,7 +1124,7 @@ gsf_doc_meta_data_read_from_msole (GsfDocMetaData *accum, GsfInput *in)
data = gsf_input_read (in, 28, NULL);
if (NULL == data)
return g_error_new (gsf_input_error_id (), 0,
- "Unable to read MS property stream header");
+ _("Unable to read MS property stream header"));
d ({g_print ("===================================\n"
"header class id ==\n");
@@ -1151,7 +1151,7 @@ gsf_doc_meta_data_read_from_msole (GsfDocMetaData *accum, GsfInput *in)
|| num_sections > gsf_input_size(in) / 20
|| num_sections > 100) /* arbitrary sanity check */
return g_error_new (gsf_input_error_id (), 0,
- "Invalid MS property stream header");
+ _("Invalid MS property stream header"));
/* extract the section info */
/*
@@ -1168,7 +1168,7 @@ gsf_doc_meta_data_read_from_msole (GsfDocMetaData *accum, GsfInput *in)
data = gsf_input_read (in, 20, NULL);
if (NULL == data)
return g_error_new (gsf_input_error_id (), 0,
- "Unable to read MS property stream header");
+ _("Unable to read MS property stream header"));
if (!memcmp (data, component_guid, sizeof (component_guid)))
sections [i].type = COMPONENT_PROP;
else if (!memcmp (data, document_guid, sizeof (document_guid)))
@@ -1198,7 +1198,7 @@ gsf_doc_meta_data_read_from_msole (GsfDocMetaData *accum, GsfInput *in)
if (gsf_input_seek (in, sections[i].offset, G_SEEK_SET) ||
NULL == (data = gsf_input_read (in, 8, NULL)))
return g_error_new (gsf_input_error_id (), 0,
- "Invalid MS property section");
+ _("Invalid MS property section"));
sections[i].iconv_handle = (GIConv)-1;
sections[i].char_size = 1;
@@ -1217,11 +1217,11 @@ gsf_doc_meta_data_read_from_msole (GsfDocMetaData *accum, GsfInput *in)
continue;
if (sections[i].num_props > gsf_input_remaining(in) / 8)
return g_error_new (gsf_input_error_id (), 0,
- "Invalid MS property stream header or file truncated");
+ _("Invalid MS property stream header or file truncated"));
if (sections[i].offset + sections[i].size > gsf_input_size(in))
return g_error_new (gsf_input_error_id (), 0,
- "Invalid MS property stream header or file truncated");
+ _("Invalid MS property stream header or file truncated"));
/*
* Get and save all the Property ID/Offset pairs.
@@ -1236,7 +1236,7 @@ gsf_doc_meta_data_read_from_msole (GsfDocMetaData *accum, GsfInput *in)
if (NULL == (data = gsf_input_read (in, 8, NULL))) {
g_free (props);
return g_error_new (gsf_input_error_id (), 0,
- "Invalid MS property section");
+ _("Invalid MS property section"));
}
props[j].id = GSF_LE_GET_GUINT32 (data);
@@ -1260,7 +1260,7 @@ gsf_doc_meta_data_read_from_msole (GsfDocMetaData *accum, GsfInput *in)
if (props[j].offset < 0 || props[j].offset + 4 > end) {
g_free (props);
return g_error_new (gsf_input_error_id (), 0,
- "Invalid MS property section");
+ _("Invalid MS property section"));
}
}
diff --git a/gsf/gsf-output-bzip.c b/gsf/gsf-output-bzip.c
index 7a5b1a9..9575fe4 100644
--- a/gsf/gsf-output-bzip.c
+++ b/gsf/gsf-output-bzip.c
@@ -23,6 +23,7 @@
#include <gsf-config.h>
#include <gsf/gsf-output-bzip.h>
#include <gsf/gsf.h>
+#include <glib/gi18n-lib.h>
#ifdef HAVE_BZ2
#include <bzlib.h>
@@ -72,7 +73,7 @@ init_bzip (GsfOutputBzip *bzip, GError **err)
if (ret != BZ_OK) {
if (err != NULL)
*err = g_error_new (gsf_output_error_id (), 0,
- "Unable to initialize BZ2 library");
+ _("Unable to initialize BZ2 library"));
return FALSE;
}
if (!bzip->buf) {
@@ -261,7 +262,7 @@ gsf_output_bzip_new (GsfOutput *sink, GError **err)
(void)sink;
if (err)
*err = g_error_new (gsf_output_error_id (), 0,
- "BZ2 support not enabled");
+ _("BZ2 support not enabled"));
return NULL;
#endif
}
diff --git a/gsf/gsf-output-gio.c b/gsf/gsf-output-gio.c
index ff5ce36..72c7aa9 100644
--- a/gsf/gsf-output-gio.c
+++ b/gsf/gsf-output-gio.c
@@ -107,15 +107,9 @@ gsf_output_gio_new_for_path (char const *path, GError **err)
GFile *file;
GsfOutput *output;
- if (path == NULL) {
- if (err != NULL)
- *err = g_error_new (gsf_output_error_id (), 0,
- "path is NULL");
- return NULL;
- }
+ g_return_val_if_fail (path != NULL, NULL);
file = g_file_new_for_path (path);
-
output = gsf_output_gio_new_full (file, err);
g_object_unref (file);
diff --git a/gsf/gsf-output-gzip.c b/gsf/gsf-output-gzip.c
index 5459084..3d7b05c 100644
--- a/gsf/gsf-output-gzip.c
+++ b/gsf/gsf-output-gzip.c
@@ -22,6 +22,7 @@
#include <gsf-config.h>
#include <gsf/gsf-output-gzip.h>
#include <gsf/gsf.h>
+#include <glib/gi18n-lib.h>
#include <zlib.h>
#include <time.h>
diff --git a/gsf/gsf-output-stdio.c b/gsf/gsf-output-stdio.c
index 3bcb54f..cb2fbbc 100644
--- a/gsf/gsf-output-stdio.c
+++ b/gsf/gsf-output-stdio.c
@@ -22,6 +22,7 @@
#include <gsf-config.h>
#include <gsf/gsf-output-stdio.h>
#include <gsf/gsf.h>
+#include <glib/gi18n-lib.h>
#include <glib/gstdio.h>
@@ -449,7 +450,7 @@ gsf_output_stdio_new_valist (char const *filename, GError **err,
char *dname = g_filename_display_name
(real_filename);
*err = g_error_new (gsf_output_error_id (), 0,
- "%s: Is not a regular file",
+ _("%s: Is not a regular file"),
dname);
g_free (dname);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]