Hi,

this is a good idea and we will consider it, currently there is no such functionality implemented.

Regards,
Sarunas


----- Original Message ----- From: <[email protected]>
To: <[email protected]>
Sent: Friday, October 22, 2010 2:48 PM
Subject: [oxid-dev-general] Problem with translation of phrases in differentlanguages


Hello developers!
We are currently trying to add another language to the shop.
There we have the following problem:

Let's say in English the text is
"Only in packaging units of  5"

Now we have the translation in lang.php
'BASKET_VPE_MESSAGE' => "Only in packaging units of ",

The code in the template:
[{ oxmultilang ident="BASKET_VPE_MESSAGE" }] [{ $basketproduct->oxarticles__oxvpe->value}]

Now we have a new language were the sentence is created in a different way, so that after the "5" there has to be text as well:
"This item can only be bought in packaging units that contain 5 items."
(I used English, not the original new language just for explanation)
Now you would need something like
[{ oxmultilang ident="BASKET_VPE_MESSAGE1" }] [{ $basketproduct->oxarticles__oxvpe->value}] [{ oxmultilang ident="BASKET_VPE_MESSAGE2" }]
in the template and the corresponding entries in lang.php.
It is quite some work to modify all the places where this issue occurs (change the templates and add the 2nd entry to all language files).

What do you think about an extended oxmultilang modifier in smarty that can also work with additional attributes? Place holders in the multilang string would be replace by these attributes.
Something like:

[{ oxmultilang ident="BASKET_VPE_MESSAGE" value="$basketproduct->oxarticles__oxvpe->value" }]
(in the tpl)

'BASKET_VPE_MESSAGE' => "Only in packaging units of %s", 'BASKET_VPE_MESSAGE' => "This item can only be bought in packaging units that contain %s items."
(in lang.php)

I know this could be achieved somehow with the smarty modifier "string_format" as well.
But I like my idea more ;-)

Is there maybe something like this in the new template system that is announced for 4.5.0? If yes, it would be great to have this code already now so that I could implement it myself for older releases.

Regards,
Martin



_______________________________________________
dev-general mailing list
[email protected]
http://dir.gmane.org/gmane.comp.php.oxid.general


_______________________________________________
dev-general mailing list
[email protected]
http://dir.gmane.org/gmane.comp.php.oxid.general

Reply via email to