[WM] multi language support?

Justin Mason jm.jmason.org
Wed Nov 7 21:05:02 GMT 2001


Chris said:

> we would like to generate multilingual web pages from a single webmake file.
> After playing around a while I come to know that it won't work without
> extending webmake. 
> Please let me know, if there have been some efforts to accomplish
> this. If not maybe some people have ideas on this subject.

I've thought about this before, it hadn't come up yet but is definitely
something that needs to work.

> What has been done:
> Up to now we played with the possibilities webmake offers us. The current
> version defines a new content tag '<lang id="..">' which enables us to write
> multilingual contents. Unfortunatley this is hard to do with EtText as it is
> very sensible with newlines and so on. Inserting any kind of tags kann mess u
> p the output, so we sticked to 'text/html' input. 

BTW is this due to addition of <br /> tags?  That's been bothering me a
little, as well.  I may change the behaviour of this, so that if a HTML
tag is present on the short line, it will not add a <br />.

> 	<lang id="de"> <wmmeta name=title value="German"></lang>
>	<lang id="en"> <wmmeta name=title value="english"></lang>
> 
> at the beginning of the content files.  But webmake sticks to the first
> one i t encounters disregarding the <lang> tags which are only parsed on
> producing th e actual output (seems so). 

I had considered a good way to do it might be to do this:

	<wmmeta name=title_de value="German">
	<wmmeta name=title_en value="english">
	<wmmeta name=title_ga value="Gaeilge">
	...

so when generating maps/indexes use $[this.title_${lang}] or similar
instead of just $[this.title].  Ditto for other metadata items.  This way
it would be possible to maintain a wide set of metadata in different langs
simultaneously.

Together with the <lang> tag you've got (for the content text), this
should work?


For future work -- my idea was to build on this somehow -- possibly by
using a new character inside the metadata reference format, so instead of

	<wmmeta name=title_de value="German">

one would use a special char-and-lang suffix:

	<wmmeta name=title!de value="German">

and then somehow, $[this.title] would provide the correct language,
based on some variable setting (probably set by the output file).

Does this make sense?

--j.




More information about the Webmake-talk mailing list