c.shicheng
6/12/2006 12:21:00 AM
Hello. I am a php developer looking for possibilities of migrating to
Ruby with a big web application the company had for several years,
written in php. Currently I am completely new to Ruby.
For a PHP developer of any application with mid-big size, choosing a
template system is very important (smarty/phplib/... there are a lot of
template engines). I don't know if this is the same with ruby on rails.
For the application I am working on, the most important features we
need is 1) easy I18N and 2) simple layout logic, if & loop.
I find 1) is most difficult to satisfy in most php templates. The
flexible I18N is always a problem. E.g. we used to write this:
in template
<p><? print $this=replacement_notice; ?><p>
in php
$a = '<em class="replace_keyword">' . $keyword_a . '</em>';
$b = '<em class="replace_keyword">' . $keyword_b . '</em>';
$replacement_notice = translate("Do you wish to replace %1 with
%2?", $a, $b);
$template.setVal('replacement_keyword', $replacement_keyword);
The ideal template we look for is to write like this:
<p>Do you wish to replace<em id="keyword_a"/>with<em
id="keyword_b"/></p>
And let the template to deal with translating the phrase "Do you wish
to replace %1 with %2?". The template needs to know that even the
parameter order can be changed, e.g. in some languages the %2 part
should appear ahead of %1 in translated HTML.
My Question:
1) is XSLT going to satisfy this requirement (especially translation)?
Is XSLT support muture in Ruby?
2) how about other templates? I googled out Kwalify and Amrita but I am
not sure if they are muture and supports flexible I18N;
3) I also googled out clearsilver, a template system that looks have
good I18N support (didn't dig into it yet), but are there many people
using clearsilver? I am afraid if too few people use it I might hit
Ruby-specific problems (because clearsilver is language-independent
template).
Thank you in advance!