Choose a template system?

C

c.shicheng

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!
 
J

James H.

I don't think I can answer your question directly, but I think you
might want to direct your question to the Rails group, which you can
find on Google Groups (http://groups.google.com/group/rubyonrails).

Have you looked at the embedded Ruby used with Rails out of the box?
(Perhaps I'm misunderstanding the point of a template system).

Best of luck,

James H
 
C

c.shicheng

Ah, thank you for letting me know I posted in the wrong group. I tried
to search for rails group but didn't find it, by mistake or by
accident. Then I posted here.

James H. 写é“:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,539
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top