Derick Rethans wrote:
> 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}
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>
{/_}
--
Alexandru Stanoi
eZ Components System Developer
eZ Systems | http://ez.no
--
Components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/components