[RCD] Help with Plugin Translation

Aurélio de Souza Ribeiro Neto netolistas at mpc.com.br
Wed Sep 21 22:27:02 CEST 2016


Hello Everyone,

     I have a plugin, and I want to translate it based on 
localization/language.inc file.

     In my plugin core PHP file I have this:

     function init()
     {
         $this->load_config();
         $this->add_texts('localization/', true);
     }


     If in a sub function I use

     $this->gettext('somelabel_from_my_lang.inc_file')

     I got this error   PHP Fatal error:  Using $this when not in object 
context

     What I'm doing wrong?

     Thanks

Aurelio




More information about the dev mailing list