Derick Rethans wrote:
> Hello!
>
> I've been prototyping the TemplateTranslationTiein and now need to come
> up with a syntax for the translation block in the templates.
>
> There is a few parts that needs discussing:
>
> 1. Which keyword to use
> 2. How the context specification should look like
> 3. How optional arguments should look like.
>
> In the prototype, it now looks like:
>
> {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.
> 1. For the keyword, I can come up with a few options:
>
> a. {_ "Hello..."
> b. {t "Hello..."
> c. {tr "Hello..."
_ does not tell me anything
t is too short
tr sounds like table row (html)
I would go with {translate}.
> 2. For the context, I can only come up with one example actually:
>
> a. context "contextName"
>
> 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?
I also like option c better.
> Some notes:
> - The whole translation block should be slightly easy to find, in order
> to create a script that can extract the template translation blocks.
> - The "%nr" syntax is used for substitution variables based on the
> Translation component
>
> (http://ezcomponents.org/docs/api/2007.2.1/Translation_linguist-format.html#parameters)
>
> Opinions, please!
>
> regards,
> Derick
--
Alexandru Stanoi
eZ Components System Developer
eZ Systems | http://ez.no
--
Components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/components