mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
More work with German tax categories.
2005-01-10 Christian Stimming <stimming@tuhh.de> * src/report/locale-specific/us/gncmod-locale-reports-us.c, src/tax/us/gncmod-tax-us.c: For German tax categories, make sure the module name will match the de_DE locale or will fall back to us module name all the time. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@10408 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
353ad4978a
commit
fed6508cbf
@ -1,3 +1,10 @@
|
|||||||
|
2005-01-10 Christian Stimming <stimming@tuhh.de>
|
||||||
|
|
||||||
|
* src/report/locale-specific/us/gncmod-locale-reports-us.c,
|
||||||
|
src/tax/us/gncmod-tax-us.c: For German tax categories, make sure
|
||||||
|
the module name will match the de_DE locale or will fall back to
|
||||||
|
us module name all the time.
|
||||||
|
|
||||||
2004-12-31 Derek Atkins <derek@ihtfp.com>
|
2004-12-31 Derek Atkins <derek@ihtfp.com>
|
||||||
|
|
||||||
John Ellson's patch to fix some gcc4 warnings (bug #162582).
|
John Ellson's patch to fix some gcc4 warnings (bug #162582).
|
||||||
|
@ -33,6 +33,10 @@ int libgncmod_locale_reports_us_LTX_gnc_module_end(int refcount);
|
|||||||
|
|
||||||
char *
|
char *
|
||||||
libgncmod_locale_reports_us_LTX_gnc_module_path(void) {
|
libgncmod_locale_reports_us_LTX_gnc_module_path(void) {
|
||||||
|
const char *thislocale = setlocale(LC_ALL, NULL);
|
||||||
|
if (strncmp(thislocale, "de_DE", 5) == 0)
|
||||||
|
return g_strdup("gnucash/report/locale-specific/de_DE");
|
||||||
|
else
|
||||||
return g_strdup("gnucash/report/locale-specific/us");
|
return g_strdup("gnucash/report/locale-specific/us");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,8 +47,22 @@ libgncmod_locale_reports_us_LTX_gnc_module_description(void) {
|
|||||||
|
|
||||||
int
|
int
|
||||||
libgncmod_locale_reports_us_LTX_gnc_module_init(int refcount) {
|
libgncmod_locale_reports_us_LTX_gnc_module_init(int refcount) {
|
||||||
/* load us tax info */
|
/* load the tax info */
|
||||||
if(!gnc_module_load("gnucash/tax/us", 0)) {
|
const char *thislocale = setlocale(LC_ALL, NULL);
|
||||||
|
/* This is a very simple hack that loads the (new, special) German
|
||||||
|
tax definition file in a German locale, or (default) loads the
|
||||||
|
previous US tax file. */
|
||||||
|
gboolean is_de_DE = (strncmp(thislocale, "de_DE", 5) == 0);
|
||||||
|
const char *tax_module = is_de_DE ?
|
||||||
|
"gnucash/tax/de_DE" :
|
||||||
|
"gnucash/tax/us";
|
||||||
|
const char *report_taxtxf = is_de_DE ?
|
||||||
|
"(use-modules (gnucash report taxtxf-de_DE))" :
|
||||||
|
"(use-modules (gnucash report taxtxf))";
|
||||||
|
|
||||||
|
/* The gchar* cast is only because the function declaration expects
|
||||||
|
a non-const string -- probably an api error. */
|
||||||
|
if(!gnc_module_load((gchar*)tax_module, 0)) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,21 +71,10 @@ libgncmod_locale_reports_us_LTX_gnc_module_init(int refcount) {
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *report_taxtxf;
|
|
||||||
/* This is a very simple hack that loads the (new, special) German
|
|
||||||
tax definition file in a German locale, or (default) loads the
|
|
||||||
previous US tax file. */
|
|
||||||
const char *thislocale = setlocale(LC_ALL, NULL);
|
|
||||||
if (strncmp(thislocale, "de_DE", 5) == 0) {
|
|
||||||
report_taxtxf = "(use-modules (gnucash report taxtxf-de_DE))";
|
|
||||||
} else {
|
|
||||||
report_taxtxf = "(use-modules (gnucash report taxtxf))";
|
|
||||||
}
|
|
||||||
|
|
||||||
/* load the report generation scheme code */
|
/* load the report generation scheme code */
|
||||||
if(scm_c_eval_string(report_taxtxf)
|
if(scm_c_eval_string(report_taxtxf)
|
||||||
== SCM_BOOL_F) {
|
== SCM_BOOL_F) {
|
||||||
printf("failed to load (gnucash report taxtxf)\n");
|
printf("failed to load %s\n", report_taxtxf);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,6 +33,10 @@ int libgncmod_tax_us_LTX_gnc_module_end(int refcount);
|
|||||||
|
|
||||||
char *
|
char *
|
||||||
libgncmod_tax_us_LTX_gnc_module_path(void) {
|
libgncmod_tax_us_LTX_gnc_module_path(void) {
|
||||||
|
const char *thislocale = setlocale(LC_ALL, NULL);
|
||||||
|
if (strncmp(thislocale, "de_DE", 5) == 0)
|
||||||
|
return g_strdup("gnucash/tax/de_DE");
|
||||||
|
else
|
||||||
return g_strdup("gnucash/tax/us");
|
return g_strdup("gnucash/tax/us");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user