page-sizes.paper -> paper-sizes.xml
predefined-labels.template ->predefined-templates.xml
xml-paper now looks for files with ".paper" extension or exactly named
"paper-sizes.xml".
xml-template now looks for files with ".template" extension or ending with
"-templates.xml".
Gettext is run on attributes starting with "_" in both xml-paper and xml-template.
git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@263
f5e0f49d-192f-0410-a22d-
a8d8700d0965
if (extension != NULL) {
- if (strcasecmp (extension, ".paper") == 0) {
+ if ( (g_strcasecmp (extension, ".paper") == 0)
+ || (g_strcasecmp (filename, "paper-sizes.xml") == 0) ) {
full_filename =
g_build_filename (dirname, filename, NULL);
const gchar *dirname)
{
GDir *dp;
- const gchar *filename, *extension;
+ const gchar *filename, *extension, *extension2;
gchar *full_filename = NULL;
GError *gerror = NULL;
while ((filename = g_dir_read_name (dp)) != NULL) {
extension = strrchr (filename, '.');
+ extension2 = strrchr (filename, '-');
if (extension != NULL) {
- if (strcasecmp (extension, ".template") == 0) {
+ if ( (g_strcasecmp (extension, ".template") == 0)
+ || (g_strcasecmp (extension2, "-templates.xml") == 0) ) {
full_filename =
g_build_filename (dirname, filename, NULL);
#include <config.h>
#include <string.h>
+#include <libintl.h>
#include "xml.h"
#include "xml-paper.h"
gl_xml_paper_parse_paper (xmlNodePtr paper_node)
{
glPaper *paper;
+ gchar *name;
gl_debug (DEBUG_PAPER, "START");
paper = g_new0 (glPaper, 1);
paper->id = xmlGetProp (paper_node, "id");
- paper->name = xmlGetProp (paper_node, "_name");
+
+ name = xmlGetProp (paper_node, "_name");
+ if (name != NULL) {
+ paper->name = gettext (name);
+ } else {
+ paper->name = xmlGetProp (paper_node, "name");
+ }
paper->width = gl_xml_get_prop_length (paper_node, "width", 0);
paper->height = gl_xml_get_prop_length (paper_node, "height", 0);
#include <config.h>
#include <string.h>
+#include <libintl.h>
#include "util.h"
#include "paper.h"
{
glTemplate *template;
xmlNodePtr node;
+ gchar *description;
glPaper *paper;
gl_debug (DEBUG_TEMPLATE, "START");
gl_paper_free (&paper);
}
- template->description = xmlGetProp (sheet_node, "description");
+ description = xmlGetProp (sheet_node, "_description");
+ if (description != NULL) {
+ template->description = gettext (description);
+ } else {
+ template->description = xmlGetProp (sheet_node, "description");
+ }
for (node = sheet_node->xmlChildrenNode; node != NULL;
node = node->next) {