On Fri, 18 Jan 2008, Alexandru Stanoi wrote:

> Derick Rethans wrote:
> > On Fri, 18 Jan 2008, Alexandru Stanoi wrote:
> > 
> > > I think this syntax would be easier to see for a designer, as 
> > > he/she does not need to write text inside the template code, but 
> > > inside a block like html.
> > 
> > Perhaps, however, the "vars" part wouldn't be there for most strings, and
> > perhaps we can do something with the "context" as well, such as setting it
> > for the whole template. In case we both move them out, we'd end up having
> > just:
> > 
> > {_ "Hello Derick"}
> > 
> > which is quite a bit easier already than:
> > 
> > {_ "Hello #%nr (%nr2)" context "test" vars nr = $nr + 8, nr2 = 98}
> 
> How about other situations where blocks would be nicer?
> 
> 1. quotes in string need to be escaped:
> {_ "Hello Michael \"Air\" Jordan!"}
> 
> compared to:
> {_}
>   Hello Michael "Air" Jordan!
> {/_}
> 
> 2. html code in string:
> {_ "Hello <ul><li>derick</li><li>alex</li><li>ray</li></ul>"}
> 
> compared to:
> {_}
>   Hello
>   <ul>
>     <li>derick</li>
>     <li>alex</li>
>     <li>ray</li>
>   </ul>
> {/_}

There is an issue with this example (and blocks vs. functions). In order 
for the translation component to match the translation with the given 
string, it needs to be *exactly* the same - inclusive whitespace.

In both your examples, the original string is not the same. Also, the 
whole idea of templates is not to put HTML in code ;-)

regards,
Derick
-- 
Components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/components

Reply via email to