[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Choose a template system?

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!

2 Answers

James Herdman

6/12/2006 12:44:00 AM

0

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/r...).

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.shicheng@gmail.com wrote:
> 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!

c.shicheng

6/12/2006 7:40:00 AM

0

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. ??:

> 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/r...).
>
> 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.shicheng@gmail.com wrote:
> > 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!