I'm writing a plugin that needs some translatable strings at runtime, but I'm having trouble getting my language file to be picked up.
I've got the following:
/language/en-GB/en-GB.plg_system_myplugin.sys.ini
This contains the translations for the plugin's config page. This is working fine./language/en-GB/en-GB.plg_system_myplugin.ini
This contains the translations for the plugin to use at runtime. This is not working.And both of the above referenced in the plugin XML file:
<languages> <language tag="en-GB">language/en-GB/en-GB.plg_system_myplugin.sys.ini</language> <language tag="en-GB">language/en-GB/en-GB.plg_system_myplugin.ini</language> </languages>
As noted above, the .sys.ini file is working just fine; my plugins config page shows up with all the labels, etc loaded correctly.
However the .ini file is not working. From what as I can tell, looking at the Joomla Debug Console, the .ini translation file isn't being loaded at all even when the plugin is being used.
I can't see what I'm doing wrong here. Similar code in modules and components works just fine, but I can't make it work in a plugin.
Can someone please tell me how to make a language file work in a plugin, or tell me what I'm missing.
Thank you.