Language problem with plugin

This forum is for general questions about extensions for Joomla! 3.x.

Moderators: pe7er, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
User avatar
Gany
Joomla! Ace
Joomla! Ace
Posts: 1052
Joined: Wed Jan 02, 2008 12:38 am

Language problem with plugin

Postby Gany » Thu Aug 10, 2017 2:18 am

Hi, I've got a problem getting the language files work properly in a plugin. The plugin works fine, but the strings show up. How do I correct that?

Here's the set up (only the relevant bits):

Code: Select all

my_plugin.xml
<?xml version="1.0" encoding="utf-8"?>
<extension type="plugin" version="2.5" group="system" method="upgrade">
<name>System - my_plugin</name>
<files folder="site">
    <filename plugin="my_plugin">my_plugin.php</filename>
    <folder>my_plugin</folder>
    <folder>language</folder>
    <filename>index.html</filename>
  </files>

language
en-GB
en-GB/en-GB.plg_system_my_plugin.ini
en-GB/en-GB.plg_system_my_plugin.sys.ini


That should work, but it doesn't. Did I forget anything?

SharkyKZ
Joomla! Guru
Joomla! Guru
Posts: 800
Joined: Fri Jul 05, 2013 10:35 am
Location: Unknown

Re: Language problem with plugin

Postby SharkyKZ » Thu Aug 10, 2017 5:36 am

Plugin language files should be installed to administrator/language/ folder. There's a tag specifically for language files:

Code: Select all

<languages>
 <language tag="en-GB">en-GB.plg_system_my_plugin.sys.ini</language>
 <language tag="en-GB">en-GB.plg_system_my_plugin.ini</language>
</languages>


Don't forget to add folder path to your language files or move them out of the folder. Currently it's something like this:

Code: Select all

<languages folder="site/language/en-GB">

User avatar
Gany
Joomla! Ace
Joomla! Ace
Posts: 1052
Joined: Wed Jan 02, 2008 12:38 am

Re: Language problem with plugin

Postby Gany » Thu Aug 10, 2017 6:23 am

I've followed your instructions, no change whatsoever.
i removed the language folder, I added it because in template you normally have. It wasn't there before I started trying to fix it.

I don't quite understand what you mean with

Code: Select all

<languages folder="site/language/en-GB">

I checked the language folder of the site itself, I don't see any plugins there.

Thanks for your help! The developer was far less helpful: "it works on my computer, therefore there is no problem." So I have to do it myself. :'(

SharkyKZ
Joomla! Guru
Joomla! Guru
Posts: 800
Joined: Fri Jul 05, 2013 10:35 am
Location: Unknown

Re: Language problem with plugin

Postby SharkyKZ » Thu Aug 10, 2017 6:49 am

Do you get warnings about missing missing language files when trying to install with my changes? Can you see your language files in /administrator/language/en-GB/ folder?

User avatar
Gany
Joomla! Ace
Joomla! Ace
Posts: 1052
Joined: Wed Jan 02, 2008 12:38 am

Re: Language problem with plugin

Postby Gany » Thu Aug 10, 2017 7:14 am

No, I didn't. But I do see that the plugin is not in the backend admin language folder. I'm not new to Joomla, but very new to configuring plugins on this level. Do I have to do that? I though the plugin should take care of that.


Return to “Extensions for Joomla! 3.x”

Who is online

Users browsing this forum: No registered users and 7 guests