Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Choose a template system?

Reply
Thread Tools

Choose a template system?

 
 
c.shicheng@gmail.com
Guest
Posts: n/a
 
      06-12-2006
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!

 
Reply With Quote
 
 
 
 
James H.
Guest
Posts: n/a
 
      06-12-2006
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

http://www.velocityreviews.com/forums/(E-Mail Removed) 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!


 
Reply With Quote
 
 
 
 
c.shicheng@gmail.com
Guest
Posts: n/a
 
      06-12-2006
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/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
>
> (E-Mail Removed) 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!


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use the template member function of a template in the memberfunction of another template class? Peng Yu C++ 3 10-26-2008 03:51 PM
template template arguments: expected a class template, got `Component<T1, T2, T3> gary.bernstein@gmail.com C++ 1 06-08-2007 07:10 AM
Choose template return type? Joseph Turian C++ 2 01-20-2007 07:35 PM
Re: A Newbie Question about template template template tom_usenet C++ 0 07-24-2003 12:06 PM
Re: A Newbie Question about template template template Chris Theis C++ 2 07-24-2003 09:42 AM



Advertisments