Choose a template system?

Discussion in 'Ruby' started by c.shicheng@gmail.com, Jun 12, 2006.

  1. Guest

    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!
     
    , Jun 12, 2006
    #1
    1. Advertising

  2. James H. Guest

    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

    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!
     
    James H., Jun 12, 2006
    #2
    1. Advertising

  3. Guest

    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
    >
    > 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!
     
    , Jun 12, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris Theis
    Replies:
    2
    Views:
    484
    Chris Theis
    Jul 24, 2003
  2. tom_usenet
    Replies:
    0
    Views:
    543
    tom_usenet
    Jul 24, 2003
  3. Joseph Turian

    Choose template return type?

    Joseph Turian, Jan 20, 2007, in forum: C++
    Replies:
    2
    Views:
    400
    Joseph Turian
    Jan 20, 2007
  4. Replies:
    1
    Views:
    2,119
    Gianni Mariani
    Jun 8, 2007
  5. 邹俊洋
    Replies:
    0
    Views:
    197
    邹俊洋
    Aug 12, 2013
Loading...

Share This Page