On Fri, 18 Jan 2008, Alexandru Stanoi wrote:

> Derick Rethans wrote:
> > 
> > {tr "Hello #%nr (%nr2)" context "test" vars array( 'nr' => $nr2 + 8, 'nr2'
> > => 98 )}
> > 
> > As a comparison, eZ Publish now is:
> > {"Hello #%nr (%nr2)"|i18n("test", "comment", hash( '%nr', $nr2 + 8, '%nr2',
> > 98 ) )}
> 
> How about another syntax?
> 
> {translate context "test" vars $nr = $nr2 + 8, $nr2 = 98}
>   Hello #%nr (%nr2)
> {/translate}
> 
> 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}

> > 3. And for the arguments the following:
> > 
> > a. vars array( 'nr' => $nr2 + 8, 'nr2' => 98 )
> > b. vars 'nr' = $nr + 8, 'nr2' = 98
> > c. vars nr = $nr + 8, nr2 = 98
> > 
> > I think I'd prefer (for now), the following syntax:
> > 
> > {_ "Hello #%nr (%nr2)" context "test" vars nr = $nr + 8, nr2 = 98}
> 
> Any are good, but should the last one be: vars $nr = $nr2 + 8, $nr2 = 98?

No, because they are not variables, but replacement keys.

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

Reply via email to