[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Demexp-dev] Re: [Wdialog-users] Plan for basic/simple i18n support?
From: |
Gerd Stolpmann |
Subject: |
[Demexp-dev] Re: [Wdialog-users] Plan for basic/simple i18n support? |
Date: |
Wed, 08 Mar 2006 17:29:07 +0100 |
Am Donnerstag, den 09.02.2006, 19:18 +0100 schrieb David MENTRE:
> Gerd Stolpmann <address@hidden> writes:
>
> > I spent one day starting to implement improved I18N features since we
> > talked about the issue for the first time, but did not find time to
> > continue this effort. I think I'll have time in the next days, though.
>
> Great! Let us know about new releases.
Hello,
a release is not yet available, but a kind of "feature preview". In
particular, the CVS version implements basic support for catalogs (and a
number of additional things, see below). It has not yet been tested
extensively, so there may be unlimited numbers of bugs in it.
One can now:
- Define catalogs for dialogs. This is either possible by
using the <ui:catalog> element or by attaching a catalog
object (which may get the lookup table from any source).
ui:catalog looks like:
<ui:catalog uplink="...">
<ui:msg lang="en" internal="1" external="One"/>
...
</ui:catalog>
The "external" attributes are optional and default to
"internal" if missing. "uplink" is optional, too. If the
message is not found in this catalog, it is tried to get
it from the uplink catalogs (identified by dialog names).
To define your own catalog, write a class that has the
message_catalog type, and add it with add_catalog to
the application. If have no time to develop a gettext-based
catalog, but I think this is quite easy.
- Look up messages with
$[m(token)] (for a constant token)
or
$[cat-translate(expression)]
- Define a display function for the ui:select element.
Especially
<ui:select ... display="cat-translate" ...>
looks up the internal values in the catalog (and ignores
the provided external values) to get the display strings
for the selection list.
There are also a number of further changes:
- The $[...] notation can be used in variable initializers,
e.g.
<ui:variable type="string">
<ui:string-value>$[m(token)]</ui:string-value>
</ui:variable>
These initializers may be arbitrary expressions. They are
evaluated the first time a variable is accessed.
- Inside the $[...] notation there are a number of new
syntax elements:
$['word] is just a string literal
$[fun(v).expr] is a function (!) mapping v to expr
$[let(v=expr).expr] is a "let"
$[ { col=expr, col=expr, ... } ] is a matrix constant (see
below)
Spaces are now allowed.
- There are new Matrix_value, Table_value, Function_value. I
hope the latter is clear. Matrices and tables are not yet
usable in this version of WDialog.
(A table is like an SQL table: It consists of an open number
of rows, and every row has a fixed number of named cells.
The cells are always strings. A matrix is a table with a
fixed number of rows.)
- New variable initializers:
<ui:variable>
<ui:any-value>$[...]</ui:any-value>
</ui:variable>
... evaluates $[...] to initialize the variable.
<ui:variable>
<ui:map-value mapping="$[fun(v).expr]">
...
</ui:map-value>
</ui:variable>
... maps the inner value (...) by applying the function
What will be coming soon:
- SQL support. One can simply write an SQL expression in a
dialog, and access the result of the expression using the
new table type.
- User-defined functions: With a <ui:function> element one will
be able to define functions for use in $[...].
- Full integration of tables and matrices.
- The ability to access catalogs as tables.
Any comments on the current CVS version and the future plans are very
welcome.
Gerd
--
------------------------------------------------------------
Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany
address@hidden http://www.gerd-stolpmann.de
Phone: +49-6151-153855 Fax: +49-6151-997714
------------------------------------------------------------
- [Demexp-dev] Re: [Wdialog-users] Plan for basic/simple i18n support?,
Gerd Stolpmann <=