diff --git a/src/SplitLedger.c b/src/SplitLedger.c index 6f25950dec..322f7bc5b4 100644 --- a/src/SplitLedger.c +++ b/src/SplitLedger.c @@ -3670,7 +3670,7 @@ xaccSRGetLabelHandler (VirtualLocation virt_loc, gpointer user_data) return _("Description"); case RECN_CELL: - return _("Reconciled:R"+11); + return _("Reconciled:R") + 11; case SHRBALN_CELL: return _("Share Balance"); diff --git a/src/gnc-ui-util.c b/src/gnc-ui-util.c index 639ec918e9..c1096df4c2 100644 --- a/src/gnc-ui-util.c +++ b/src/gnc-ui-util.c @@ -268,10 +268,10 @@ gnc_get_reconcile_str (char reconciled_flag) { switch (reconciled_flag) { - case NREC: return _("not cleared:n"+12); - case CREC: return _("cleared:c"+8); - case YREC: return _("reconciled:y"+11); - case FREC: return _("frozen:f"+7); + case NREC: return _("not cleared:n") + 12; + case CREC: return _("cleared:c") + 8; + case YREC: return _("reconciled:y") + 11; + case FREC: return _("frozen:f") + 7; default: PERR("Bad reconciled flag\n"); return NULL; diff --git a/src/gnome/reconcile-list.c b/src/gnome/reconcile-list.c index afbda50b74..fd9851f7cd 100644 --- a/src/gnome/reconcile-list.c +++ b/src/gnome/reconcile-list.c @@ -135,7 +135,7 @@ gnc_reconcile_list_init(GNCReconcileList *list) _("Num"), _("Description"), _("Amount"), - _("Reconciled:R"+11), + _("Reconciled:R") + 11, NULL }; diff --git a/src/register/splitreg.c b/src/register/splitreg.c index 89f1a66770..9d8d68ba4e 100644 --- a/src/register/splitreg.c +++ b/src/register/splitreg.c @@ -81,28 +81,34 @@ struct _SplitRegisterBuffer CellBuffer notesCell; }; -static char *cell_sample_strings[] = +typedef struct { - N_("sample: 12/12/2000"+7), /* date cell */ - N_("sample:99999"+7), /* num cell */ - N_("sample:Description of a transaction"+7), /* desc cell */ - N_("Reconciled:R"+11), /* recn cell */ - N_("sample:999,999.000"+7), /* share balance cell */ - N_("sample:999,999.000"+7), /* balance cell */ - N_("Transfer"), /* action cell */ - N_("sample:Expenses:Automobile:Gasoline"+7), /* xfrm cell */ - N_("sample:Memo field sample text string"+7), /* memo cell */ - N_("sample:999,999.000"+7), /* credit cell */ - N_("sample:999,999.000"+7), /* debit cell */ - N_("sample:999,999.000"+7), /* price cell */ - N_("sample:999,999.000"+7), /* shares cell */ - N_("sample:Expenses:Automobile:Gasoline"+7), /* mxfrm cell */ - N_("sample:999,999.000"+7), /* tcredit cell */ - N_("sample:999,999.000"+7), /* tdebit cell */ - N_("sample:999,999.000"+7), /* tshares cell */ - N_("sample:999,999.000"+7), /* tshrbaln cell */ - N_("sample:999,999.000"+7), /* tbalance cell */ - N_("sample:Notes field sample text string"+7), /* notes cell */ + const char *string; + int offset; +} sample_string; + +static sample_string cell_sample_strings[] = +{ + { N_("sample: 12/12/2000"), 7}, /* date cell */ + { N_("sample:99999"), 7}, /* num cell */ + { N_("sample:Description of a transaction"), 7}, /* desc cell */ + { N_("Reconciled:R"), 11}, /* recn cell */ + { N_("sample:999,999.000"), 7}, /* share balance cell */ + { N_("sample:999,999.000"), 7}, /* balance cell */ + { N_("Transfer"), 0}, /* action cell */ + { N_("sample:Expenses:Automobile:Gasoline"), 7}, /* xfrm cell */ + { N_("sample:Memo field sample text string"), 7}, /* memo cell */ + { N_("sample:999,999.000"), 7}, /* credit cell */ + { N_("sample:999,999.000"), 7}, /* debit cell */ + { N_("sample:999,999.000"), 7}, /* price cell */ + { N_("sample:999,999.000"), 7}, /* shares cell */ + { N_("sample:Expenses:Automobile:Gasoline"), 7}, /* mxfrm cell */ + { N_("sample:999,999.000"), 7}, /* tcredit cell */ + { N_("sample:999,999.000"), 7}, /* tdebit cell */ + { N_("sample:999,999.000"), 7}, /* tshares cell */ + { N_("sample:999,999.000"), 7}, /* tshrbaln cell */ + { N_("sample:999,999.000"), 7}, /* tbalance cell */ + { N_("sample:Notes field sample text string"), 7}, /* notes cell */ }; static CellAlignment cell_alignments[] = @@ -248,6 +254,9 @@ set_cell (SplitRegister *reg, CellBlock *cursor, { CellBlockCell *cb_cell; BasicCell *hcell; + sample_string *ss; + + ss = &cell_sample_strings[cell_type]; cursor->start_col = MIN (cursor->start_col, col); cursor->stop_col = MAX (cursor->stop_col, col); @@ -262,7 +271,7 @@ set_cell (SplitRegister *reg, CellBlock *cursor, cb_cell->cell = reg->cells[cell_type]; cb_cell->cell_type = cell_type; cb_cell->label = g_strdup (hcell->value); - cb_cell->sample_text = g_strdup (_(cell_sample_strings[cell_type])); + cb_cell->sample_text = g_strdup (_(ss->string + ss->offset)); cb_cell->alignment = cell_alignments[cell_type]; cb_cell->expandable = reg->cells[cell_type] == (BasicCell *) reg->descCell; cb_cell->span = reg->cells[cell_type] == (BasicCell *) reg->memoCell; @@ -274,7 +283,7 @@ set_cell (SplitRegister *reg, CellBlock *cursor, cb_cell->cell = reg->cells[cell_type]; cb_cell->cell_type = cell_type; cb_cell->label = g_strdup (hcell->value); - cb_cell->sample_text = g_strdup (_(cell_sample_strings[cell_type])); + cb_cell->sample_text = g_strdup (_(ss->string + ss->offset)); cb_cell->alignment = cell_alignments[cell_type]; cb_cell->expandable = reg->cells[cell_type] == (BasicCell *) reg->descCell;