From 2b6047f9529b6cde899e8bb208636f64e9e90ed9 Mon Sep 17 00:00:00 2001 From: John Ralls Date: Tue, 20 Mar 2018 11:41:21 -0700 Subject: [PATCH 1/2] Fix a string msgid generation. Call gettext in the macro, not on the macro. xgettext doesn't run cpp and can't see inside macros. --- src/gnome/gnc-plugin-page-account-tree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gnome/gnc-plugin-page-account-tree.c b/src/gnome/gnc-plugin-page-account-tree.c index ce67bd6f78..0d24978c1f 100644 --- a/src/gnome/gnc-plugin-page-account-tree.c +++ b/src/gnome/gnc-plugin-page-account-tree.c @@ -1162,9 +1162,9 @@ gnc_plugin_page_account_tree_cmd_delete_account (GtkAction *action, GncPluginPag list = qof_instance_get_referring_object_list(QOF_INSTANCE(account)); if (list != NULL) { -#define EXPLANATION "The list below shows objects which make use of the account which you want to delete.\nBefore you can delete it, you must either delete those objects or else modify them so they make use\nof another account" +#define EXPLANATION _("The list below shows objects which make use of the account which you want to delete.\nBefore you can delete it, you must either delete those objects or else modify them so they make use\nof another account") - gnc_ui_object_references_show( _(EXPLANATION), list); + gnc_ui_object_references_show (EXPLANATION, list); g_list_free(list); return; } From a670238f80a92552f7b4771be424f7fc382df69b Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Sun, 25 Mar 2018 15:47:35 +0800 Subject: [PATCH 2/2] Bug 794030 - relative date functions compute wrong day of month Convert > to < and rename month-length to month-days for consistency. --- src/app-utils/date-utilities.scm | 36 ++++++++++++++++---------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/app-utils/date-utilities.scm b/src/app-utils/date-utilities.scm index 72eb0f35ec..5ecd844a5e 100644 --- a/src/app-utils/date-utilities.scm +++ b/src/app-utils/date-utilities.scm @@ -718,10 +718,10 @@ (set-tm:mon now 11) (set-tm:year now (- (tm:year now) 1))) (set-tm:mon now (- (tm:mon now) 1))) - (let ((month-length (gnc:days-in-month (+ (tm:mon now) 1) - (+ (tm:year now) 1900)))) - (if (> month-length (tm:mday now)) - (set-tm:mday now month-length)) + (let ((month-days (gnc:days-in-month (+ (tm:mon now) 1) + (+ (tm:year now) 1900)))) + (if (< month-days (tm:mday now)) + (set-tm:mday now month-days)) (set-tm:isdst now -1) (gnc:date->timepair now)))) @@ -734,7 +734,7 @@ (set:tm-mon now (- (tm:mon now) 3)) (let ((month-days (gnc:days-in-month (+ (tm:mon now) 1) (+ (tm:year now) 1900)))) - (if (> month-days (tm:mday now)) + (if (< month-days (tm:mday now)) (set-tm:mday now month-days)) (set-tm:isdst now -1) (gnc:date->timepair now)))) @@ -748,7 +748,7 @@ (set:tm-mon now (- (tm:mon now) 6)) (let ((month-days (gnc:days-in-month (+ (tm:mon now) 1) (+ (tm:year now) 1900)))) - (if (> month-days (tm:mday now)) + (if (< month-days (tm:mday now)) (set-tm:mday now month-days)) (set-tm:isdst now -1) (gnc:date->timepair now)))) @@ -757,8 +757,8 @@ (let ((now (gnc-localtime (current-time)))) (set:tm-year now (- (tm:year now) 1)) (let ((month-days (gnc:days-in-month (+ (tm:mon now) 1) - (+ (tm:year now) 1900)))) - (if (> month-days (tm:mday now)) + (+ (tm:year now) 1900)))) + (if (< month-days (tm:mday now)) (set-tm:mday now month-days)) (set-tm:isdst now -1) (gnc:date->timepair now)))) @@ -770,10 +770,10 @@ (set-tm:mon now 0) (set-tm:year now (+ (tm:year now) 1))) (set-tm:mon now (+ (tm:mon now) 1))) - (let ((month-length (gnc:days-in-month (+ (tm:mon now) 1) - (+ (tm:year now) 1900)))) - (if (> month-length (tm:mday now)) - (set-tm:mday now month-length)) + (let ((month-days (gnc:days-in-month (+ (tm:mon now) 1) + (+ (tm:year now) 1900)))) + (if (< month-days (tm:mday now)) + (set-tm:mday now month-days)) (set-tm:isdst now -1) (gnc:date->timepair now)))) @@ -783,10 +783,10 @@ (begin (set:tm-mon now (- (tm:mon now) 9)) (set:tm-year now (+ (tm:year now) 1)) - (set:tm-mon now (+ (tm:mon now) 3)))) + (set:tm-mon now (+ (tm:mon now) 3)))) (let ((month-days (gnc:days-in-month (+ (tm:mon now) 1) (+ (tm:year now) 1900)))) - (if (> month-days (tm:mday now)) + (if (< month-days (tm:mday now)) (set-tm:mday now month-days)) (set-tm:isdst now -1) (gnc:date->timepair now)))) @@ -797,10 +797,10 @@ (begin (set:tm-mon now (- (tm:mon now) 6)) (set:tm-year now (+ (tm:year now) 1)) - (set:tm-mon now (+ (tm:mon now) 6)))) + (set:tm-mon now (+ (tm:mon now) 6)))) (let ((month-days (gnc:days-in-month (+ (tm:mon now) 1) (+ (tm:year now) 1900)))) - (if (> month-days (tm:mday now)) + (if (< month-days (tm:mday now)) (set-tm:mday now month-days)) (set-tm:isdst now -1) (gnc:date->timepair now)))) @@ -809,8 +809,8 @@ (let ((now (gnc-localtime (current-time)))) (set:tm-year now (+ (tm:year now) 1)) (let ((month-days (gnc:days-in-month (+ (tm:mon now) 1) - (+ (tm:year now) 1900)))) - (if (> month-days (tm:mday now)) + (+ (tm:year now) 1900)))) + (if (< month-days (tm:mday now)) (set-tm:mday now month-days)) (set-tm:isdst now -1) (gnc:date->timepair now))))