From 738715858a0ca28ce4a85e0b556e09368e96cdf0 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Sat, 10 Nov 2018 21:46:24 +0100 Subject: Mark debugging messages as non-translatable --- src/colloquium.c | 7 ++-- src/debugger.c | 10 ++--- src/frame.c | 105 +++++++++++++++++++++++++------------------------ src/imagestore.c | 7 ++-- src/narrative_window.c | 10 ++--- src/pr_clock.c | 2 +- src/presentation.c | 8 ++-- src/render.c | 2 +- src/sc_editor.c | 26 ++++++------ src/sc_interp.c | 14 +++---- src/sc_parse.c | 28 ++++++------- src/stylesheet.c | 9 +++-- 12 files changed, 115 insertions(+), 113 deletions(-) (limited to 'src') diff --git a/src/colloquium.c b/src/colloquium.c index a8da4d9..02ffa0a 100644 --- a/src/colloquium.c +++ b/src/colloquium.c @@ -145,7 +145,7 @@ static GFile **gslist_to_array(GSList *item, int *n) while ( item != NULL ) { if ( i == len ) { - fprintf(stderr, _("WTF? Too many files\n")); + fprintf(stderr, "WTF? Too many files\n"); break; } files[i++] = item->data; @@ -169,7 +169,7 @@ static gint open_response_sig(GtkWidget *d, gint response, GApplication *papp) files = gtk_file_chooser_get_files(GTK_FILE_CHOOSER(d)); files_array = gslist_to_array(files, &n_files); if ( files_array == NULL ) { - fprintf(stderr, _("Failed to convert file list\n")); + fprintf(stderr, "Failed to convert file list\n"); return 0; } g_slist_free(files); @@ -274,7 +274,7 @@ static int yesno(const char *a) if ( strcasecmp(a, "no") == 0 ) return 0; if ( strcasecmp(a, "false") == 0 ) return 0; - fprintf(stderr, _("Don't understand '%s', assuming false\n"), a); + fprintf(stderr, "Don't understand '%s', assuming false\n", a); return 0; } @@ -341,7 +341,6 @@ static void colloquium_startup(GApplication *papp) * desktop environment. All the entries are already in the * normal menus, so don't let GTK create a fallback menu in the * menu bar. */ - printf(_("Using app menu\n")); GMenuModel *mmodel = G_MENU_MODEL(gtk_builder_get_object(app->builder, "app-menu")); gtk_application_set_app_menu(GTK_APPLICATION(app), mmodel); } diff --git a/src/debugger.c b/src/debugger.c index 12ef9d8..f15478a 100644 --- a/src/debugger.c +++ b/src/debugger.c @@ -86,13 +86,13 @@ static const char *str_type(enum para_type t) switch ( t ) { /* Text paragraph */ - case PARA_TYPE_TEXT : return _("text"); + case PARA_TYPE_TEXT : return "text"; /* Callback paragraph */ - case PARA_TYPE_CALLBACK : return _("callback"); + case PARA_TYPE_CALLBACK : return "callback"; /* Unknown paragraph type */ - default : return _("unknown"); + default : return "unknown"; } } @@ -104,14 +104,14 @@ static void debug_text_para(Paragraph *para, cairo_t *cr, double *ypos, nrun = para_debug_num_runs(para); /* How many text runs */ - snprintf(tmp, 255, _(" %i runs"), nrun); + snprintf(tmp, 255, " %i runs", nrun); plot_text(cr, ypos, fontdesc, tmp); for ( i=0; ichildren = NULL; n->max_children = 32; if ( alloc_ro(n) ) { - fprintf(stderr, _("Couldn't allocate children\n")); + fprintf(stderr, "Couldn't allocate children\n"); free(n); return NULL; } @@ -188,7 +188,7 @@ void show_frame_hierarchy(struct frame *fr, const char *t) strcpy(tn, t); strcat(tn, " "); - printf(_("%s%p (%.2f x %.2f)\n"), t, fr, fr->w, fr->h); + printf("%s%p (%.2f x %.2f)\n", t, fr, fr->w, fr->h); for ( i=0; inum_children; i++ ) { show_frame_hierarchy(fr->children[i], tn); @@ -216,12 +216,12 @@ struct frame *find_frame_with_scblocks(struct frame *fr, SCBlock *scblocks) static const char *text_for_run(const struct text_run *run) { if ( run == NULL ) { - fprintf(stderr, _("NULL run passed to text_for_run\n")); + fprintf(stderr, "NULL run passed to text_for_run\n"); return 0; } if ( run->scblock == NULL ) { - fprintf(stderr, _("NULL scblock in text_for_run\n")); + fprintf(stderr, "NULL scblock in text_for_run\n"); return 0; } @@ -236,12 +236,12 @@ static const char *text_for_run(const struct text_run *run) static size_t run_text_len(const struct text_run *run) { if ( run == NULL ) { - fprintf(stderr, _("NULL run passed to run_text_len\n")); + fprintf(stderr, "NULL run passed to run_text_len\n"); return 0; } if ( run->scblock == NULL ) { - fprintf(stderr, _("NULL scblock in run_text_len\n")); + fprintf(stderr, "NULL scblock in run_text_len\n"); return 0; } @@ -250,7 +250,7 @@ static size_t run_text_len(const struct text_run *run) } if ( sc_block_contents(run->scblock) == NULL ) { - fprintf(stderr, _("NULL scblock contents in run_text_len\n")); + fprintf(stderr, "NULL scblock contents in run_text_len\n"); return 0; } @@ -288,7 +288,7 @@ void wrap_paragraph(Paragraph *para, PangoContext *pc, double w, /* Allocate the complete text */ text = malloc(total_len+1); if ( text == NULL ) { - fprintf(stderr, _("Couldn't allocate combined text (%lli)\n"), + fprintf(stderr, "Couldn't allocate combined text (%lli)\n", (long long int)total_len); return; } @@ -375,7 +375,7 @@ void add_run(Paragraph *para, SCBlock *scblock, runs_new = realloc(para->runs, (para->n_runs+1)*sizeof(struct text_run)); if ( runs_new == NULL ) { - fprintf(stderr, _("Failed to add run.\n")); + fprintf(stderr, "Failed to add run.\n"); return; } @@ -433,7 +433,7 @@ Paragraph *insert_paragraph(struct frame *fr, int pos) int i; if ( pos >= fr->n_paras ) { - fprintf(stderr, _("insert_paragraph(): pos too high!\n")); + fprintf(stderr, "insert_paragraph(): pos too high!\n"); return NULL; } @@ -467,7 +467,7 @@ Paragraph *add_callback_para(struct frame *fr, SCBlock *bl, double w, double h, } else { pnew = create_paragraph(fr, bl); if ( pnew == NULL ) { - fprintf(stderr, _("Failed to add callback paragraph\n")); + fprintf(stderr, "Failed to add callback paragraph\n"); return NULL; } } @@ -495,7 +495,7 @@ void add_image_para(struct frame *fr, SCBlock *scblock, int wi, hi; if ( is == NULL ) { - fprintf(stderr, _("Adding image without ImageStore!\n")); + fprintf(stderr, "Adding image without ImageStore!\n"); return; } @@ -504,13 +504,14 @@ void add_image_para(struct frame *fr, SCBlock *scblock, } else { pnew = create_paragraph(fr, scblock); if ( pnew == NULL ) { - fprintf(stderr, _("Failed to add image paragraph\n")); + fprintf(stderr, "Failed to add image paragraph\n"); return; } } if ( imagestore_get_size(is, filename, &wi, &hi) ) { - fprintf(stderr, _("Couldn't get size for %s\n"), filename); + fprintf(stderr, _("Couldn't determine size of image '%s'\n"), + filename); wi = 100; hi = 100; } @@ -612,7 +613,7 @@ void render_paragraph(cairo_t *cr, Paragraph *para, ImageStore *is) if ( surf != NULL ) { render_from_surf(surf, cr, para->image_w, para->image_h, 0); } else { - printf(_("surf = NULL!\n")); + printf("surf = NULL!\n"); } break; @@ -656,7 +657,7 @@ static size_t text_para_pos(Paragraph *para, double x, double y, int *ptrail) void show_edit_pos(struct edit_pos a) { - printf(_("para %i, pos %li, trail %i\n"), a.para, (long int)a.pos, a.trail); + printf("para %i, pos %li, trail %i\n", a.para, (long int)a.pos, a.trail); } @@ -701,7 +702,7 @@ void ensure_run(struct frame *fr, struct edit_pos cpos) bl = sc_block_prepend(para->scblock, fr->scblocks); if ( bl == NULL ) { - fprintf(stderr, _("Couldn't prepend block\n")); + fprintf(stderr, "Couldn't prepend block\n"); return; } sc_block_set_contents(bl, strdup("")); @@ -727,7 +728,7 @@ int find_cursor(struct frame *fr, double x, double y, struct edit_pos *pos) int i; if ( fr == NULL ) { - fprintf(stderr, _("Cursor frame is NULL.\n")); + fprintf(stderr, "Cursor frame is NULL.\n"); return 1; } @@ -751,7 +752,7 @@ int find_cursor(struct frame *fr, double x, double y, struct edit_pos *pos) } if ( fr->n_paras == 0 ) { - printf(_("No paragraphs in frame.\n")); + printf("No paragraphs in frame.\n"); return 1; } @@ -772,12 +773,12 @@ int get_para_highlight(struct frame *fr, int cursor_para, double py = 0.0; if ( fr == NULL ) { - fprintf(stderr, _("Cursor frame is NULL.\n")); + fprintf(stderr, "Cursor frame is NULL.\n"); return 1; } if ( cursor_para >= fr->n_paras ) { - fprintf(stderr, _("Highlight paragraph number is too high!\n")); + fprintf(stderr, "Highlight paragraph number is too high!\n"); return 1; } @@ -803,12 +804,12 @@ int get_cursor_pos(struct frame *fr, int cursor_para, int cursor_pos, double py = 0.0; if ( fr == NULL ) { - fprintf(stderr, _("Cursor frame is NULL.\n")); + fprintf(stderr, "Cursor frame is NULL.\n"); return 1; } if ( cursor_para >= fr->n_paras ) { - fprintf(stderr, _("Cursor paragraph number is too high!\n")); + fprintf(stderr, "Cursor paragraph number is too high!\n"); return 1; } @@ -927,7 +928,7 @@ size_t pos_trail_to_offset(Paragraph *para, size_t offs, int trail) nrun = which_run(para, offs); if ( nrun == para->n_runs ) { - fprintf(stderr, _("pos_trail_to_offset: Offset too high\n")); + fprintf(stderr, "pos_trail_to_offset: Offset too high\n"); return 0; } @@ -940,20 +941,20 @@ size_t pos_trail_to_offset(Paragraph *para, size_t offs, int trail) if ( para->type != PARA_TYPE_TEXT ) return 0; if ( run == NULL ) { - fprintf(stderr, _("pos_trail_to_offset: No run\n")); + fprintf(stderr, "pos_trail_to_offset: No run\n"); return 0; } if ( run->scblock == NULL ) { - fprintf(stderr, _("pos_trail_to_offset: SCBlock = NULL?\n")); + fprintf(stderr, "pos_trail_to_offset: SCBlock = NULL?\n"); return 0; } /* Get the text for the run */ run_text = text_for_run(run); if ( run_text == NULL ) { - fprintf(stderr, _("pos_trail_to_offset: No contents " - "(%p name=%s, options=%s)\n"), + fprintf(stderr, "pos_trail_to_offset: No contents " + "(%p name=%s, options=%s)\n", run->scblock, sc_block_name(run->scblock), sc_block_options(run->scblock)); return 0; @@ -968,8 +969,8 @@ size_t pos_trail_to_offset(Paragraph *para, size_t offs, int trail) char_offs += trail; if ( char_offs > g_utf8_strlen(run_text, -1) ) { - printf(_("Offset outside string! '%s'\n" - "char_offs %li offs %li len %li\n"), + printf("Offset outside string! '%s'\n" + "char_offs %li offs %li len %li\n", run_text, (long int)char_offs, (long int)offs, (long int)g_utf8_strlen(run_text, -1)); } @@ -986,26 +987,26 @@ int position_editable(struct frame *fr, struct edit_pos cp) size_t paraoffs; if ( fr == NULL ) { - fprintf(stderr, _("Frame is NULL.\n")); + fprintf(stderr, "Frame is NULL.\n"); return 0; } if ( cp.para >= fr->n_paras ) { - fprintf(stderr, _("Paragraph number is too high!\n")); + fprintf(stderr, "Paragraph number is too high!\n"); return 0; } para = fr->paras[cp.para]; if ( para->type != PARA_TYPE_TEXT ) { - fprintf(stderr, _("Paragraph is not text.\n")); + fprintf(stderr, "Paragraph is not text.\n"); return 0; } paraoffs = pos_trail_to_offset(para, cp.pos, cp.trail); run = which_run(para, paraoffs); if ( run == para->n_runs ) { - fprintf(stderr, _("Couldn't find run!\n")); + fprintf(stderr, "Couldn't find run!\n"); return 0; } @@ -1022,12 +1023,12 @@ void insert_text_in_paragraph(Paragraph *para, size_t offs, const char *t) /* Find which run we are in */ nrun = which_run(para, offs); if ( nrun == para->n_runs ) { - fprintf(stderr, _("Couldn't find run to insert into.\n")); + fprintf(stderr, "Couldn't find run to insert into.\n"); return; } if ( para->n_runs == 0 ) { - printf(_("No runs in paragraph?\n")); + printf("No runs in paragraph?\n"); } else { struct text_run *run; size_t run_offs; @@ -1108,7 +1109,7 @@ static int pos_to_run_number(struct frame *fr, struct edit_pos p) static void delete_run(Paragraph *para, int nrun) { - printf(_("deleting run %i of %i from para %p\n"), nrun, para->n_runs, para); + printf("deleting run %i of %i from para %p\n", nrun, para->n_runs, para); memmove(¶->runs[nrun], ¶->runs[nrun+1], (para->n_runs-nrun-1)*sizeof(struct text_run)); para->n_runs--; @@ -1194,7 +1195,7 @@ static int paragraph_number(struct frame *fr, Paragraph *p, int *err) for ( i=0; in_paras; i++ ) { if ( fr->paras[i] == p ) return i; } - fprintf(stderr, _("Couldn't find paragraph %p\n"), p); + fprintf(stderr, "Couldn't find paragraph %p\n", p); *err = 1; return 0; } @@ -1216,11 +1217,11 @@ static void delete_paragraph(struct frame *fr, Paragraph *para, int *pnp) { int pn = find_para(fr, para); if ( pn == fr->n_paras ) { - fprintf(stderr, _("Couldn't find paragraph to delete (%p)\n"), para); + fprintf(stderr, "Couldn't find paragraph to delete (%p)\n", para); return; } - printf(_("deleting paragraph %i (%p)\n"), pn, para); + printf("deleting paragraph %i (%p)\n", pn, para); memmove(&fr->paras[pn], &fr->paras[pn+1], (fr->n_paras-pn-1)*sizeof(Paragraph *)); @@ -1247,7 +1248,7 @@ static void delete_run_for_scblock(struct frame *fr, para = find_run_for_scblock(fr, pn1, pn2, bl, &run); if ( para == NULL ) { - fprintf(stderr, _("Couldn't find block %p between paragraphs %p and %p\n"), + fprintf(stderr, "Couldn't find block %p between paragraphs %p and %p\n", bl, p1, p2); return; } @@ -1269,7 +1270,7 @@ static signed int merge_paragraph_runs(Paragraph *p1, Paragraph *p2) runs_new = realloc(p1->runs, (p1->n_runs+p2->n_runs)*sizeof(struct text_run)); if ( runs_new == NULL ) { - fprintf(stderr, _("Failed to allocate merged runs.\n")); + fprintf(stderr, "Failed to allocate merged runs.\n"); return -1; } p1->runs = runs_new; @@ -1312,7 +1313,7 @@ static void merge_paragraphs_by_newpara(struct frame *fr, SCBlock *np) show_para(p2); spos = merge_paragraph_runs(p1, p2); if ( spos < 0 ) { - fprintf(stderr, _("Failed to merge paragraphs\n")); + fprintf(stderr, "Failed to merge paragraphs\n"); return; } printf("-------------------------------\n"); @@ -1328,7 +1329,7 @@ static void merge_paragraphs_by_newpara(struct frame *fr, SCBlock *np) } } - fprintf(stderr, _("Couldn't find paragraphs to merge by newpara\n")); + fprintf(stderr, "Couldn't find paragraphs to merge by newpara\n"); } @@ -1388,7 +1389,7 @@ void delete_text_from_frame(struct frame *fr, struct edit_pos p1, struct edit_po } if ( !position_editable(fr, p1) || !position_editable(fr, p2) ) { - fprintf(stderr, _("Delete outside editable region\n")); + fprintf(stderr, "Delete outside editable region\n"); return; } @@ -1529,24 +1530,24 @@ void delete_text_from_frame(struct frame *fr, struct edit_pos p1, struct edit_po void show_para(Paragraph *p) { - printf(_("Paragraph %p\n"), p); + printf("Paragraph %p\n", p); if ( p->type == PARA_TYPE_TEXT ) { int i; - printf(_("%i runs:\n"), p->n_runs); + printf("%i runs:\n", p->n_runs); for ( i=0; in_runs; i++ ) { - printf(_(" Run %2i: SCBlock %p %s '%s'\n"), + printf(" Run %2i: SCBlock %p %s '%s'\n", i, p->runs[i].scblock, pango_font_description_to_string(p->runs[i].fontdesc), sc_block_contents(p->runs[i].scblock)); } } else if ( p->type == PARA_TYPE_IMAGE ) { - printf(_(" Image: %s\n"), p->filename); + printf(" Image: %s\n", p->filename); } else { - printf(_(" Other paragraph type\n")); + printf(" Other paragraph type\n"); } } @@ -1564,7 +1565,7 @@ static SCBlock *split_text_paragraph(struct frame *fr, int pn, size_t pos, pnew = insert_paragraph(fr, pn); if ( pnew == NULL ) { - fprintf(stderr, _("Failed to insert paragraph\n")); + fprintf(stderr, "Failed to insert paragraph\n"); return NULL; } @@ -1723,7 +1724,7 @@ int get_sc_pos(struct frame *fr, int pn, size_t pos, nrun = which_run(para, pos); if ( nrun == para->n_runs ) { - fprintf(stderr, _("Couldn't find run to insert into.\n")); + fprintf(stderr, "Couldn't find run to insert into.\n"); return 1; } run = ¶->runs[nrun]; diff --git a/src/imagestore.c b/src/imagestore.c index b6297b7..61ebcfb 100644 --- a/src/imagestore.c +++ b/src/imagestore.c @@ -213,7 +213,8 @@ static struct image_record *add_image_record(ImageStore *is, if ( is->n_images == is->max_images ) { if ( alloc_images(is, is->max_images+32) ) { - fprintf(stderr, _("Couldn't allocate memory.\n")); + fprintf(stderr, "Couldn't allocate memory for image " + "records.\n"); return NULL; } } @@ -327,11 +328,11 @@ void show_imagestore(ImageStore *is) { int i; - printf(_("Store %p contains %i records.\n"), is, is->n_images); + printf("Store %p contains %i records.\n", is, is->n_images); for ( i=0; in_images; i++ ) { - printf(_("%s :\n"), is->images[i].filename); + printf("%s :\n", is->images[i].filename); printf("\n"); } diff --git a/src/narrative_window.c b/src/narrative_window.c index 246dc1a..e0c59ef 100644 --- a/src/narrative_window.c +++ b/src/narrative_window.c @@ -141,7 +141,7 @@ static gint saveas_response_sig(GtkWidget *d, gint response, } else if ( gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(si->noss)) ) { /* Do nothing */ } else { - fprintf(stderr, _("Couldn't determine how to save stylesheet!\n")); + fprintf(stderr, "Couldn't determine where to save stylesheet!\n"); } if ( save_presentation(si->nw->p, file, ssfile) ) { @@ -230,7 +230,7 @@ static void delete_slide_sig(GSimpleAction *action, GVariant *parameter, /* Get the SCBlock corresponding to the slide */ ns = sc_editor_get_cursor_bvp(nw->sceditor); if ( ns == NULL ) { - fprintf(stderr, _("Not a slide!\n")); + fprintf(stderr, "Not a slide!\n"); return; } @@ -264,7 +264,7 @@ static gint load_ss_response_sig(GtkWidget *d, gint response, sc_editor_set_scblock(nw->sceditor, nw->dummy_top); } else { - fprintf(stderr, _("Failed to load\n")); + fprintf(stderr, _("Failed to load stylesheet\n")); } g_object_unref(file); @@ -349,7 +349,7 @@ static void add_slide_sig(GSimpleAction *action, GVariant *parameter, if ( nsblock != NULL ) { sc_block_append_p(nsblock, templ); } else { - fprintf(stderr, _("Failed to split paragraph\n")); + fprintf(stderr, "Failed to split paragraph\n"); } sc_editor_set_scblock(nw->sceditor, nw->dummy_top); @@ -801,7 +801,7 @@ NarrativeWindow *narrative_window_new(struct presentation *p, GApplication *papp Colloquium *app = COLLOQUIUM(papp); if ( p->narrative_window != NULL ) { - fprintf(stderr, _("Narrative window is already open!\n")); + fprintf(stderr, "Narrative window is already open!\n"); return NULL; } diff --git a/src/pr_clock.c b/src/pr_clock.c index f9fcbe4..8085c89 100644 --- a/src/pr_clock.c +++ b/src/pr_clock.c @@ -282,7 +282,7 @@ static void set_sig(GtkEditable *w, struct pr_clock *n) t = gtk_entry_get_text(GTK_ENTRY(n->entry)); n->time_allowed = 60.0 * strtod(t, &check); if ( check == t ) { - fprintf(stderr, _("Invalid time '%s'\n"), t); + fprintf(stderr, "Invalid time '%s'\n", t); n->time_allowed = 0.0; } diff --git a/src/presentation.c b/src/presentation.c index ae3f044..d7d9c08 100644 --- a/src/presentation.c +++ b/src/presentation.c @@ -240,7 +240,7 @@ SCBlock *first_slide(struct presentation *p) bl = sc_block_next(bl); } - fprintf(stderr, _("Couldn't find first slide!\n")); + fprintf(stderr, "Couldn't find first slide!\n"); return NULL; } @@ -258,7 +258,7 @@ SCBlock *last_slide(struct presentation *p) } if ( l == NULL ) { - fprintf(stderr, _("Couldn't find last slide!\n")); + fprintf(stderr, "Couldn't find last slide!\n"); } return l; } @@ -279,7 +279,7 @@ SCBlock *next_slide(struct presentation *p, SCBlock *sl) bl = sc_block_next(bl); } - fprintf(stderr, _("Couldn't find next slide!\n")); + fprintf(stderr, "Couldn't find next slide!\n"); return NULL; } @@ -300,7 +300,7 @@ SCBlock *prev_slide(struct presentation *p, SCBlock *sl) bl = sc_block_next(bl); } - fprintf(stderr, _("Couldn't find prev slide!\n")); + fprintf(stderr, "Couldn't find prev slide!\n"); return NULL; } diff --git a/src/render.c b/src/render.c index 3d46e7b..6ac09fc 100644 --- a/src/render.c +++ b/src/render.c @@ -195,7 +195,7 @@ struct frame *interp_and_shape(SCBlock *scblocks, Stylesheet *stylesheet, scin = sc_interp_new(pc, lang, is, top); if ( scin == NULL ) { - fprintf(stderr, _("Failed to set up interpreter.\n")); + fprintf(stderr, "Failed to set up interpreter.\n"); frame_free(top); return NULL; } diff --git a/src/sc_editor.c b/src/sc_editor.c index 47218d9..8e79fd8 100644 --- a/src/sc_editor.c +++ b/src/sc_editor.c @@ -70,7 +70,7 @@ static void debug_paragraphs(SCEditor *e) struct frame *fr = e->cursor_frame; int i; - printf(_("Paragraphs in current frame:\n")); + printf("Paragraphs in current frame:\n"); for ( i=0; in_paras; i++ ) { show_para(fr->paras[i]); } @@ -921,7 +921,7 @@ static void do_backspace(struct frame *fr, SCEditor *e) } else { /* FIXME: Implement this */ - fprintf(stderr, _("Deleting non-text paragraph\n")); + fprintf(stderr, "Deleting non-text paragraph\n"); } @@ -962,7 +962,7 @@ static void insert_text(char *t, SCEditor *e) /* Yes. The "easy" case */ if ( !position_editable(e->cursor_frame, e->cpos) ) { - fprintf(stderr, _("Position not editable\n")); + fprintf(stderr, "Position not editable\n"); return; } @@ -983,20 +983,20 @@ static void insert_text(char *t, SCEditor *e) bd = para_scblock(para); if ( bd == NULL ) { - fprintf(stderr, _("No SCBlock for para\n")); + fprintf(stderr, "No SCBlock for para\n"); return; } /* No. Create a new text paragraph straight afterwards */ ad = sc_block_insert_after(bd, NULL, NULL, strdup(t)); if ( ad == NULL ) { - fprintf(stderr, _("Failed to add SCBlock\n")); + fprintf(stderr, "Failed to add SCBlock\n"); return; } pnew = insert_paragraph(e->cursor_frame, e->cpos.para); if ( pnew == NULL ) { - fprintf(stderr, _("Failed to insert paragraph\n")); + fprintf(stderr, "Failed to insert paragraph\n"); return; } add_run(pnew, ad, e->cursor_frame->fontdesc, @@ -1576,7 +1576,7 @@ static gboolean button_release_sig(GtkWidget *da, GdkEventButton *event, { case DRAG_REASON_NONE : - printf(_("Release on pointless drag.\n")); + printf("Release on pointless drag.\n"); break; case DRAG_REASON_CREATE : @@ -1700,16 +1700,16 @@ static gboolean key_press_sig(GtkWidget *da, GdkEventKey *event, if ( event->state & GDK_CONTROL_MASK ) { debug_paragraphs(e); } else if ( event->state & GDK_SHIFT_MASK ) { - printf(_("Cursor frame block = %p\n"), e->cursor_frame->scblocks); - printf(_("Editor top block = %p\n"), e->scblocks); + printf("Cursor frame block = %p\n", e->cursor_frame->scblocks); + printf("Editor top block = %p\n", e->scblocks); show_sc_block(e->cursor_frame->scblocks, ""); } else { open_debugger(e->cursor_frame); } } else { if ( event->state & GDK_SHIFT_MASK ) { - printf(_("Debugging the top frame:\n")); - printf(_("Editor top block = %p\n"), e->scblocks); + printf("Debugging the top frame:\n"); + printf("Editor top block = %p\n", e->scblocks); show_sc_block(e->top->scblocks, ""); } } @@ -1913,7 +1913,7 @@ static void dnd_receive(GtkWidget *widget, GdkDragContext *drag_context, opts = malloc(len); if ( opts == NULL ) { free(filename); - fprintf(stderr, _("Failed to allocate SC\n")); + fprintf(stderr, "Failed to allocate SC\n"); return; } snprintf(opts, len, "1fx1f+0+0,filename=\"%s\"", @@ -2101,7 +2101,7 @@ void sc_editor_set_scale(SCEditor *e, int scale) void sc_editor_set_imagestore(SCEditor *e, ImageStore *is) { if ( e->is != NULL ) { - fprintf(stderr, _("WARNING: Changing imagestore\n")); + fprintf(stderr, "WARNING: Changing imagestore\n"); } e->is = is; } diff --git a/src/sc_interp.c b/src/sc_interp.c index 86084b0..0d65475 100644 --- a/src/sc_interp.c +++ b/src/sc_interp.c @@ -191,7 +191,7 @@ void sc_callback_list_add_callback(SCCallbackList *cbl, const char *name, if ( (names_new == NULL) || (box_funcs_new == NULL) || (vps_new == NULL) || (draw_funcs_new == NULL) || (click_funcs_new == NULL) ) { - fprintf(stderr, _("Failed to grow callback list\n")); + fprintf(stderr, "Failed to grow callback list\n"); return; } @@ -216,8 +216,8 @@ void sc_callback_list_add_callback(SCCallbackList *cbl, const char *name, void sc_interp_set_callbacks(SCInterpreter *scin, SCCallbackList *cbl) { if ( scin->cbl != NULL ) { - fprintf(stderr, _("WARNING: Interpreter already has a callback " - "list.\n")); + fprintf(stderr, "WARNING: Interpreter already has a callback " + "list.\n"); } scin->cbl = cbl; } @@ -304,7 +304,7 @@ static void update_font(SCInterpreter *scin) scin->pc, st->fontdesc); if ( st->font == NULL ) { char *f = pango_font_description_to_string(st->fontdesc); - fprintf(stderr, _("Couldn't load font '%s' (font map %p, pc %p)\n"), + fprintf(stderr, "Couldn't load font '%s' (font map %p, pc %p)\n", f, pango_context_get_font_map(scin->pc), scin->pc); g_free(f); return; @@ -325,7 +325,7 @@ static void set_font(SCInterpreter *scin, const char *font_name) st->fontdesc = pango_font_description_from_string(font_name); if ( st->fontdesc == NULL ) { - fprintf(stderr, _("Couldn't describe font.\n")); + fprintf(stderr, "Couldn't describe font.\n"); return; } @@ -508,7 +508,7 @@ void sc_interp_save(SCInterpreter *scin) stack_new = realloc(scin->state, sizeof(struct sc_state) * (scin->max_state+8)); if ( stack_new == NULL ) { - fprintf(stderr, _("Failed to add to stack.\n")); + fprintf(stderr, "Failed to add to stack.\n"); return; } @@ -776,7 +776,7 @@ static int parse_image_option(const char *opt, struct frame *parent, char *fn; fn = strdup(opt+10); if ( fn[strlen(fn)-1] != '\"' ) { - fprintf(stderr, _("Unterminated filename?\n")); + fprintf(stderr, "Unterminated filename?\n"); free(fn); return 1; } diff --git a/src/sc_parse.c b/src/sc_parse.c index e1b797a..78f5799 100644 --- a/src/sc_parse.c +++ b/src/sc_parse.c @@ -113,7 +113,7 @@ SCBlock *sc_block_prepend(SCBlock *bl, SCBlock *top) prev = sc_find_previous(top, bl); if ( prev == NULL ) { - fprintf(stderr, _("Couldn't find previous\n")); + fprintf(stderr, "Couldn't find previous\n"); return NULL; } @@ -271,11 +271,11 @@ static int sc_block_unlink(SCBlock **top, SCBlock *deleteme) if ( parent == NULL ) { /* Maybe it's the first block? */ if ( *top == deleteme ) { - fprintf(stderr, _("Unlinking at top\n")); + fprintf(stderr, "Unlinking at top\n"); *top = (*top)->next; return 0; } else { - fprintf(stderr, _("Couldn't find block parent!\n")); + fprintf(stderr, "Couldn't find block parent!\n"); return 1; } } @@ -411,12 +411,12 @@ int save_sc_block(GOutputStream *fh, const SCBlock *bl) char *a = serialise_sc_block(bl); gssize r; if ( a == NULL ) { - fprintf(stderr, _("Failed to serialise block\n")); + fprintf(stderr, "Failed to serialise block\n"); return 1; } r = g_output_stream_write(fh, a, strlen(a), NULL, &error); if ( r == -1 ) { - fprintf(stderr, _("Write failed: %s\n"), error->message); + fprintf(stderr, "Write failed: %s\n", error->message); return 1; } free(a); @@ -539,7 +539,7 @@ static size_t read_block(const char *sc, char **pname, char **options, i += get_subexpr(sc+i+1, "[]", options, err) + 1; if ( *err ) { - printf(_("Couldn't find end of options '%s'\n"), sc+i); + printf("Couldn't find end of options '%s'\n", sc+i); return 0; } @@ -551,7 +551,7 @@ static size_t read_block(const char *sc, char **pname, char **options, i += get_subexpr(sc+i+1, "{}", contents, err) + 1; if ( *err ) { - printf(_("Couldn't find end of content '%s'\n"), sc+i); + printf("Couldn't find end of content '%s'\n", sc+i); return 0; } @@ -648,7 +648,7 @@ SCBlock *sc_parse(const char *sc) bl = sc_block_append(bl, NULL, NULL, strdup(tbuf), &blf); if ( bl == NULL ) { - fprintf(stderr, _("Block add failed.\n")); + fprintf(stderr, "Block add failed.\n"); sc_block_free(blf); free(tbuf); return NULL; @@ -666,7 +666,7 @@ SCBlock *sc_parse(const char *sc) bl = sc_block_append(bl, name, opt, contents, &blf); if ( bl == NULL ) { - fprintf(stderr, _("Block add failed.\n")); + fprintf(stderr, "Block add failed.\n"); sc_block_free(blf); free(tbuf); return NULL; @@ -691,7 +691,7 @@ SCBlock *sc_parse(const char *sc) tbuf[j] = '\0'; bl = sc_block_append(bl, NULL, NULL, tbuf, &blf); if ( bl == NULL ) { - fprintf(stderr, _("Block add failed.\n")); + fprintf(stderr, "Block add failed.\n"); sc_block_free(blf); free(tbuf); return NULL; @@ -708,7 +708,7 @@ SCBlock *sc_parse(const char *sc) void sc_block_set_name(SCBlock *bl, char *nam) { if ( bl == NULL ) { - fprintf(stderr, _("sc_block_set_name: NULL block\n")); + fprintf(stderr, "sc_block_set_name: NULL block\n"); return; } free(bl->name); @@ -788,7 +788,7 @@ size_t scblock_delete_text(SCBlock *b, ssize_t o1, ssize_t o2) size_t len; if ( b->contents == NULL ) { - fprintf(stderr, _("Deleting text from block \\%s\n"), b->name); + fprintf(stderr, "Deleting text from block \\%s\n", b->name); return 0; } @@ -801,7 +801,7 @@ size_t scblock_delete_text(SCBlock *b, ssize_t o1, ssize_t o2) len = strlen(b->contents); if ( o2 < 0 ) o2 = len; if ( (o1 >= o2) || (o1 > len) || (o2 > len) ) { - fprintf(stderr, _("Invalid delete: %i %i %i\n"), + fprintf(stderr, "Invalid delete: %i %i %i\n", (int)o1, (int)o2, (int)len); return 0; } @@ -823,7 +823,7 @@ SCBlock *sc_block_split(SCBlock *bl, size_t pos) SCBlock *n = sc_block_new(); if ( bl->child != NULL ) { - fprintf(stderr, _("Splitting a block with a child!\n")); + fprintf(stderr, "Splitting a block with a child!\n"); return NULL; } diff --git a/src/stylesheet.c b/src/stylesheet.c index 51e8bd4..a6e2531 100644 --- a/src/stylesheet.c +++ b/src/stylesheet.c @@ -67,7 +67,7 @@ int parse_colour_duo(const char *a, GdkRGBA *col1, GdkRGBA *col2) cpos = find_comma(acopy); if ( cpos == 0 ) { - fprintf(stderr, _("Invalid bg gradient spec '%s'\n"), a); + fprintf(stderr, _("Invalid background gradient '%s'\n"), a); return 1; } @@ -110,7 +110,8 @@ Stylesheet *stylesheet_load(GFile *file) r = json_parser_load_from_data(parser, everything, len, &err); if ( r == FALSE ) { - fprintf(stderr, "Failed to load style sheet: '%s'\n", err->message); + fprintf(stderr, _("Failed to load stylesheet: %s\n"), + err->message); free(ss); return NULL; } @@ -195,7 +196,7 @@ int stylesheet_set(Stylesheet *ss, const char *path, const char *key, int r = 1; if ( ss == NULL ) { - fprintf(stderr, _("No stylesheet!\n")); + fprintf(stderr, "No stylesheet!\n"); return 1; } @@ -218,7 +219,7 @@ int stylesheet_delete(Stylesheet *ss, const char *path, const char *key) int r = 1; if ( ss == NULL ) { - fprintf(stderr, _("No stylesheet!\n")); + fprintf(stderr, "No stylesheet!\n"); return 1; } -- cgit v1.2.3