Hi @all,

the oxmultilang plugin for smarty already is able to handle placeholders in translation strings. It checks for the "args" param.
Sadly, I didn't find a good way to hand over arrays to it, but you can do:

lang-file:
'MY_KEY' => ''%1$s %2$s  !'

template:
[{php}]$this->assign("data", array("Hello", "World"));[{/php}]
[{oxmultilang ident="MY_KEY" args=$data}]

This way you can control the placing of arguments in the translation via the translation string. For another language the key could look like this and the ordering would be flipped:
'MY_KEY' => ''%2$s %1$s  !'

Does anobody know a better way to set the array for the args param?

Best regards,

Daniel Schlichtholz
Zu den Brauckstücken 5
58313 Herdecke

Am 01.03.2013 14:06, schrieb Alexander Kludt:
Hi,

sure i could write this in all places, but having it as a real native part looks
way better and is less error prone.
Saw things like this in a lot of places:

[{oxmultilang ident="SOME_FANCY_VAR_1"}] (smarty value stuff) [{oxmultilang
ident="SOME_FANCY_VAR_2"}]
--
mit freundlichen Grüßen
Alexander Kludt

__________________________
Phone: 09283-5925453
Fax: 09283-592671
Skype: kingschnulli
Email: [email protected]
Website: www.aggrosoft.de

__________________________
Aggrosoft it intelligence GbR
Tannstrasse 12
95111 Rehau
GERMANY

Sitz Rehau, Amtsgericht Hof
Steuernummer: 223/165/54508
Ust.-Id. Nr. gemäß § 27 a Umsatzsteuergesetz: DE260722773

___________________________
Diese Nachricht ist nur für den Empfänger bestimmt, sollten
Sie nicht der Empfänger sein löschen Sie diese Nachricht
umgehend und geben Sie uns bitte per Email ([email protected]) Bescheid
über den fälschlichen Erhalt.


> Robert Rosendahl <mailto:[email protected]>
> Freitag, 1. März 2013 14:02
>
> Hi,
>
> if i'm not mistaken, then you can do replacements in language strings like 
this:
>
> [{"MY_LANGUAGE_VAR"|oxmultilangassign|replace:":count":"5"}]
>
> or if you're using getters:
>
> [{"MY_LANGUAGE_VAR"|oxmultilangassign|replace:":count":$oView->getMyCount()}]
>
> Of course, having the option of passing replacements as smarty parameters
> would lead to cleaner code in the templates... ;-)
>
> Cheers,
> Robert
>
> -----Ursprüngliche Daten-----
> *Datum:* 01.03.2013 11:47:22
> *Von:* Alexander Kludt <[email protected]>
> *An:* <[email protected]>
> *Betreff:* Re: [oxid-dev-general] cleaning OXID eShop translations
> *Vorgang:* T-91WH2OBKBT-56
>
> _______________________________________________
> dev-general mailing list
> [email protected]
> http://dir.gmane.org/gmane.comp.php.oxid.general
> Alexander Kludt <mailto:[email protected]>
> Freitag, 1. März 2013 11:47
> Hi,
>
> +1 for Marat's idea - everytime a customer (shop owner)  needs to be able to
> change language
> stuff we need to transform it into a CMS content so he can do that in the
> backend. Most people
> just don't get it how to edit a file through FTP. Sounds like this might be
> done through oTrance, marco?
>
>
> _______________________________________________
> 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

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

Reply via email to