Backend configuration support

Derek Atkins warlord at MIT.EDU
Mon Aug 22 19:17:11 EDT 2005


I'm trying to wrap my head around where these translations live...
Whether these backends are being part of QOF or part of GnuCash.
A large part of me thinks that the translations belong with the
Application, which means you don't want the translations in the XML
file, but in the gettext .po file.

If it's living in QOF...  I'm not sure I like that..  But I still
don't think it should live in the XML.

-derek

Neil Williams <linux at codehelp.co.uk> writes:

> (The new backend method is still CashUtil only - G2 continues using the 
> existing methods.)
>
> The XML configuration file containing translatable strings and the schema for 
> the <qofconfig> namespace along with changes to the Makefile.am's to build 
> this XML from a perl script - all this will follow in a day or two.
>
> Schema: backend-schema.xsd.xml
> http://cvs.sourceforge.net/viewcvs.py/qof/qof/backend/
>
> Perl: backend-config.pl
> http://cvs.sourceforge.net/viewcvs.py/qof/qof/backend/file/
>
> The XML needs to be read by those processes that want to configure backends at 
> runtime and will form the API for backend configuration once complete.
>
> Backend developers decide which parameters (if any) support configuration by 
> editing a copy of a standard perl script and documenting what each option is 
> intended to achieve. Those descriptions are then merged into the gettext po 
> files for translation as normal. 
>
> I'm not sure if the perl is going to have to be distributed - at present, 
> gettext cannot alter the XML itself, only the perl (which needs the gettext 
> module). This makes it hard to use gettext as intended, at the user end. One 
> alternative is to use the translations to build a single XML file that 
> includes all translations.
>
> It may be easier to let libxml2 deal with identifying the language to use and 
> distribute a larger XML file for each backend.
>
> example perl snippet
> use strict;
> use POSIX;     # for setlocale()
> use gettext;
> $language = gettext("en-gb");
> $options{'file_retention_days'} = qq/gint64/;
> $texts{'file_retention_days'} = gettext("Number of days to retain old copies 
> of the file.");
> $options{'file_compression'} = qq/boolean/;
> $texts{'file_compression'} = gettext("Use compressed files or not?");
>
> There is documentation with the real perl script, in pod form, naturally.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <qofconfig xmlns="http://qof.sourceforge.net/" >
>   <backend name="GnuCash Backend Version 2">
>     <provider xml:lang="en-gb">
>         <option type="gint64" name="file_retention_days">
>             Number of days to retain old copies of the file.
>         </option>
>         <option type="boolean" name="file_compression">
>             Use compressed files or not?
>         </option>
>     </provider>
>   </backend>
> </qofconfig>
>
> If multiple translations are included in one file, the provider tag repeats 
> with the language label. Note that the language specified is the XML version, 
> not the expected en_GB but using a hyphen AND case insensitive.
>
> (Don't you love standards!)
>
> -- 
>
> Neil Williams
> =============
> http://www.data-freedom.org/
> http://www.nosoftwarepatents.com/
> http://www.linux.codehelp.co.uk/
>
> _______________________________________________
> gnucash-devel mailing list
> gnucash-devel at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-devel

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available


More information about the gnucash-devel mailing list