GetSimple Support Forum
Plugin creation problem - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: Plugins (http://get-simple.info/forums/forumdisplay.php?fid=13)
+--- Thread: Plugin creation problem (/showthread.php?tid=9971)



Plugin creation problem - Lucianp - 2017-08-31

I have been looking at this so long that I don't know what I'm looking at any more. I'm staring at the answer but I can't see it.

I am trying to add a value into an html form <label> from /my_plugin/en_US/$i18n() .

Code:
<label for=first_name> <?php i18n_r("FIRST_NAME"); ?></label>

What is the correct syntax to do this?

I have
Code:
i18n_merge('my_plug') || i18n_merge('my_plug','en_US');

and

Code:
add_action('theme-sidebar','createSideMenu',array($thisfile, i18n_r('my_plug/MY_SETTINGS')));

which allows me to create a link in the theme sidebar

but I cannot get my form labels to see the array.

Help really would be appreciated.

Thanks


RE: Plugin creation problem - Tyblitz - 2017-09-11

(2017-08-31, 06:05:08)Lucianp Wrote: I am trying to add a value into an html form <label> from /my_plugin/en_US/$i18n() .

Code:
<label for=first_name> <?php i18n_r("FIRST_NAME"); ?></label>

I have [...] and
Code:
add_action('theme-sidebar','createSideMenu',array($thisfile, i18n_r('my_plug/MY_SETTINGS')));

Thanks


Hi LucianP,

You're indeed staring at the answer. Notice that in the add_action call, you wrote i18n_r('my_plug/MY_SETTNGS') whereas in the form you didn't write the my_plug/ namespace. That's what you need Wink.

As for file/folder structure, you mentioned "/my_plugin/en_US/$i18n()"? That should be /my_plugin/lang/en_US.php (where you define an $i18n = array()). Please refer to the WIKI 's Standard for file and folder creation for more info.


RE: Plugin creation problem - Lucianp - 2017-09-13

Thank you, the path fixed it.