~tuxator/midori/speeddial-refresh

« back to all changes in this revision

Viewing changes to katze/katze-xbel.c

  • Committer: Christian Dywan
  • Date: 2008-03-22 02:38:23 UTC
  • Revision ID: git-v1:be89221aea13aa092f64d2133fd5bed5c23f4972
Implement localization via Gettext.

Based on the implementation of localization via Gettext
contributed by Enrico Tröger, a few adjustments were made
to allow Midori to be properly localized. Initially
German is fully supported.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#include <string.h>
25
25
#include <libxml/parser.h>
26
26
#include <libxml/tree.h>
 
27
#include <glib/gi18n.h>
27
28
 
28
29
#include "katze-utils.h"
29
30
 
719
720
    {
720
721
        // No valid xml or broken encoding
721
722
        *error = g_error_new (KATZE_XBEL_ERROR, KATZE_XBEL_ERROR_READ,
722
 
                              "Malformed document.");
 
723
                              _("Malformed document."));
723
724
        return FALSE;
724
725
    }
725
726
    if (!katze_xbel_folder_from_xmlDocPtr (folder, doc))
727
728
        // Parsing failed
728
729
        xmlFreeDoc(doc);
729
730
        *error = g_error_new (KATZE_XBEL_ERROR, KATZE_XBEL_ERROR_READ,
730
 
                              "Malformed document.");
 
731
                              _("Malformed document."));
731
732
        return FALSE;
732
733
    }
733
734
    xmlFreeDoc(doc);
755
756
    {
756
757
        // File doesn't exist
757
758
        *error = g_error_new (G_FILE_ERROR, G_FILE_ERROR_NOENT,
758
 
                              "File not found.");
 
759
                              _("File not found."));
759
760
        return FALSE;
760
761
    }
761
762
    xmlDocPtr doc;
763
764
    {
764
765
        // No valid xml or broken encoding
765
766
        *error = g_error_new (KATZE_XBEL_ERROR, KATZE_XBEL_ERROR_READ,
766
 
                              "Malformed document.");
 
767
                              _("Malformed document."));
767
768
        return FALSE;
768
769
    }
769
770
    if (!katze_xbel_folder_from_xmlDocPtr (folder, doc))
771
772
        // Parsing failed
772
773
        xmlFreeDoc (doc);
773
774
        *error = g_error_new (KATZE_XBEL_ERROR, KATZE_XBEL_ERROR_READ,
774
 
                             "Malformed document.");
 
775
                             _("Malformed document."));
775
776
        return FALSE;
776
777
    }
777
778
    xmlFreeDoc (doc);
800
801
    // FIXME: Essentially unimplemented
801
802
 
802
803
    *error = g_error_new (KATZE_XBEL_ERROR, KATZE_XBEL_ERROR_READ,
803
 
                          "Malformed document.");
 
804
                          _("Malformed document."));
804
805
    return FALSE;
805
806
}
806
807
 
948
949
    if(!(fp = fopen (file, "w")))
949
950
    {
950
951
        *error = g_error_new (G_FILE_ERROR, G_FILE_ERROR_ACCES,
951
 
                              "Writing failed.");
 
952
                              _("Writing failed."));
952
953
        return FALSE;
953
954
    }
954
955
    fputs (data, fp);