diff options
Diffstat (limited to 'src/html.gram.y')
-rw-r--r-- | src/html.gram.y | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/html.gram.y b/src/html.gram.y index fae64ff..e488494 100644 --- a/src/html.gram.y +++ b/src/html.gram.y @@ -108,17 +108,17 @@ expr : value } | expr '+' expr { if ($1.type == unspecified_value || $3.type == unspecified_value) init_value (&$$, unspecified_value, NULL); else if ($1.type != $3.type) { - yyerror ("type mismatch in addition"); + yyerror (_("type mismatch in addition")); init_value (&$$, unspecified_value, NULL); } else { $$.type = $1.type; deduce_format (&$$, &$1, &$3); switch ($1.type) { @@ -140,102 +140,102 @@ expr : value } | expr '-' expr { if ($1.type == unspecified_value || $3.type == unspecified_value) init_value (&$$, unspecified_value, NULL); else if ($1.type != $3.type) { - yyerror ("type mismatch in subtraction"); + yyerror (_("type mismatch in subtraction")); init_value (&$$, unspecified_value, NULL); } else if ($1.type == string_value) { - yyerror ("subtraction not defined for strings"); + yyerror (_("subtraction not defined for strings")); init_value (&$$, unspecified_value, NULL); } else { $$.type = $1.type; deduce_format (&$$, &$1, &$3); $$.v.number = $1.v.number - $3.v.number; } } | expr '*' expr { if ($1.type == unspecified_value || $3.type == unspecified_value) init_value (&$$, unspecified_value, NULL); else if ($1.type != $3.type) { - yyerror ("type mismatch in multiplication"); + yyerror (_("type mismatch in multiplication")); init_value (&$$, unspecified_value, NULL); } else if ($1.type == string_value) { - yyerror ("multiplication not defined for strings"); + yyerror (_("multiplication not defined for strings")); init_value (&$$, unspecified_value, NULL); } else { $$.type = $1.type; deduce_format (&$$, &$1, &$3); $$.v.number = $1.v.number * $3.v.number; } } | expr '/' expr { if ($1.type == unspecified_value || $3.type == unspecified_value) init_value (&$$, unspecified_value, NULL); else if ($1.type != $3.type) { - yyerror ("type mismatch in division"); + yyerror (_("type mismatch in division")); init_value (&$$, unspecified_value, NULL); } else if ($1.type == string_value) { - yyerror ("division not defined for strings"); + yyerror (_("division not defined for strings")); init_value (&$$, unspecified_value, NULL); } else if (fabs ($3.v.number) < 1.0e-5) { - yyerror ("division by zero"); + yyerror (_("division by zero")); init_value (&$$, unspecified_value, NULL); } else { $$.type = $1.type; deduce_format (&$$, &$1, &$3); $$.v.number = $1.v.number / $3.v.number; } } | '-' expr %prec UMINUS { if ($2.type == unspecified_value) init_value (&$$, unspecified_value, NULL); else if ($2.type == string_value) { - yyerror ("unary minus not defined for strings"); + yyerror (_("unary minus not defined for strings")); init_value (&$$, unspecified_value, NULL); } else { $$ = $2; $$.v.number = - $2.v.number; } } | '+' expr %prec UMINUS { if ($2.type == unspecified_value) init_value (&$$, unspecified_value, NULL); else if ($2.type == string_value) { - yyerror ("unary plus not defined for strings"); + yyerror (_("unary plus not defined for strings")); init_value (&$$, unspecified_value, NULL); } else { $$ = $2; } } ; @@ -268,37 +268,37 @@ create_html (pp_tab_t *tab, char *file, char *dest) if (html_open (file)) return 1; tmp_file_name = mkfilename (NULL, dest, ".tmp"); tmp_file = fopen (tmp_file_name, "w"); if (!tmp_file) { - logmsg (L_ERR, "cannot open output file `%s': %s", + logmsg (L_ERR, _("cannot open output file `%s': %s"), file, strerror (errno)); html_close (); return 1; } ident_tab = tab; rc = yyparse (); fclose (tmp_file); if (rc == 0) { if (unlink (dest) && errno != ENOENT) { - logmsg (L_ERR, "cannot unlink file `%s': %s", + logmsg (L_ERR, _("cannot unlink file `%s': %s"), dest, strerror (errno)); rc = 1; } if (rename (tmp_file_name, dest)) { - logmsg (L_ERR, "cannot rename `%s' to `%s': %s", + logmsg (L_ERR, _("cannot rename `%s' to `%s': %s"), tmp_file_name, dest, strerror (errno)); rc = 1; } } free (tmp_file_name); return rc; } @@ -489,26 +489,26 @@ read_symtab (pp_tab_t **tab, const char *name) if (buf[0] == '#' || buf[0] == 0) continue; p = buf; cmd = *p++; if (*p != ' ' || !(isascii (*++p) && isalpha (*p))) { - logmsg (L_ERR, "%s:%u: invalid input: %s", + logmsg (L_ERR, _("%s:%u: invalid input: %s"), name, line, buf); status = 1; break; } var = p; p = strchr (var, ' '); if (!p) { - logmsg (L_ERR, "%s:%u: invalid input: %s", + logmsg (L_ERR, _("%s:%u: invalid input: %s"), name, line, buf); status = 1; break; } *p++ = 0; value = p; switch (cmd) @@ -518,27 +518,27 @@ read_symtab (pp_tab_t **tab, const char *name) break; case 'n': { char *p; double num = strtod (value, &p); if (*p) { - logmsg (L_ERR, "%s:%u: invalid numeric value: %s", + logmsg (L_ERR, _("%s:%u: invalid numeric value: %s"), name, line, value); status = 1; } else add_numeric_value (tab, var, num); } break; default: - logmsg (L_NOTICE, "%s:%u: ignoring unknown command %#03o", + logmsg (L_NOTICE, _("%s:%u: ignoring unknown command %#03o"), name, line, cmd); } } free (buf); fclose (fp); return status; } |