diff --git a/libgnucash/app-utils/c-interface.scm b/libgnucash/app-utils/c-interface.scm index 650b871cca..4a1df47e93 100644 --- a/libgnucash/app-utils/c-interface.scm +++ b/libgnucash/app-utils/c-interface.scm @@ -88,6 +88,8 @@ ;; strings. Strings that are returned by the lookup function are ;; translated with gettext. (define (gnc:make-string-database) + (issue-deprecation-warning "gnc:make-string-database is deprecated. It \ +will be removed in GnuCash 5.x") (define string-hash (make-hash-table)) (lambda args (match args diff --git a/libgnucash/app-utils/date-utilities.scm b/libgnucash/app-utils/date-utilities.scm index 84c5706979..77b84afad2 100644 --- a/libgnucash/app-utils/date-utilities.scm +++ b/libgnucash/app-utils/date-utilities.scm @@ -30,7 +30,6 @@ (use-modules (gnucash core-utils)) (use-modules (gnucash utilities)) (use-modules (sw_app_utils)) -(use-modules (gnucash app-utils c-interface)) (use-modules (ice-9 match)) (export gnc:reldate-list) @@ -891,7 +890,15 @@ Defaulting to today.")) ;;one-month-ago three-months-ago six-months-ago one-year-ago ;;start-cur-fin-year start-prev-fin-year end-prev-fin-year -(define gnc:reldate-string-db (gnc:make-string-database)) + +(define (make-string-database) + (define string-hash (make-hash-table)) + (match-lambda* + (('lookup key) (G_ (hash-ref string-hash key))) + (('store key string) (hash-set! string-hash key string)) + (_ (gnc:warn "string-database: bad action")))) + +(define gnc:reldate-string-db (make-string-database)) (define gnc:relative-date-values #f) (unless gnc:relative-date-hash (gnc:reldate-string-db