translating parsing error messages

Original commit message from CVS:
translating parsing error messages
This commit is contained in:
Thomas Vander Stichele 2004-01-13 14:23:44 +00:00
parent 7e56c5435f
commit 8e96cb73f6
6 changed files with 199 additions and 35 deletions

View file

@ -1,3 +1,11 @@
2004-01-13 Thomas Vander Stichele <thomas at apestaart dot org>
* gst/parse/grammar.y:
* po/POTFILES.in:
* po/nl.po:
* tools/gst-launch.c: (xmllaunch_parse_cmdline), (main):
translate parsing error messages
2004-01-13 Thomas Vander Stichele <thomas at apestaart dot org> 2004-01-13 Thomas Vander Stichele <thomas at apestaart dot org>
* po/POTFILES.in: adding gst-launch * po/POTFILES.in: adding gst-launch

View file

@ -6,6 +6,7 @@
#include <stdlib.h> #include <stdlib.h>
#include "../gst_private.h" #include "../gst_private.h"
#include "../gst-i18n-lib.h"
#include "../gstconfig.h" #include "../gstconfig.h"
#include "../gstparse.h" #include "../gstparse.h"
@ -13,6 +14,11 @@
#include "../gsturi.h" #include "../gsturi.h"
#include "types.h" #include "types.h"
/* All error messages in this file are user-visible and need to be translated.
* Don't start the message with a capital, and don't end them with a period,
* as they will be presented inside a sentence/error.
*/
#define YYERROR_VERBOSE 1 #define YYERROR_VERBOSE 1
#define YYPARSE_PARAM graph #define YYPARSE_PARAM graph
@ -160,12 +166,12 @@ typedef struct {
GSList *walk; \ GSList *walk; \
GstBin *bin = (GstBin *) gst_element_factory_make (type, NULL); \ GstBin *bin = (GstBin *) gst_element_factory_make (type, NULL); \
if (!chain) { \ if (!chain) { \
ERROR (GST_PARSE_ERROR_EMPTY_BIN, "Specified empty bin \"%s\", not allowed", type); \ ERROR (GST_PARSE_ERROR_EMPTY_BIN, _("specified empty bin \"%s\", not allowed"), type); \
g_slist_foreach (assign, (GFunc) gst_parse_strfree, NULL); \ g_slist_foreach (assign, (GFunc) gst_parse_strfree, NULL); \
g_slist_free (assign); \ g_slist_free (assign); \
YYERROR; \ YYERROR; \
} else if (!bin) { \ } else if (!bin) { \
ERROR (GST_PARSE_ERROR_NO_SUCH_ELEMENT, "No bin \"%s\", omitting...", type); \ ERROR (GST_PARSE_ERROR_NO_SUCH_ELEMENT, _("no bin \"%s\", skipping"), type); \
g_slist_foreach (assign, (GFunc) gst_parse_strfree, NULL); \ g_slist_foreach (assign, (GFunc) gst_parse_strfree, NULL); \
g_slist_free (assign); \ g_slist_free (assign); \
res = chain; \ res = chain; \
@ -309,7 +315,7 @@ gst_parse_element_set (gchar *value, GstElement *element, graph_t *graph)
} }
g_object_set_property (G_OBJECT (element), value, &v); g_object_set_property (G_OBJECT (element), value, &v);
} else { } else {
ERROR (GST_PARSE_ERROR_NO_SUCH_PROPERTY, "No property \"%s\" in element \"%s\"", value, GST_ELEMENT_NAME (element)); ERROR (GST_PARSE_ERROR_NO_SUCH_PROPERTY, _("no property \"%s\" in element \"%s\""), value, GST_ELEMENT_NAME (element));
} }
out: out:
@ -318,12 +324,12 @@ out:
error: error:
ERROR (GST_PARSE_ERROR_COULD_NOT_SET_PROPERTY, ERROR (GST_PARSE_ERROR_COULD_NOT_SET_PROPERTY,
"Could not set property \"%s\" in element \"%s\" to \"%s\"", _("could not set property \"%s\" in element \"%s\" to \"%s\""),
value, GST_ELEMENT_NAME (element), pos); value, GST_ELEMENT_NAME (element), pos);
goto out; goto out;
error_conversion: error_conversion:
ERROR (GST_PARSE_ERROR_COULD_NOT_SET_PROPERTY, ERROR (GST_PARSE_ERROR_COULD_NOT_SET_PROPERTY,
"Could not convert \"%s\" so that it fits property \"%s\" in element \"%s\"", _("could not convert \"%s\" so that it fits property \"%s\" in element \"%s\""),
pos, value, GST_ELEMENT_NAME (element)); pos, value, GST_ELEMENT_NAME (element));
goto out; goto out;
} }
@ -502,7 +508,7 @@ success:
return 0; return 0;
error: error:
ERROR (GST_PARSE_ERROR_LINK, "could not link %s to %s", GST_ELEMENT_NAME (src), GST_ELEMENT_NAME (sink)); ERROR (GST_PARSE_ERROR_LINK, _("could not link %s to %s"), GST_ELEMENT_NAME (src), GST_ELEMENT_NAME (sink));
gst_parse_free_link (link); gst_parse_free_link (link);
return -1; return -1;
} }
@ -547,7 +553,7 @@ static int yyerror (const char *s);
element: IDENTIFIER { $$ = gst_element_factory_make ($1, NULL); element: IDENTIFIER { $$ = gst_element_factory_make ($1, NULL);
if (!$$) if (!$$)
ERROR (GST_PARSE_ERROR_NO_SUCH_ELEMENT, "No element \"%s\"", $1); ERROR (GST_PARSE_ERROR_NO_SUCH_ELEMENT, _("no element \"%s\""), $1);
gst_parse_strfree ($1); gst_parse_strfree ($1);
if (!$$) if (!$$)
YYERROR; YYERROR;
@ -598,7 +604,7 @@ link: linkpart LINK linkpart { $$ = $1;
if ($2) { if ($2) {
$$->caps = gst_caps_from_string ($2); $$->caps = gst_caps_from_string ($2);
if (!$$->caps) if (!$$->caps)
ERROR (GST_PARSE_ERROR_LINK, "could not parse caps \"%s\"", $2); ERROR (GST_PARSE_ERROR_LINK, _("could not parse caps \"%s\""), $2);
gst_parse_strfree ($2); gst_parse_strfree ($2);
} }
$$->sink_name = $3->src_name; $$->sink_name = $3->src_name;
@ -620,13 +626,13 @@ chain: element { $$ = gst_parse_chain_new ();
| bin { $$ = $1; } | bin { $$ = $1; }
| chain chain { if ($1->back && $2->front) { | chain chain { if ($1->back && $2->front) {
if (!$1->back->sink_name) { if (!$1->back->sink_name) {
ERROR (GST_PARSE_ERROR_LINK, "link without source element"); ERROR (GST_PARSE_ERROR_LINK, _("link without source element"));
gst_parse_free_link ($1->back); gst_parse_free_link ($1->back);
} else { } else {
((graph_t *) graph)->links = g_slist_prepend (((graph_t *) graph)->links, $1->back); ((graph_t *) graph)->links = g_slist_prepend (((graph_t *) graph)->links, $1->back);
} }
if (!$2->front->src_name) { if (!$2->front->src_name) {
ERROR (GST_PARSE_ERROR_LINK, "link without sink element"); ERROR (GST_PARSE_ERROR_LINK, _("link without sink element"));
gst_parse_free_link ($2->front); gst_parse_free_link ($2->front);
} else { } else {
((graph_t *) graph)->links = g_slist_prepend (((graph_t *) graph)->links, $2->front); ((graph_t *) graph)->links = g_slist_prepend (((graph_t *) graph)->links, $2->front);
@ -671,10 +677,10 @@ chain: element { $$ = gst_parse_chain_new ();
link_t *link = (link_t *) walk->data; link_t *link = (link_t *) walk->data;
walk = walk->next; walk = walk->next;
if (!link->sink_name && walk) { if (!link->sink_name && walk) {
ERROR (GST_PARSE_ERROR_LINK, "link without sink element"); ERROR (GST_PARSE_ERROR_LINK, _("link without sink element"));
gst_parse_free_link (link); gst_parse_free_link (link);
} else if (!link->src_name && !link->src) { } else if (!link->src_name && !link->src) {
ERROR (GST_PARSE_ERROR_LINK, "link without source element"); ERROR (GST_PARSE_ERROR_LINK, _("link without source element"));
gst_parse_free_link (link); gst_parse_free_link (link);
} else { } else {
if (walk) { if (walk) {
@ -690,7 +696,7 @@ chain: element { $$ = gst_parse_chain_new ();
| chain error { $$ = $1; } | chain error { $$ = $1; }
| link chain { if ($2->front) { | link chain { if ($2->front) {
if (!$2->front->src_name) { if (!$2->front->src_name) {
ERROR (GST_PARSE_ERROR_LINK, "link without source element"); ERROR (GST_PARSE_ERROR_LINK, _("link without source element"));
gst_parse_free_link ($2->front); gst_parse_free_link ($2->front);
} else { } else {
((graph_t *) graph)->links = g_slist_prepend (((graph_t *) graph)->links, $2->front); ((graph_t *) graph)->links = g_slist_prepend (((graph_t *) graph)->links, $2->front);
@ -708,7 +714,7 @@ chain: element { $$ = gst_parse_chain_new ();
gst_element_make_from_uri (GST_URI_SRC, $1, NULL); gst_element_make_from_uri (GST_URI_SRC, $1, NULL);
if (!element) { if (!element) {
ERROR (GST_PARSE_ERROR_NO_SUCH_ELEMENT, ERROR (GST_PARSE_ERROR_NO_SUCH_ELEMENT,
"No source element for URI \"%s\"", $1); _("no source element for URI \"%s\""), $1);
} else { } else {
$$->front->src = element; $$->front->src = element;
((graph_t *) graph)->links = g_slist_prepend ( ((graph_t *) graph)->links = g_slist_prepend (
@ -718,7 +724,7 @@ chain: element { $$ = gst_parse_chain_new ();
} }
} else { } else {
ERROR (GST_PARSE_ERROR_LINK, ERROR (GST_PARSE_ERROR_LINK,
"No element to link URI \"%s\" to", $1); _("no element to link URI \"%s\" to"), $1);
} }
g_free ($1); g_free ($1);
} }
@ -726,11 +732,11 @@ chain: element { $$ = gst_parse_chain_new ();
gst_element_make_from_uri (GST_URI_SINK, $2, NULL); gst_element_make_from_uri (GST_URI_SINK, $2, NULL);
if (!element) { if (!element) {
ERROR (GST_PARSE_ERROR_NO_SUCH_ELEMENT, ERROR (GST_PARSE_ERROR_NO_SUCH_ELEMENT,
"No sink element for URI \"%s\"", $2); _("no sink element for URI \"%s\""), $2);
YYERROR; YYERROR;
} else if ($1->sink_name || $1->sink_pads) { } else if ($1->sink_name || $1->sink_pads) {
ERROR (GST_PARSE_ERROR_LINK, ERROR (GST_PARSE_ERROR_LINK,
"could not link sink element for URI \"%s\"", $2); _("could not link sink element for URI \"%s\""), $2);
YYERROR; YYERROR;
} else { } else {
$$ = gst_parse_chain_new (); $$ = gst_parse_chain_new ();
@ -742,13 +748,13 @@ chain: element { $$ = gst_parse_chain_new ();
g_free ($2); g_free ($2);
} }
; ;
graph: /* NOP */ { ERROR (GST_PARSE_ERROR_EMPTY, "Empty pipeline not allowed"); graph: /* NOP */ { ERROR (GST_PARSE_ERROR_EMPTY, _("empty pipeline not allowed"));
$$ = (graph_t *) graph; $$ = (graph_t *) graph;
} }
| chain { $$ = (graph_t *) graph; | chain { $$ = (graph_t *) graph;
if ($1->front) { if ($1->front) {
if (!$1->front->src_name) { if (!$1->front->src_name) {
ERROR (GST_PARSE_ERROR_LINK, "link without source element"); ERROR (GST_PARSE_ERROR_LINK, _("link without source element"));
gst_parse_free_link ($1->front); gst_parse_free_link ($1->front);
} else { } else {
$$->links = g_slist_prepend ($$->links, $1->front); $$->links = g_slist_prepend ($$->links, $1->front);
@ -757,7 +763,7 @@ graph: /* NOP */ { ERROR (GST_PARSE_ERROR_EMPTY, "Empty pipeline not all
} }
if ($1->back) { if ($1->back) {
if (!$1->back->sink_name) { if (!$1->back->sink_name) {
ERROR (GST_PARSE_ERROR_LINK, "link without sink element"); ERROR (GST_PARSE_ERROR_LINK, _("link without sink element"));
gst_parse_free_link ($1->back); gst_parse_free_link ($1->back);
} else { } else {
$$->links = g_slist_prepend ($$->links, $1->back); $$->links = g_slist_prepend ($$->links, $1->back);

View file

@ -3,4 +3,5 @@
gst/gst.c gst/gst.c
gst/gsttag.c gst/gsttag.c
gst/elements/gsttypefindelement.c gst/elements/gsttypefindelement.c
gst/parse/grammar.y
tools/gst-launch.c tools/gst-launch.c

View file

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: gstreamer-0.7 0.7.0.1\n" "Project-Id-Version: gstreamer-0.7 0.7.0.1\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/\n"
"POT-Creation-Date: 2004-01-13 14:29+0100\n" "POT-Creation-Date: 2004-01-13 15:14+0100\n"
"PO-Revision-Date: 2003-10-08 15:36-0700\n" "PO-Revision-Date: 2003-10-08 15:36-0700\n"
"Last-Translator: David Schleef <ds@schleef.org>\n" "Last-Translator: David Schleef <ds@schleef.org>\n"
"Language-Team: Gnome Translators <i18n@gnome.org>\n" "Language-Team: Gnome Translators <i18n@gnome.org>\n"
@ -303,6 +303,80 @@ msgstr ""
msgid "maximum" msgid "maximum"
msgstr "" msgstr ""
#: gst/parse/grammar.y:164
#, c-format
msgid "specified empty bin \"%s\", not allowed"
msgstr ""
#: gst/parse/grammar.y:169
#, c-format
msgid "no bin \"%s\", skipping"
msgstr ""
#: gst/parse/grammar.y:313
#, c-format
msgid "no property \"%s\" in element \"%s\""
msgstr ""
#: gst/parse/grammar.y:322
#, c-format
msgid "could not set property \"%s\" in element \"%s\" to \"%s\""
msgstr ""
#: gst/parse/grammar.y:327
#, c-format
msgid ""
"could not convert \"%s\" so that it fits property \"%s\" in element \"%s\""
msgstr ""
#: gst/parse/grammar.y:506
#, c-format
msgid "could not link %s to %s"
msgstr ""
#: gst/parse/grammar.y:551
#, c-format
msgid "no element \"%s\""
msgstr ""
#: gst/parse/grammar.y:602
#, c-format
msgid "could not parse caps \"%s\""
msgstr ""
#: gst/parse/grammar.y:624 gst/parse/grammar.y:678 gst/parse/grammar.y:694
#: gst/parse/grammar.y:752
msgid "link without source element"
msgstr ""
#: gst/parse/grammar.y:630 gst/parse/grammar.y:675 gst/parse/grammar.y:761
msgid "link without sink element"
msgstr ""
#: gst/parse/grammar.y:712
#, c-format
msgid "no source element for URI \"%s\""
msgstr ""
#: gst/parse/grammar.y:722
#, c-format
msgid "no element to link URI \"%s\" to"
msgstr ""
#: gst/parse/grammar.y:730
#, c-format
msgid "no sink element for URI \"%s\""
msgstr ""
#: gst/parse/grammar.y:734
#, c-format
msgid "could not link sink element for URI \"%s\""
msgstr ""
#: gst/parse/grammar.y:746
msgid "empty pipeline not allowed"
msgstr ""
#: tools/gst-launch.c:60 #: tools/gst-launch.c:60
msgid "Execution ended after %" msgid "Execution ended after %"
msgstr "" msgstr ""
@ -347,12 +421,12 @@ msgstr ""
#: tools/gst-launch.c:109 #: tools/gst-launch.c:109
#, c-format #, c-format
msgid "ERROR: could not parse command line argument %d: %s" msgid "ERROR: could not parse command line argument %d: %s.\n"
msgstr "" msgstr ""
#: tools/gst-launch.c:119 #: tools/gst-launch.c:119
#, c-format #, c-format
msgid "WARNING: element named '%s' not found." msgid "WARNING: element named '%s' not found.\n"
msgstr "" msgstr ""
#: tools/gst-launch.c:254 #: tools/gst-launch.c:254
@ -398,7 +472,7 @@ msgstr ""
#: tools/gst-launch.c:410 #: tools/gst-launch.c:410
#, c-format #, c-format
msgid "ERROR: pipeline could not be constructed: %s\n" msgid "ERROR: pipeline could not be constructed: %s.\n"
msgstr "" msgstr ""
#: tools/gst-launch.c:414 #: tools/gst-launch.c:414

View file

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: GStreamer\n" "Project-Id-Version: GStreamer\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/\n"
"POT-Creation-Date: 2004-01-13 14:29+0100\n" "POT-Creation-Date: 2004-01-13 15:14+0100\n"
"PO-Revision-Date: 2004-01-13 12:03+0100\n" "PO-Revision-Date: 2004-01-13 12:03+0100\n"
"Last-Translator: Thomas Vander Stichele <thomas@apestaart.org>\n" "Last-Translator: Thomas Vander Stichele <thomas@apestaart.org>\n"
"Language-Team: Dutch <nl@li.org>\n" "Language-Team: Dutch <nl@li.org>\n"
@ -310,6 +310,82 @@ msgstr "minimum"
msgid "maximum" msgid "maximum"
msgstr "maximum" msgstr "maximum"
#: gst/parse/grammar.y:164
#, c-format
msgid "specified empty bin \"%s\", not allowed"
msgstr "lege ton \"%s\", niet toegelaten"
#: gst/parse/grammar.y:169
#, c-format
msgid "no bin \"%s\", skipping"
msgstr "geen ton \"%s\", overgeslagen"
#: gst/parse/grammar.y:313
#, c-format
msgid "no property \"%s\" in element \"%s\""
msgstr "geen eigenschap \"%s\" in element \"%s\""
#: gst/parse/grammar.y:322
#, c-format
msgid "could not set property \"%s\" in element \"%s\" to \"%s\""
msgstr "kon eigenschap \"%s\" in element \"%s\" niet op \"%s\" instellen"
#: gst/parse/grammar.y:327
#, c-format
msgid ""
"could not convert \"%s\" so that it fits property \"%s\" in element \"%s\""
msgstr ""
"kon \"%s\" niet omzetten zodat het in eigenschap \"%s\" in element \"%s\" "
"past"
#: gst/parse/grammar.y:506
#, c-format
msgid "could not link %s to %s"
msgstr "kon %s niet verbinden met %s"
#: gst/parse/grammar.y:551
#, c-format
msgid "no element \"%s\""
msgstr "geen element \"%s\""
#: gst/parse/grammar.y:602
#, c-format
msgid "could not parse caps \"%s\""
msgstr "kon mogelijkheden \"%s\" niet verwerken"
#: gst/parse/grammar.y:624 gst/parse/grammar.y:678 gst/parse/grammar.y:694
#: gst/parse/grammar.y:752
msgid "link without source element"
msgstr "verbinding zonder bronelement"
#: gst/parse/grammar.y:630 gst/parse/grammar.y:675 gst/parse/grammar.y:761
msgid "link without sink element"
msgstr "verbinding zonder doelelement"
#: gst/parse/grammar.y:712
#, c-format
msgid "no source element for URI \"%s\""
msgstr "geen bronelement voor URI \"%s\""
#: gst/parse/grammar.y:722
#, c-format
msgid "no element to link URI \"%s\" to"
msgstr "geen element om URI \"%s\" mee te verbinden"
#: gst/parse/grammar.y:730
#, c-format
msgid "no sink element for URI \"%s\""
msgstr "geen doelelement voor URI \"%s\""
#: gst/parse/grammar.y:734
#, c-format
msgid "could not link sink element for URI \"%s\""
msgstr "kon doelelement niet verbinden voor URI \"%s\""
#: gst/parse/grammar.y:746
msgid "empty pipeline not allowed"
msgstr "lege pijplijn niet toegelaten"
#: tools/gst-launch.c:60 #: tools/gst-launch.c:60
msgid "Execution ended after %" msgid "Execution ended after %"
msgstr "Uitvoering beëindigd na %" msgstr "Uitvoering beëindigd na %"
@ -356,14 +432,13 @@ msgstr ""
"moment." "moment."
#: tools/gst-launch.c:109 #: tools/gst-launch.c:109
#, c-format msgid "ERROR: could not parse command line argument %d: %s.\n"
msgid "ERROR: could not parse command line argument %d: %s" msgstr "FOUT: versta argument %d op commandoregel niet: %s.\n"
msgstr "FOUT: versta argument %d op commandoregel niet: %s"
#: tools/gst-launch.c:119 #: tools/gst-launch.c:119
#, c-format #, c-format
msgid "WARNING: element named '%s' not found." msgid "WARNING: element named '%s' not found.\n"
msgstr "WAARSCHUWING: element met naam '%s' niet gevonden." msgstr "WAARSCHUWING: element met naam '%s' niet gevonden.\n"
#: tools/gst-launch.c:254 #: tools/gst-launch.c:254
#, c-format #, c-format
@ -408,8 +483,8 @@ msgstr "Aantal keren om de pijplijn te herhalen"
#: tools/gst-launch.c:410 #: tools/gst-launch.c:410
#, c-format #, c-format
msgid "ERROR: pipeline could not be constructed: %s\n" msgid "ERROR: pipeline could not be constructed: %s.\n"
msgstr "FOUT: pijplijn kon niet gemaakt worden: %s\n" msgstr "FOUT: pijplijn kon niet gemaakt worden: %s.\n"
#: tools/gst-launch.c:414 #: tools/gst-launch.c:414
msgid "ERROR: pipeline could not be constructed.\n" msgid "ERROR: pipeline could not be constructed.\n"

View file

@ -106,7 +106,7 @@ xmllaunch_parse_cmdline (const gchar **argv)
value = strchr (element, '='); value = strchr (element, '=');
if (!(element < property && property < value)) { if (!(element < property && property < value)) {
fprintf (stderr, _("ERROR: could not parse command line argument %d: %s"), i, element); fprintf (stderr, _("ERROR: could not parse command line argument %d: %s.\n"), i, element);
g_free (element); g_free (element);
exit (1); exit (1);
} }
@ -116,7 +116,7 @@ xmllaunch_parse_cmdline (const gchar **argv)
e = gst_bin_get_by_name (GST_BIN (pipeline), element); e = gst_bin_get_by_name (GST_BIN (pipeline), element);
if (!e) { if (!e) {
fprintf (stderr, _("WARNING: element named '%s' not found."), element); fprintf (stderr, _("WARNING: element named '%s' not found.\n"), element);
} else { } else {
gst_util_set_object_arg (G_OBJECT (e), property, value); gst_util_set_object_arg (G_OBJECT (e), property, value);
} }
@ -407,7 +407,7 @@ main(int argc, char *argv[])
if (!pipeline) { if (!pipeline) {
if (error) { if (error) {
fprintf(stderr, _("ERROR: pipeline could not be constructed: %s\n"), fprintf(stderr, _("ERROR: pipeline could not be constructed: %s.\n"),
error->message); error->message);
g_error_free (error); g_error_free (error);
} else { } else {