I18n for formulator proposal

Joachim Schmitz <[email protected]> Mon, 13 Oct 2003 19:54:53 +0200
Newsgroups gmane.comp.web.zope.formulator.devel
Message-ID <[email protected]>
Hi,

I am going to implement translation services for formulator. So that one
can create multilingual forms with formulator and that the appropriate 
translations for attributes of fields like:
- title
- description
- default
and for the messages
are returned by formulator. The key to this is, to be able to specify 
the message-ids in forms. The specifying of message-ids should fullfill 
the following partly conflicting requirements:
- minimal editing of existing forms
- maximum flexibility in specifying the message-id

I think to fullfill both with this implementation:

Each form gets an additional i18n attribute named "i18n".
Each field can get an additional i18n attribute named "i18n".

The form-i18n-attr must be specified but can be "", in this case, it is 
set to the form-name.
The message ids are build like this:

if the field-i18-attr is not given or "":
message-id = formi18n-attr + "-" + fieldname  + "-title" | 
"-description" | "-default"
else:
fieldi18n-attr

for the messages
formi18n-attr + "-message-" + message-name

The dashes are there, for better humanreading of message-ids in po-files.

Formulator will use PlacelessTranslationservices and will provide the
translated strings in the selected language if
PlacelessTranslationService is installed and the formi18n attribute is
there and a translation is available in the message-catalog, otherwise 
it will return the original string specified in the form.
There will also be an extraction tool, which extracts the message-ids 
with the original-text for inclusion in the po-file.


-- 
Mit freundlichen Grüßen                                Joachim Schmitz
......................................................................
AixtraWare eK ..Joachim Schmitz ..www.aixtraware.de ..t: +49-2464-8851
Hüsgenstr. 33a .....d-52457 Aldenhoven .............f: +49-2464-905163