Move some strings from messages_i18n.h into the source files.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3045 57a11ea4-9604-0410-9ed3-97b8803252fd
zzzoldreleases/1.6
Dave Peticolas 26 years ago
parent 56cd25512d
commit d8f42ba2cc

@ -3,10 +3,17 @@
po/pseudo-source.c
po/guile_strings.txt
src/gnome/dialog-account.c
src/gnome/dialog-account-picker.c
src/gnome/dialog-fincalc.c
src/gnome/dialog-progress.c
src/gnome/dialog-qif-import.c
src/gnome/dialog-totd.c
src/gnome/glade-gnc-dialogs.c
src/gnome/print-session.c
src/gnome/window-main.c
src/gnome/window-reconcile.c
src/gnome/window-register.c
src/register/recncell.c
src/FileDialog.c
src/SplitLedger.c

@ -43,6 +43,13 @@
static Session *current_session = NULL;
static AccountGroup *topgroup = NULL; /* the current top of the hierarchy */
/* ======================================================== */
static const char *
file_not_found_msg (void)
{
return _("The file \n %s\n could not be found.");
}
/* ======================================================== */
@ -57,25 +64,33 @@ show_file_error (int io_error, char *newfile)
case ERR_FILEIO_NO_ERROR:
break;
case ERR_FILEIO_FILE_NOT_FOUND:
buf = g_strdup_printf (FILE_NOT_FOUND_MSG, newfile);
buf = g_strdup_printf (file_not_found_msg(), newfile);
gnc_error_dialog (buf);
uh_oh = TRUE;
break;
case ERR_FILEIO_FILE_EMPTY:
buf = g_strdup_printf (FILE_EMPTY_MSG, newfile);
buf = _("The file \n %s\n is empty.");
buf = g_strdup_printf (buf, newfile);
gnc_error_dialog (buf);
uh_oh = TRUE;
break;
case ERR_FILEIO_FILE_TOO_NEW:
gnc_error_dialog (FILE_TOO_NEW_MSG);
buf = _("This file appears to be from a newer version "
"of GnuCash. You must upgrade GnuCash to read "
"this file.");
gnc_error_dialog (buf);
uh_oh = TRUE;
break;
case ERR_FILEIO_FILE_TOO_OLD:
if (!gnc_verify_dialog (FILE_TOO_OLD_MSG, TRUE))
buf = _("This file is from an older version of "
"GnuCash.\nDo you want to continue?");
if (!gnc_verify_dialog (buf, TRUE))
uh_oh = TRUE;
break;
case ERR_FILEIO_FILE_BAD_READ:
if (!gnc_verify_dialog (FILE_BAD_READ_MSG, TRUE))
buf = _("There was an error reading the file.\n"
"Do you want to continue?");
if (!gnc_verify_dialog (buf, TRUE))
uh_oh = TRUE;
break;
default:
@ -102,7 +117,7 @@ show_session_error(Session *session, char *newfile)
}
else if (ERANGE == norr)
{
buf = g_strdup_printf (FILE_NOT_FOUND_MSG, newfile);
buf = g_strdup_printf (file_not_found_msg(), newfile);
gnc_error_dialog (buf);
uh_oh = TRUE;
}
@ -182,10 +197,10 @@ gncFileQuerySave (void)
while ( xaccGroupNotSaved (grp) )
{
GNCVerifyResult result;
const char *message = _("Changes have been made since the last "
"Save. Save the data to file?");
result = gnc_verify_cancel_dialog_parented( app,
FMB_SAVE_MSG,
GNC_VERIFY_YES );
result = gnc_verify_cancel_dialog_parented (app, message, GNC_VERIFY_YES);
if (result == GNC_VERIFY_CANCEL)
return FALSE;
@ -238,7 +253,7 @@ gncPostFileOpen (const char * filename)
if (!filename) return;
newfile = xaccResolveFilePath (filename);
if (!newfile) {
char *buf = g_strdup_printf (FILE_NOT_FOUND_MSG, filename);
char *buf = g_strdup_printf (file_not_found_msg(), filename);
gnc_error_dialog (buf);
g_free(buf);
return;
@ -281,7 +296,7 @@ gncPostFileOpen (const char * filename)
/* This is almost certainly not what the user wanted. */
if (!uh_oh && !newgrp && !io_error)
{
char *buf = g_strdup_printf (FILE_NOT_FOUND_MSG, newfile);
char *buf = g_strdup_printf (file_not_found_msg(), newfile);
gnc_error_dialog (buf);
g_free (buf);
uh_oh = TRUE;
@ -467,7 +482,7 @@ gncFileSaveAs (void)
*/
newfile = xaccResolveFilePath (filename);
if (!newfile) {
char *buf = g_strdup_printf (FILE_NOT_FOUND_MSG, filename);
char *buf = g_strdup_printf (file_not_found_msg(), filename);
gnc_error_dialog (buf);
g_free (buf);
return;

@ -2647,6 +2647,10 @@ xaccSRSaveChangedCells (SplitRegister *reg, Transaction *trans, Split *split)
int choice;
int default_value;
char *radio_list[4] = { NULL, NULL, NULL, NULL };
const char *title = _("Recalculate Transaction");
const char *message = _("The values entered for this transaction "
"are inconsistent.\nWhich value would you "
"like to have recalculated?");
if (MOD_SHRS & changed)
radio_list[0] = g_strdup_printf("%s (%s)", SHARES_STR, CHANGED_STR);
@ -2673,8 +2677,8 @@ xaccSRSaveChangedCells (SplitRegister *reg, Transaction *trans, Split *split)
default_value = 1;
choice = gnc_choose_radio_option_dialog_parented(xaccSRGetParent(reg),
TRANS_RECALC_TITLE,
TRANS_RECALC_MSG,
title,
message,
default_value,
radio_list);

@ -445,7 +445,7 @@ gnc_localeconv(void)
gnc_lconv_set(&lc.thousands_sep, ",");
gnc_lconv_set(&lc.grouping, "\003");
gnc_lconv_set(&lc.int_curr_symbol, "USD ");
gnc_lconv_set(&lc.currency_symbol, CURRENCY_SYMBOL);
gnc_lconv_set(&lc.currency_symbol, "$");
gnc_lconv_set(&lc.mon_decimal_point, ".");
gnc_lconv_set(&lc.mon_thousands_sep, ",");
gnc_lconv_set(&lc.mon_grouping, "\003");

@ -679,14 +679,16 @@ gnc_edit_account_ok(AccountWindow *aw)
name = gtk_entry_get_text(GTK_ENTRY(aw->name_entry));
if (safe_strcmp(name, "") == 0)
{
gnc_error_dialog_parented(GTK_WINDOW(aw->dialog), ACC_NO_NAME_MSG);
const char *message = _("The account must be given a name.");
gnc_error_dialog_parented(GTK_WINDOW(aw->dialog), message);
return;
}
/* check for valid type */
if (aw->type == BAD_TYPE)
{
gnc_error_dialog_parented(GTK_WINDOW(aw->dialog), ACC_TYPE_MSG);
const char *message = _("You must select an account type.");
gnc_error_dialog_parented(GTK_WINDOW(aw->dialog), message);
return;
}
@ -696,7 +698,8 @@ gnc_edit_account_ok(AccountWindow *aw)
/* Parent check, probably not needed, but be safe */
if (!gnc_filter_parent_accounts(new_parent, aw))
{
gnc_error_dialog_parented(GTK_WINDOW(aw->dialog), ACC_BAD_PARENT_MSG);
const char *message = _("You must choose a valid parent account.");
gnc_error_dialog_parented(GTK_WINDOW(aw->dialog), message);
return;
}
@ -798,7 +801,8 @@ gnc_new_account_ok (AccountWindow *aw)
name = gtk_entry_get_text(GTK_ENTRY(aw->name_entry));
if (safe_strcmp(name, "") == 0)
{
gnc_error_dialog_parented(GTK_WINDOW(aw->dialog), ACC_NO_NAME_MSG);
const char *message = _("The account must be given a name.");
gnc_error_dialog_parented(GTK_WINDOW(aw->dialog), message);
return;
}
@ -839,7 +843,8 @@ gnc_new_account_ok (AccountWindow *aw)
if (account != NULL)
{
gnc_error_dialog_parented(GTK_WINDOW(aw->dialog), ACC_DUP_NAME_MSG);
const char *message = _("There is already an account with that name.");
gnc_error_dialog_parented(GTK_WINDOW(aw->dialog), message);
return;
}
}
@ -847,7 +852,8 @@ gnc_new_account_ok (AccountWindow *aw)
/* check for valid type */
if (aw->type == BAD_TYPE)
{
gnc_error_dialog_parented(GTK_WINDOW(aw->dialog), ACC_TYPE_MSG);
const char *message = _("You must select an account type.");
gnc_error_dialog_parented(GTK_WINDOW(aw->dialog), message);
return;
}

@ -164,10 +164,12 @@ totd_next_cb(GtkWidget * widget, gpointer data)
static void
totd_close_cb(GtkWidget *widget, gpointer data)
{
gboolean new_enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(disable_cb));
gboolean new_enabled =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(disable_cb));
gtk_widget_destroy(GTK_WIDGET(win));
win = NULL;
if(new_enabled != old_enabled)
if (new_enabled != old_enabled)
{
gnc_set_boolean_option("General",
"Display \"Tip of the Day\"",
@ -175,7 +177,10 @@ totd_close_cb(GtkWidget *widget, gpointer data)
gnc_option_refresh_ui_by_name("General", "Display \"Tip of the Day\"");
if(new_enabled == FALSE)
{
gnc_info_dialog(REENABLE_TIPS_MSG);
const char *message = _("You have disabled \"Tip of the Day\"\n"
"You can re-enable tips from the General\n"
"section of the Preferences menu");
gnc_info_dialog(message);
}
}
return;

@ -475,6 +475,8 @@ static void
gnc_ui_about_cb (GtkWidget *widget, gpointer data)
{
GtkWidget *about;
const gchar *message = _("The GnuCash personal finance manager.\n"
"The GNU way to manage your money!");
const gchar *copyright = "(C) 1998-2000 Linas Vepstas";
const gchar *authors[] = {
"Linas Vepstas <linas@linas.org>",
@ -482,7 +484,7 @@ gnc_ui_about_cb (GtkWidget *widget, gpointer data)
};
about = gnome_about_new("GnuCash", VERSION, copyright,
authors, ABOUT_MSG, NULL);
authors, message, NULL);
gnome_dialog_run_and_close(GNOME_DIALOG(about));
}
@ -531,19 +533,26 @@ gnc_ui_delete_account_cb ( GtkWidget *widget, gpointer data )
if (account)
{
const gchar *name;
gchar *message;
const char *format = _("Are you sure you want to delete the %s account?");
char *message;
char *name;
name = xaccAccountGetName(account);
message = g_strdup_printf(ACC_DEL_SURE_MSG, name);
name = xaccAccountGetFullName(account, gnc_get_account_separator ());
message = g_strdup_printf(format, name);
if (gnc_verify_dialog(message, FALSE))
gnc_ui_delete_account(account);
g_free(message);
if (name)
free (name);
}
else
gnc_error_dialog(ACC_DEL_MSG);
{
const char *message = _("To delete an account, you must first\n"
"choose an account to delete.\n");
gnc_error_dialog(message);
}
}
static void
@ -554,7 +563,9 @@ gnc_ui_mainWindow_toolbar_open ( GtkWidget *widget, gpointer data )
if (account == NULL)
{
gnc_error_dialog(ACC_OPEN_MSG);
const char *message = _("To open an account, you must first\n"
"choose an account to open.");
gnc_error_dialog(message);
return;
}
@ -572,7 +583,9 @@ gnc_ui_mainWindow_toolbar_open_subs(GtkWidget *widget, gpointer data)
if (account == NULL)
{
gnc_error_dialog(ACC_OPEN_MSG);
const char *message = _("To open an account, you must first\n"
"choose an account to open.");
gnc_error_dialog(message);
return;
}
@ -594,7 +607,11 @@ gnc_ui_mainWindow_toolbar_edit ( GtkWidget *widget, gpointer data )
gnc_ui_edit_account_window_raise(edit_window_data);
}
else
gnc_error_dialog(ACC_EDIT_MSG);
{
const char *message = _("To edit an account, you must first\n"
"choose an account to edit.\n");
gnc_error_dialog(message);
}
}
static void
@ -609,7 +626,11 @@ gnc_ui_mainWindow_reconcile(GtkWidget *widget, gpointer data)
gnc_ui_reconcile_window_raise(recnData);
}
else
gnc_error_dialog(ACC_RECONCILE_MSG);
{
const char *message = _("To reconcile an account, you must first\n"
"choose an account to reconcile.");
gnc_error_dialog(message);
}
}
static void
@ -625,7 +646,8 @@ gnc_ui_mainWindow_scrub(GtkWidget *widget, gpointer data)
if (account == NULL)
{
gnc_error_dialog(ACC_SCRUB_MSG);
const char *message = _("You must select an account to scrub.");
gnc_error_dialog(message);
return;
}
@ -643,7 +665,8 @@ gnc_ui_mainWindow_scrub_sub(GtkWidget *widget, gpointer data)
if (account == NULL)
{
gnc_error_dialog(ACC_SCRUB_MSG);
const char *message = _("You must select an account to scrub.");
gnc_error_dialog(message);
return;
}

@ -1662,8 +1662,12 @@ recnFinishCB(GtkWidget *w, gpointer data)
time_t date;
if (!DEQ(recnRecalculateBalance(recnData), 0.0))
if (!gnc_verify_dialog_parented(recnData->window, RECN_BALN_WARN, FALSE))
{
const char *message = _("The account is not balanced.\n"
"Are you sure you want to finish?");
if (!gnc_verify_dialog_parented(recnData->window, message, FALSE))
return;
}
date = recnData->statement_date;

@ -2203,8 +2203,13 @@ gnc_transaction_delete_query(GtkWindow *parent)
gint pos = 0;
gint result;
gchar *usual = DEL_USUAL_MSG;
gchar *warn = DEL_WARN_MSG;
const char *usual = _("This selection will delete the whole "
"transaction. This is what you usually want.");
const char *warn = _("Warning: Just deleting all the splits will "
"make your account unbalanced. You probably "
"shouldn't do this unless you're going to "
"immediately add another split to bring the "
"transaction back into balance.");
DeleteType return_value;
@ -2228,20 +2233,25 @@ gnc_transaction_delete_query(GtkWindow *parent)
text = gtk_text_new(NULL, NULL);
trans_button = gtk_radio_button_new_with_label(NULL, DEL_TRANS_MSG);
trans_button =
gtk_radio_button_new_with_label(NULL,
_("Delete the whole transaction"));
gtk_object_set_user_data(GTK_OBJECT(trans_button), text);
gtk_box_pack_start(GTK_BOX(vbox), trans_button, TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT(trans_button), "toggled",
GTK_SIGNAL_FUNC(gnc_transaction_delete_toggle_cb), usual);
GTK_SIGNAL_FUNC(gnc_transaction_delete_toggle_cb),
(gpointer) usual);
group = gtk_radio_button_group(GTK_RADIO_BUTTON(trans_button));
splits_button = gtk_radio_button_new_with_label(group, DEL_SPLITS_MSG);
splits_button = gtk_radio_button_new_with_label(group,
_("Delete all the splits"));
gtk_object_set_user_data(GTK_OBJECT(splits_button), text);
gtk_box_pack_start(GTK_BOX(vbox), splits_button, TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT(splits_button), "toggled",
GTK_SIGNAL_FUNC(gnc_transaction_delete_toggle_cb), warn);
GTK_SIGNAL_FUNC(gnc_transaction_delete_toggle_cb),
(gpointer) warn);
gtk_box_pack_start(GTK_BOX(dvbox), frame, TRUE, TRUE, 0);

@ -55,69 +55,13 @@
/** MISC INTERNATIONALIZATION PIECES-PARTS: ******************************/
/* This will be used if localeconv cannot find a value. */
#define CURRENCY_SYMBOL _("$")
/** DIALOG BOX MESSAGES: ********************************************/
#define ABOUT_MSG _("The GnuCash personal finance manager.\n"\
"The GNU way to manage your money!")
#define ACC_ADJUST_MSG _("To adjust an account's balance, you must "\
"first\nchoose an account to adjust.\n")
#define ACC_BAD_PARENT_MSG _("You must choose a valid parent account.")
#define ACC_DUP_NAME_MSG _("There is already an account with that name.")
#define ACC_NEW_MSG _("Do you want to create a new account?\n"\
"If not, then please select an account\n"\
"to open in the main window.\n")
#define ACC_EDIT_MSG _("To edit an account, you must first\n"\
"choose an account to edit.\n")
#define ACC_DEL_MSG _("To delete an account, you must first\n"\
"choose an account to delete.\n")
#define ACC_DEL_SURE_MSG _("Are you sure you want to delete the %s account?")
#define ACC_NO_NAME_MSG _("The account must be given a name! \n")
#define ACC_OPEN_MSG _("To open an account, you must first\n"\
"choose an account to open.\n")
#define ACC_SCRUB_MSG _("You must select an account to scrub.")
#define ACC_TYPE_MSG _("You must select an account type.")
#define ACC_RECONCILE_MSG _("To reconcile an account, you must first\n"\
"choose an account to reconcile.\n")
#define AMOUNT_NUM_MSG _("The amount must be a number.")
#define BALANCE_NUM_MSG _("The balance must be a number.")
#define CHANGE_RECN_MSG _("Do you really want to mark this transaction "\
"not reconciled?\nDoing so might make future "\
"reconciliation difficult!")
#define DEL_SPLITS_MSG _("Delete all the splits")
#define DEL_TRANS_MSG _("Delete the whole transaction")
#define DEL_USUAL_MSG _("This selection will delete the whole "\
"transaction. This is what you usually want.")
#define DEL_WARN_MSG _("Warning: Just deleting all the splits will "\
"make your account unbalanced. You probably "\
"shouldn't do this unless you're going to "\
"immediately add another split to bring the "\
"transaction back into balance.")
#define EDIT_CURRENCY_MSG _("It is dangerous to change the currency type\n"\
"of an account. You asked to change it\n"\
"from %s to %s.\nAre You Sure?\n")
#define EDIT_SECURITY_MSG _("It is dangerous to change the security\n"\
"of an account. You asked to change it\n"\
"from %s to %s.\nAre You Sure?\n")
#define FILE_TOO_OLD_MSG _("This file is from an older version of "\
"GnuCash. \nDo you want to continue?")
#define FILE_TOO_NEW_MSG _("This file appears to be from a newer version "\
"of GnuCash. You must upgrade GnuCash to read "\
"this file.")
#define FILE_BAD_READ_MSG _("There was an error reading the file. \n"\
"Do you want to continue?")
#define FILE_EWRITE_MSG _("There was an error writing the file\n %s" \
"\n\n%s")
#define FILE_EOPEN_MSG _("There was an error opening the file\n %s" \
"\n\n%s")
#define FILE_ECLOSE_MSG _("There was an error closing the file\n %s" \
"\n\n%s")
#define FILE_NOT_FOUND_MSG _("The file \n %s\n could not be found.")
#define FILE_EMPTY_MSG _("The file \n %s\n is empty.")
#define FMB_SAVE_MSG _("Changes have been made since the last " \
"Save. Save the data to file?")
#define FMB_EEXIST_MSG _("The file \n %s\n already exists.\n" \
"Are you sure you want to overwrite it?")
#define FMB_INVALID_MSG _("The filepath \n %s\n" \
@ -126,23 +70,16 @@
"appears to be in use by another user.\n" \
"If this is not right, remove the .LCK file " \
"and try again.")
#define GNOME_PRINT_MSG _("You need to install the gnome-print library.")
#define QIF_LOAD_FAILED_FORMAT_MSG _("QIF file load failed:\n%s")
#define QIF_LOAD_WARNING_FORMAT_MSG _("QIF file load warning:\n%s")
#define QIF_PARSE_FAILED_FORMAT_MSG _("QIF file parse failed:\n%s")
#define QIF_PARSE_WARNING_FORMAT_MSG _("QIF file parse warning:\n%s")
#define QUOTE_SRC_MSG _("The source for price quotes")
#define RECN_BALN_WARN _("The account is not balanced.\n" \
"Are you sure you want to finish?")
#define RECN_CANCEL_WARN _("You have made changes to this reconcile " \
"window.\nAre you sure you want to cancel?")
#define RECN_TRANS_WARN _("Warning! This is a reconciled transaction. " \
"Do you want do continue?")
#define REENABLE_TIPS_MSG _("You have disabled \"Tip of the Day\"\n" \
"You can re-enable tips from the General\n" \
"section of the Preferences menu")
#define REG_CURR_MSG _("You cannot transfer funds from the %s " \
"account.\nIt does not have a matching " \
"currency.\nTo transfer funds between " \
@ -158,15 +95,6 @@
"from the transaction\n %s ?")
#define TRANS_DEL2_MSG _("Are you sure you want to delete the current "\
"transaction?")
#define TRANS_RECALC_TITLE _("Recalculate Transaction")
#define TRANS_RECALC_MSG _("The values entered for this transaction "\
"are inconsistent.\nWhich value would you "\
"like to have recalculated?\n")
#define TYPE_WARN1_MSG _("The types of all the parent accounts and their "\
"subaccounts must be changed to %s.\nIs that "\
"what you want to do?")
#define TYPE_WARN2_MSG _("The types of all the subaccounts must be "\
"changed to %s.\nIs that what you want to do?")
#define VERIFY_CHANGE_MSG _("The following changes must be made. Continue?")
#define XFER_NSF_MSG _("There must be at least two accounts\n"\
"created before you can transfer funds.")

@ -83,8 +83,13 @@ RecnEnter (BasicCell *_cell,
still perhaps not optimal. */
if (cell->reconciled_flag == YREC)
if (!gnc_verify_dialog(CHANGE_RECN_MSG, TRUE))
{
const char *message = _("Do you really want to mark this transaction "
"not reconciled?\nDoing so might make future "
"reconciliation difficult!");
if (!gnc_verify_dialog(message, TRUE))
return FALSE;
}
if (cell->reconciled_flag == NREC)
cell->reconciled_flag = CREC;

Loading…
Cancel
Save