//
// Shared message catalog class for the CUPS PPD Compiler.
//
-// Copyright 2007-2009 by Apple Inc.
+// Copyright 2007-2012 by Apple Inc.
// Copyright 2002-2006 by Easy Software Products.
//
// These coded instructions, statements, and computer programs are the
ppdcMessage *m; // Current message
+ if (!*id)
+ return (id);
+
for (m = (ppdcMessage *)messages->first();
m;
m = (ppdcMessage *)messages->next())
else if (!strcmp(ptr, ".strings"))
{
/*
- * Read messages in Mac OS X ".strings" format, which are UTF-16 text
- * files of the format:
+ * Read messages in OS X ".strings" format, which are UTF-16 text files of
+ * the format:
*
* "id" = "str";
*
int which, // In msgid?
haveid, // Did we get a msgid string?
havestr; // Did we get a msgstr string?
-
+
linenum = 0;
id[0] = '\0';
str[0] = '\0';
if ((ptr = (char *)strrchr(line, '\"')) == NULL)
{
_cupsLangPrintf(stderr,
- _("ERROR: Expected quoted string on line %d of %s\n"),
+ _("ppdc: Expected quoted string on line %d of %s."),
linenum, f);
cupsFileClose(fp);
return (-1);
if ((ptr = strchr(line, '\"')) == NULL)
{
_cupsLangPrintf(stderr,
- _("ERROR: Expected quoted string on line %d of %s\n"),
+ _("ppdc: Expected quoted string on line %d of %s."),
linenum, f);
cupsFileClose(fp);
return (-1);
if (!haveid)
{
_cupsLangPrintf(stderr,
- _("ERROR: Need a msgid line before any "
- "translation strings on line %d of %s\n"),
+ _("ppdc: Need a msgid line before any "
+ "translation strings on line %d of %s."),
linenum, f);
cupsFileClose(fp);
return (-1);
strlcat(id, ptr, sizeof(id));
else
{
- _cupsLangPrintf(stderr, _("ERROR: Unexpected text on line %d of %s\n"),
+ _cupsLangPrintf(stderr, _("ppdc: Unexpected text on line %d of %s."),
linenum, f);
cupsFileClose(fp);
return (-1);
unknown_load_format:
_cupsLangPrintf(stderr,
- _("ERROR: Unknown message catalog format for \"%s\"\n"), f);
+ _("ppdc: Unknown message catalog format for \"%s\"."), f);
cupsFileClose(fp);
return (-1);
}