[RFC] Enhancements about proposal
by Denis Barbier
Hi there,
I am working on a project with po4a, its configuration file contains
many entries and I would like to help building derivatives. One
problem is that addenda may be modified, added or removed by
derivatives. I do not know yet what others will be doing with
addenda, but my feeling is that current handling of addenda is too
rigid. Current syntax is:
add_<lang>:<path>
I propose to allow prepending modifiers to path:
add_<lang>:[?!@]*<path>
where '?' marks <path> as being optional, '!' discards any further
inclusion of <path>, and '@' means that <path> contains a list of
addenda, one file per line (those paths may also be prefixed by
modifiers).
A patch against current CVS is attached (without documentation nor
tests for now).
Example:
In configuration file:
...
add_$lang:?@po4a/add_$lang/lists/local-pre.list \
add_$lang:?po4a/add_$lang/addendum \
add_$lang:?@po4a/add_$lang/lists/local-post.list
All addenda are optional, first and third addenda contain lists of
paths instead of addenda.
If po4a/add_fr/lists/local-pre.list contain the 2 lines
!po4a/add_fr/addendum
po4a/add_fr/my-addendum
and local-post.list does not exist, the only addendum for the French
translation will be 'po4a/add_fr/my-addendum'.
Note that $lang is expanded before addenda are processed, so lists
must not contain any variable.
What do you think about that?
Denis
14 years, 10 months