From c312b865d19aeaa7688bff37ae5d07c641481efd Mon Sep 17 00:00:00 2001 From: Geert Janssens Date: Tue, 31 May 2011 15:03:09 +0200 Subject: [PATCH] Bug 619899 - Use normal gettext or intltool toolchain also for scm files --- .gitignore | 1 - Makefile.am | 6 +- configure.ac | 1 - intl-scm/Makefile.am | 22 ------- intl-scm/xgettext.scm | 75 ----------------------- make-gnucash-potfiles.in | 3 +- po/POTFILES.in | 126 ++++++++++++++++++++++++++++++++++++++- po/POTFILES.skip | 80 +------------------------ 8 files changed, 131 insertions(+), 183 deletions(-) delete mode 100644 intl-scm/Makefile.am delete mode 100644 intl-scm/xgettext.scm diff --git a/.gitignore b/.gitignore index 11c67282fc..a7551c8a34 100644 --- a/.gitignore +++ b/.gitignore @@ -40,7 +40,6 @@ doc/tip_of_the_day.list gnucash-*.*.*.tar.* gnucash-*.*.*/ install-sh -intl-scm/guile-strings.c intltool-extract intltool-extract.in intltool-merge diff --git a/Makefile.am b/Makefile.am index 8c1a3b0cdd..432800fb4f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,5 @@ -SUBDIRS = . doc lib src intl-scm packaging po accounts checks +SUBDIRS = . doc lib src packaging po accounts checks GNC_CTAGS_FILE = @GNC_CTAGS_FILE@ GNC_ETAGS_FILE = @GNC_ETAGS_FILE@ @@ -190,10 +190,8 @@ $(srcdir)/po/POTFILES.in: make-gnucash-potfiles .potfiles # Creation rules so that po/gnucash.pot can always be created for # make dist. -po/gnucash.pot: po/POTFILES.in intl-scm/guile-strings.c +po/gnucash.pot: po/POTFILES.in ${MAKE} -C po gnucash.pot -intl-scm/guile-strings.c: - ${MAKE} -C intl-scm guile-strings.c .potfiles: diff --git a/configure.ac b/configure.ac index 015fc8998a..dd504a634f 100644 --- a/configure.ac +++ b/configure.ac @@ -1426,7 +1426,6 @@ AC_CONFIG_FILES( checks/Makefile doc/Makefile doc/examples/Makefile - intl-scm/Makefile lib/Makefile lib/libc/Makefile lib/stf/Makefile diff --git a/intl-scm/Makefile.am b/intl-scm/Makefile.am deleted file mode 100644 index b6772ac288..0000000000 --- a/intl-scm/Makefile.am +++ /dev/null @@ -1,22 +0,0 @@ -abs_top_srcdir=@abs_top_srcdir@ - -EXTRA_DIST = \ - guile-strings.c \ - xgettext.scm - -# Cause automake to generate correct rules -# for maintainers -noinst_HEADERS = guile-strings.c - -BUILT_SOURCES = guile-strings.c - -SCMFILES = $(shell find ${abs_top_srcdir}/src -name test -prune -o -name '*.scm' -print | sort) - -if BUILDING_FROM_SCM -# This needs to be generated in srcdir -guile-strings.c: $(SCMFILES) - rm -f guile-strings.c - cd ${srcdir} && rm -f guile-strings.c \ - && ${GUILE} -s ./xgettext.scm ${abs_top_srcdir} $(SCMFILES) - -endif diff --git a/intl-scm/xgettext.scm b/intl-scm/xgettext.scm deleted file mode 100644 index 8e70cce30e..0000000000 --- a/intl-scm/xgettext.scm +++ /dev/null @@ -1,75 +0,0 @@ -;; Find translatable strings in guile files -(define *base-dir-len* 0) - -(define (expand-newlines string out-port) - (define (output-prefix-newlines chars) - (if (and (pair? chars) (char=? (car chars) #\newline)) - (begin - (display "\\n" out-port) - (output-prefix-newlines (cdr chars))) - chars)) - - (let loop ((chars (string->list string)) - (accum '())) - (cond - ((null? chars) - (if (not (null? accum)) - (write (list->string (reverse accum)) out-port))) - ((char=? (car chars) #\newline) - (write (list->string (reverse accum)) out-port) - (display "\"" out-port) - (set! chars (output-prefix-newlines chars)) - (display "\"" out-port) - (if (not (null? chars)) - (display "\n " out-port)) - (loop chars '())) - (else - (loop (cdr chars) (cons (car chars) accum)))))) - -(define (write-string string out-port filename line-number) - (display (string-append "/* " (substring filename *base-dir-len*)) out-port) - ;;(display line-number out-port) - (display " */\n" out-port) - (display "_(" out-port) - (expand-newlines string out-port) - (display ")\n" out-port)) - -(define (find-strings-in-item item out-port filename line-no) - (define (find-internal rest) - (cond - ((and (list? rest) ; if it's a list - (= (length rest) 2) ; of length 2 - (symbol? (car rest)) ; starting with a symbol - (string? (cadr rest)) ; and ending with a string - (or (eqv? '_ (car rest)) ; and the symbol is _ - (eqv? 'N_ (car rest)))) ; or N_ - (write-string (cadr rest) out-port filename line-no)) ; then write it out - - ((pair? rest) ; otherwise, recurse - (find-internal (car rest)) - (find-internal (cdr rest))))) - - (find-internal item)) - -(define (count-newlines string) - (define (count-internal from) - (let ((index (string-index string #\newline from))) - (if index - (+ 1 (count-internal (+ 1 index))) - 0))) - (count-internal 0)) - -(define (find-strings in-port out-port filename) - (do ((item (read in-port) (read in-port)) - (line-no 1 (+ 1 line-no))) - ((eof-object? item) #t) - (find-strings-in-item item out-port filename line-no))) - -(let ((out-port (open "guile-strings.c" (logior O_WRONLY O_CREAT O_TRUNC))) - (base-dir (cadr (command-line))) - (in-files (cddr (command-line)))) - (set! *base-dir-len* (+ (string-length base-dir) 1)) - (for-each (lambda (file) - (call-with-input-file file (lambda (port) - (find-strings port out-port file)))) - in-files)) diff --git a/make-gnucash-potfiles.in b/make-gnucash-potfiles.in index 65ce1cab87..c370cb9e4e 100644 --- a/make-gnucash-potfiles.in +++ b/make-gnucash-potfiles.in @@ -20,7 +20,7 @@ my @ignored_files = `grep -v \# @-SRCDIR-@/po/POTFILES.ignore`; my @possible_files = `cd @-SRCDIR-@ && find src -name '*.c' -o -name '*.glade' \\ -o -name '*.desktop.in' -o -name '*.keys.in' \\ - -o -name '*.gschema.xml.in.in' |sort`; + -o -name '*.gschema.xml.in.in' -o -name '*.scm' | sort`; ## For perl files add the following: # -o -name '*.pl' @@ -60,5 +60,4 @@ print "src/gnome/gnucash.appdata.xml.in\n"; print "src/gnome/gnucash.desktop.in.in\n"; print "src/libqof/qof/gnc-date.c\n"; print "src/libqof/qof/qofbookslots.h\n"; -print "intl-scm/guile-strings.c\n"; print "doc/tip_of_the_day.list.in\n"; diff --git a/po/POTFILES.in b/po/POTFILES.in index fcb1a5ad67..672be03f7e 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -1,10 +1,17 @@ # This is a list of files which contain translatable strings. # This file was generated by ../make-gnucash-potfiles. +src/app-utils/app-utils.scm src/app-utils/business-helpers.c src/app-utils/business-options.c +src/app-utils/business-options.scm +src/app-utils/business-prefs.scm src/app-utils/calculation/expression_parser.c src/app-utils/calculation/fin.c +src/app-utils/c-interface.scm +src/app-utils/config-var.scm +src/app-utils/date-utilities.scm src/app-utils/file-utils.c +src/app-utils/gettext.scm src/app-utils/gfec.c src/app-utils/gnc-accounting-period.c src/app-utils/gnc-account-merge.c @@ -24,8 +31,13 @@ src/app-utils/gnc-sx-instance-model.c src/app-utils/gnc-ui-balances.c src/app-utils/gnc-ui-util.c src/app-utils/guile-util.c +src/app-utils/hooks.scm +src/app-utils/migrate-prefs.scm +src/app-utils/options.scm src/app-utils/option-util.c +src/app-utils/prefs.scm src/app-utils/QuickFill.c +src/app-utils/simple-obj.scm src/backend/dbi/gnc-backend-dbi.c src/backend/sql/escape.c src/backend/sql/gnc-account-sql.c @@ -85,6 +97,7 @@ src/backend/xml/sixtp-stack.c src/backend/xml/sixtp-to-dom-parser.c src/backend/xml/sixtp-utils.c src/bin/gnucash-bin.c +src/business/business-gnome/business-gnome.scm src/business/business-gnome/business-gnome-utils.c src/business/business-gnome/business-options-gnome.c src/business/business-gnome/business-urls.c @@ -123,6 +136,7 @@ src/business/business-ledger/gncEntryLedgerLayout.c src/business/business-ledger/gncEntryLedgerLoad.c src/business/business-ledger/gncEntryLedgerModel.c src/core-utils/binreloc.c +src/core-utils/core-utils.scm src/core-utils/gnc-environment.c src/core-utils/gnc-features.c src/core-utils/gnc-filepath-utils.c @@ -137,9 +151,14 @@ src/core-utils/gnc-prefs.c src/core-utils/gnc-uri-utils.c src/doc/doxygen_main_page.c src/engine/Account.c +src/engine/business-core.scm src/engine/cap-gains.c src/engine/cashobjects.c +src/engine/commodity-table.scm src/engine/engine-helpers.c +src/engine/engine-interface.scm +src/engine/engine.scm +src/engine/engine-utilities.scm src/engine/glib-helpers.c src/engine/gncAddress.c src/engine/gncBillTerm.c @@ -158,6 +177,7 @@ src/engine/gncInvoice.c src/engine/gncJob.c src/engine/gnc-lot.c src/engine/gncmod-engine.c +src/engine/gnc-numeric.scm src/engine/gncOrder.c src/engine/gncOwner.c src/engine/gnc-pricedb.c @@ -179,6 +199,7 @@ src/engine/SX-ttinfo.c src/engine/Transaction.c src/engine/TransLog.c src/gnc-module/gnc-module.c +src/gnc-module/gnc-module.scm src/gnome/assistant-acct-period.c src/gnome/assistant-hierarchy.c src/gnome/assistant-loan.c @@ -301,6 +322,7 @@ src/gnome-utils/gnc-icons.c src/gnome-utils/gnc-keyring.c src/gnome-utils/gnc-main-window.c src/gnome-utils/gnc-menu-extensions.c +src/gnome-utils/gnc-menu-extensions.scm src/gnome-utils/gncmod-gnome-utils.c src/gnome-utils/gnc-period-select.c src/gnome-utils/gnc-plugin.c @@ -331,6 +353,7 @@ src/gnome-utils/gnc-tree-view-price.c src/gnome-utils/gnc-tree-view-split-reg.c src/gnome-utils/gnc-tree-view-sx-list.c src/gnome-utils/gnc-window.c +src/gnome-utils/gnome-utils.scm [type: gettext/gsettings]src/gnome-utils/gschemas/org.gnucash.history.gschema.xml.in.in [type: gettext/gsettings]src/gnome-utils/gschemas/org.gnucash.warnings.gschema.xml.in.in src/gnome-utils/gtkbuilder/assistant-xml-encoding.glade @@ -425,6 +448,15 @@ src/import-export/qif-imp/dialog-account-picker.glade src/import-export/qif-imp/gncmod-qif-import.c src/import-export/qif-imp/gnc-plugin-qif-import.c [type: gettext/gsettings]src/import-export/qif-imp/gschemas/org.gnucash.dialogs.import.qif.gschema.xml.in.in +src/import-export/qif-imp/qif-dialog-utils.scm +src/import-export/qif-imp/qif-file.scm +src/import-export/qif-imp/qif-guess-map.scm +src/import-export/qif-imp/qif-import.scm +src/import-export/qif-imp/qif-merge-groups.scm +src/import-export/qif-imp/qif-objects.scm +src/import-export/qif-imp/qif-parse.scm +src/import-export/qif-imp/qif-to-gnc.scm +src/import-export/qif-imp/qif-utils.scm src/import-export/qif/qif-context.c src/import-export/qif/qif-file.c src/import-export/qif/qif-objects.c @@ -508,7 +540,25 @@ src/register/register-gnome/gnucash-style.c src/register/register-gnome/pricecell-gnome.c src/register/register-gnome/quickfillcell-gnome.c src/register/register-gnome/table-gnome.c +src/report/business-reports/aging.scm +src/report/business-reports/balsheet-eg.eguile.scm +src/report/business-reports/balsheet-eg.scm +src/report/business-reports/business-reports.scm +src/report/business-reports/customer-summary.scm +src/report/business-reports/easy-invoice.scm +src/report/business-reports/fancy-invoice.scm +src/report/business-reports/invoice.scm +src/report/business-reports/job-report.scm +src/report/business-reports/owner-report.scm +src/report/business-reports/payables.scm +src/report/business-reports/receivables.scm +src/report/business-reports/taxinvoice.eguile.scm +src/report/business-reports/taxinvoice.scm +src/report/locale-specific/us/de_DE.scm src/report/locale-specific/us/gncmod-locale-reports-us.c +src/report/locale-specific/us/taxtxf-de_DE.scm +src/report/locale-specific/us/taxtxf.scm +src/report/locale-specific/us/us.scm src/report/report-gnome/dialog-custom-report.c src/report/report-gnome/dialog-custom-report.glade src/report/report-gnome/dialog-report-column-view.c @@ -516,17 +566,91 @@ src/report/report-gnome/dialog-report.glade src/report/report-gnome/dialog-report-style-sheet.c src/report/report-gnome/gncmod-report-gnome.c src/report/report-gnome/gnc-plugin-page-report.c +src/report/report-gnome/report-gnome.scm src/report/report-gnome/window-report.c +src/report/report-system/collectors.scm +src/report/report-system/commodity-utilities.scm +src/report/report-system/eguile-gnc.scm +src/report/report-system/eguile-html-utilities.scm +src/report/report-system/eguile-utilities.scm src/report/report-system/gncmod-report-system.c src/report/report-system/gnc-report.c +src/report/report-system/html-acct-table.scm +src/report/report-system/html-barchart.scm +src/report/report-system/html-document.scm +src/report/report-system/html-fonts.scm +src/report/report-system/html-jqplot.scm +src/report/report-system/html-linechart.scm +src/report/report-system/html-piechart.scm +src/report/report-system/html-scatter.scm +src/report/report-system/html-style-info.scm +src/report/report-system/html-style-sheet.scm +src/report/report-system/html-table.scm +src/report/report-system/html-text.scm +src/report/report-system/html-utilities.scm +src/report/report-system/list-extras.scm +src/report/report-system/options-utilities.scm +src/report/report-system/report-collectors.scm +src/report/report-system/report.scm +src/report/report-system/report-system.scm +src/report/report-system/report-utilities.scm +src/report/standard-reports/account-piecharts.scm +src/report/standard-reports/account-summary.scm +src/report/standard-reports/advanced-portfolio.scm +src/report/standard-reports/average-balance.scm +src/report/standard-reports/balance-sheet.scm +src/report/standard-reports/budget-balance-sheet.scm +src/report/standard-reports/budget-barchart.scm +src/report/standard-reports/budget-flow.scm +src/report/standard-reports/budget-income-statement.scm +src/report/standard-reports/budget.scm +src/report/standard-reports/cash-flow.scm +src/report/standard-reports/category-barchart.scm +src/report/standard-reports/daily-reports.scm +src/report/standard-reports/equity-statement.scm +src/report/standard-reports/general-journal.scm +src/report/standard-reports/general-ledger.scm src/report/standard-reports/gncmod-standard-reports.c +src/report/standard-reports/income-statement.scm +src/report/standard-reports/net-barchart.scm +src/report/standard-reports/net-linechart.scm +src/report/standard-reports/portfolio.scm +src/report/standard-reports/price-scatter.scm +src/report/standard-reports/register.scm +src/report/standard-reports/standard-reports.scm +src/report/standard-reports/sx-summary.scm +src/report/standard-reports/transaction.scm +src/report/standard-reports/trial-balance.scm src/report/stylesheets/gncmod-stylesheets.c src/report/stylesheets/gnc-plugin-stylesheets.c +src/report/stylesheets/stylesheet-easy.scm +src/report/stylesheets/stylesheet-fancy.scm +src/report/stylesheets/stylesheet-footer.scm +src/report/stylesheets/stylesheet-plain.scm +src/report/stylesheets/stylesheets.scm src/report/utility-reports/gncmod-utility-reports.c +src/report/utility-reports/hello-world.scm +src/report/utility-reports/utility-reports.scm +src/report/utility-reports/view-column.scm +src/report/utility-reports/welcome-to-gnucash.scm +src/scm/fin.scm +src/scm/gnumeric/gnumeric-utilities.scm +src/scm/gnumeric/table-utils.scm +src/scm/main.scm +src/scm/price-quotes.scm +src/scm/printf.scm +src/scm/string.scm +src/scm/substring-search.scm +src/scm/xml-generator.scm +src/tax/us/de_DE.scm src/tax/us/gncmod-tax-us.c +src/tax/us/txf-de_DE.scm +src/tax/us/txf-help-de_DE.scm +src/tax/us/txf-help.scm +src/tax/us/txf.scm +src/tax/us/us.scm src/gnome/gnucash.appdata.xml.in src/gnome/gnucash.desktop.in.in src/libqof/qof/gnc-date.c src/libqof/qof/qofbookslots.h -intl-scm/guile-strings.c doc/tip_of_the_day.list.in diff --git a/po/POTFILES.skip b/po/POTFILES.skip index a3d3331af2..f16640cdef 100644 --- a/po/POTFILES.skip +++ b/po/POTFILES.skip @@ -19,34 +19,16 @@ src/libqof/qof/qofquery-deserial.c src/libqof/qof/qofquery-serialize.c src/libqof/qof/qofsql.c -# The scheme files are handled by intl-scm/guile-strings.c because -# intltool wouldn't scan scheme files. They're here now because -# intltool 0.50 *does* scan them, and it creates an error during make -# check. Once the whole world has upgraded to intltool 0.50, intl-scm -# can be deleted and these files added to POTFILES.in. +# Skip softlinks to scm files. These softlinks are created +# for testing purposes. Unfortunately distcheck doesn't appear +# smart enough to ignore them. -src/app-utils/app-utils.scm -src/app-utils/business-prefs.scm -src/app-utils/date-utilities.scm src/app-utils/gnucash/app-utils.scm -src/app-utils/prefs.scm -src/import-export/qif-imp/qif-dialog-utils.scm -src/import-export/qif-imp/qif-file.scm src/import-export/qif-imp/qif-import/qif-dialog-utils.scm src/import-export/qif-imp/qif-import/qif-file.scm src/import-export/qif-imp/qif-import/qif-merge-groups.scm src/import-export/qif-imp/qif-import/qif-parse.scm src/import-export/qif-imp/qif-import/qif-to-gnc.scm -src/import-export/qif-imp/qif-merge-groups.scm -src/import-export/qif-imp/qif-parse.scm -src/import-export/qif-imp/qif-to-gnc.scm -src/report/business-reports/aging.scm -src/report/business-reports/balsheet-eg.eguile.scm -src/report/business-reports/balsheet-eg.scm -src/report/business-reports/business-reports.scm -src/report/business-reports/customer-summary.scm -src/report/business-reports/easy-invoice.scm -src/report/business-reports/fancy-invoice.scm src/report/business-reports/gnucash/report/aging.scm src/report/business-reports/gnucash/report/balsheet-eg.eguile.scm src/report/business-reports/gnucash/report/balsheet-eg.scm @@ -61,44 +43,10 @@ src/report/business-reports/gnucash/report/payables.scm src/report/business-reports/gnucash/report/receivables.scm src/report/business-reports/gnucash/report/taxinvoice.eguile.scm src/report/business-reports/gnucash/report/taxinvoice.scm -src/report/business-reports/invoice.scm -src/report/business-reports/job-report.scm -src/report/business-reports/owner-report.scm -src/report/business-reports/payables.scm -src/report/business-reports/receivables.scm -src/report/business-reports/taxinvoice.eguile.scm -src/report/business-reports/taxinvoice.scm src/report/locale-specific/us/gnucash/report/taxtxf-de_DE.scm src/report/locale-specific/us/gnucash/report/taxtxf.scm -src/report/locale-specific/us/taxtxf-de_DE.scm -src/report/locale-specific/us/taxtxf.scm src/report/report-gnome/gnucash/report/report-gnome.scm -src/report/report-gnome/report-gnome.scm -src/report/report-system/eguile-gnc.scm src/report/report-system/gnucash/report/eguile-gnc.scm -src/report/report-system/html-acct-table.scm -src/report/report-system/html-fonts.scm -src/report/report-system/html-style-sheet.scm -src/report/report-system/html-utilities.scm -src/report/report-system/options-utilities.scm -src/report/report-system/report-utilities.scm -src/report/report-system/report.scm -src/report/standard-reports/account-piecharts.scm -src/report/standard-reports/account-summary.scm -src/report/standard-reports/advanced-portfolio.scm -src/report/standard-reports/average-balance.scm -src/report/standard-reports/balance-sheet.scm -src/report/standard-reports/budget-balance-sheet.scm -src/report/standard-reports/budget-barchart.scm -src/report/standard-reports/budget-flow.scm -src/report/standard-reports/budget-income-statement.scm -src/report/standard-reports/budget.scm -src/report/standard-reports/cash-flow.scm -src/report/standard-reports/category-barchart.scm -src/report/standard-reports/daily-reports.scm -src/report/standard-reports/equity-statement.scm -src/report/standard-reports/general-journal.scm -src/report/standard-reports/general-ledger.scm src/report/standard-reports/gnucash/report/standard-reports/account-piecharts.scm src/report/standard-reports/gnucash/report/standard-reports/account-summary.scm src/report/standard-reports/gnucash/report/standard-reports/advanced-portfolio.scm @@ -124,36 +72,14 @@ src/report/standard-reports/gnucash/report/standard-reports/register.scm src/report/standard-reports/gnucash/report/standard-reports/sx-summary.scm src/report/standard-reports/gnucash/report/standard-reports/transaction.scm src/report/standard-reports/gnucash/report/standard-reports/trial-balance.scm -src/report/standard-reports/income-statement.scm -src/report/standard-reports/net-barchart.scm -src/report/standard-reports/net-linechart.scm -src/report/standard-reports/portfolio.scm -src/report/standard-reports/price-scatter.scm -src/report/standard-reports/register.scm -src/report/standard-reports/sx-summary.scm -src/report/standard-reports/transaction.scm -src/report/standard-reports/trial-balance.scm src/report/stylesheets/gnucash/report/stylesheet-easy.scm src/report/stylesheets/gnucash/report/stylesheet-fancy.scm src/report/stylesheets/gnucash/report/stylesheet-footer.scm src/report/stylesheets/gnucash/report/stylesheet-plain.scm -src/report/stylesheets/stylesheet-easy.scm -src/report/stylesheets/stylesheet-fancy.scm -src/report/stylesheets/stylesheet-footer.scm -src/report/stylesheets/stylesheet-plain.scm src/report/utility-reports/gnucash/report/hello-world.scm src/report/utility-reports/gnucash/report/view-column.scm src/report/utility-reports/gnucash/report/welcome-to-gnucash.scm -src/report/utility-reports/hello-world.scm -src/report/utility-reports/view-column.scm -src/report/utility-reports/welcome-to-gnucash.scm src/scm/build-config.scm src/scm/build-config.scm.in -src/scm/command-line.scm src/scm/gnucash/price-quotes.scm -src/scm/main-window.scm -src/scm/price-quotes.scm -src/tax/us/de_DE.scm src/tax/us/gnucash/tax/de_DE.scm -src/tax/us/txf-de_DE.scm -src/tax/us/txf.scm