[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]

Re: using WML for the first time!

Alessio Sangalli <manoweb@iname.com> writes:

> I was writing an HTML generation tool, when I heard about WML. My
> program was only at the beginning, so I decided to abandon it to
> explore WML capabilities.

Good decision!
> Now I've read the tutorial and the documentation. I have to read
> everithing another couple of times, but I'll be very happy if
> someone could help me find the right solution for my problem. WML is
> a so "big" program that I'm confused about the capabilities it can
> offer.

That's not surprising. What you should do is go to the WML-sites pages
and look at some of the places that implemented a site that looks a
bit like what you have in mind. Get the wml source files and look at
them. Don't forget to get the include files that are referenced in the
.wml files (look for use and include statements). Those are the key!

> I have a default-document structure, wich I can say is:
> GIF image
> Index Actual text Language selection 
> Address...
> I have to write 6-7 pages in 5 different languages, but the structure of
> the document is always the same. Only "Actual text" changes from page to
> page and "Index" changes from language to language.
> How can I use WML to write only the text I need and let it generate
> the rest???

You can create a template that deals with all the layout and stuff,
defines your own tags if you need some, redefines existing html tags,

Then you just include this template file in your .wml files, specify
the actual text part and you are done.

Here is a sketch how such a file would look:

#!wml -oLANG_VAR:%BASE.var -o(ALL-LANG_*)+LANG_EN:%BASE.en.html \

#include <$(ROOT)/.wml/template-alessio.inc>

<de>Text in German.</de>

<en>Text in English.</en>

<it>Text in Italian.</it>

And that's it!!!

You GIF image and address section are only entered once in the
template. Your template file has also to deal with automatic
generation of languages, the first line in the above example uses that
and tells wmk to deal with the languages.

For languages you have two options:

You can either put all the page content between the language tags, so
you have basically 5 sections in the file if you have 5 languages.

I personally recommend another approach:

Put all languages inside the structural elements. This has the
advantage, that you never (should) forget to update the various
languages if you change something in a file. So this is what I'd do:

<H1><de>Title in German</de><en>Title in English</en><it>Title in

<de>German text</de>
<en>English text</en>
<it>Italian text</it>

<H2><de>Subtitle in German</de><en>Subtitle in
English</en><it>Subtitle in Italian</it></H2>

<de>German text</de>
<en>English text</en>
<it>Italian text</it>

<de>German text</de>
<en>English text</en>
<it>Italian text</it>


You might want to look at our site


for a rather elaborate example of a multi-language site. We are still
actively working on a cleanup of the WML-code, so beware, things might


P.S.: And YES, WML offers you many features, you should invest some
      time in learning in. The more web sites I am working on the more
      I realize that learning WML is time well spent.
Dr. Fritz Zaucker, Head IT Support Group
Department of Electrical Engineering,  Federal Institute of Technology
ETZ J97, Gloriastrasse 35, 8092 Zurich, Switzerland
Tel.: +41-1-632-5241 Fax: +41-1-632-1194 http://ee-staff.ethz.ch/~zaucker/
E-mail: zaucker@ee.ethz.ch (see home page for PGP key)
Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com