This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

Mavitm
Mavitm

Hello

ComponentBase class variable

$this->page['placeholder']  =  
$this->langs->placeholder  = e(trans('mavitm.customer::lang.components.searchPlaceHolder')); 

components default.htm file

{% set l = __SELF__.langs %}

{{ placeholder }}  //out key  

{{ __SELF__.lang.placeholder }}  //out key  

{{ l.placeholder }}  //out key 

{{ e(trans('mavitm.customer::lang.components.searchPlaceHolder')) }}    //error

<?= e(trans('mavitm.customer::lang.components.searchPlaceHolder')) ;?> //out key  

how can I use in default.htm Component default markup file
Thanks

Last updated

DainiusG
DainiusG

Yes, its quite hard to find how to use translation.

I tried as well all your listed options and some extra.

Here is how I managed to solve it


{{ 'plugin.name::lang.form.firstname'|trans }}

Last updated

Mavitm
Mavitm

DainiusG said:

Yes, its quite hard to find how to use translation.

I tried as well all your listed options and some extra.

Here is how I managed to solve it


{{ 'plugin.name::lang.form.firstname'|trans }}

Thank you very much for your answer.

{{ l.placeholder|trans }}  
{{ 'mavitm.customer::lang.components.searchPlaceHolder'|trans }} 

It did not for a solution, I use key value returns

1-3 of 3

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.