Class 'JString not found Joomla 4.0

General questions regarding the use of languages in Joomla! 4.x.

Moderator: 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.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Kikiyo
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Tue Jan 29, 2008 5:56 pm

Re: Class 'JString not found Joomla 4.0

Post by Kikiyo » Wed Sep 14, 2022 4:20 pm

Similar here, using Macedonian language pack.
Replacing "JString" with "StringHelper" in "public static function transliterate", and adding "use Joomla\String\StringHelper;" just below "defined('_JEXEC') or die;" solved the problem partially.

Now there is "An error has occurred.
0 Call to a member function get() on null" on the main Administrator menu link "Home dashboard" showing.
You do not have the required permissions to view the files attached to this post.

gamod
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Tue Oct 18, 2022 6:37 am

Re: Class 'JString not found Joomla 4.0

Post by gamod » Tue Oct 18, 2022 6:58 am

Balazs wrote:
Sat Sep 04, 2021 11:28 pm
I also got this error in the Hungarian language pack, but I fixed it. The Joomla 3 Hungarian language pack includes an hu-HU.localise.php, which has a transliterate function that uses JString, but Joomla 4 no longer includes JString.
In the transliterate function I replaced the following line:
$str = JString::strtolower($string);
for this line:
$str = StringHelper::strtolower($string);
Also, after the header, I added the following line:
use Joomla\String\StringHelper;

localise.php.txt
Thank You!
Your modified php file saved my Hungarian site!

Krisi
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Wed Nov 23, 2022 6:13 am

Re: Class 'JString not found Joomla 4.0

Post by Krisi » Wed Nov 23, 2022 6:24 am

I got the same problem after upgrading to Joomla 4.2.5 on a multi-language website.
I did all the pre-upgrade preparations.
Purged Akeeba and FOF files.
Everything works well except this error on at least the main page in Czech language.

Krisi
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Wed Nov 23, 2022 6:13 am

Re: Class 'JString not found Joomla 4.0

Post by Krisi » Thu Nov 24, 2022 6:13 am

Balazs wrote:
Sat Sep 04, 2021 11:28 pm

Also, after the header, I added the following line:
use Joomla\String\StringHelper;

where exactly to put that in?

jankorshavn
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Fri Jul 03, 2015 9:11 am

Re: Class 'JString not found Joomla 4.0

Post by jankorshavn » Thu Feb 09, 2023 6:39 pm

jpm_86 wrote:
Sat Aug 20, 2022 2:59 pm
I have a Bulgarian language package and had the same Error.
After changing $str = JString::strtolower($string);
to
$str = StringHelper::strtolower($string);
and the header addition, everything works perfectly.
:geek:
It looks like I have the same problem with my norwegian site, but adding these suggestion in the nb-NO.localise.php didn't do the trick. In advance I have uninstalled most extensions listed in the pre-update check.. Any suggestions?

proximos
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Wed Aug 31, 2022 7:23 pm

Re: Class 'JString not found Joomla 4.0

Post by proximos » Thu Apr 27, 2023 8:41 pm

easy way to fix this problem. after update, erase /language and /administrator/language and install again :)

israelguido
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Thu Aug 26, 2010 7:19 pm
Location: São Paulo - Brazil
Contact:

Re: Class 'JString not found Joomla 4.0

Post by israelguido » Mon Jun 26, 2023 3:40 pm

I disable this two plugin:
- Content - Script Code Highlighter (GeSHi)
- Button - Script Code Highlighter (GeSHi)
And reinstall the site language, in my case is PT-br

andraspal
Joomla! Apprentice
Joomla! Apprentice
Posts: 33
Joined: Fri Oct 22, 2010 8:26 am

Re: Class 'JString not found Joomla 4.0

Post by andraspal » Wed Jul 12, 2023 12:57 pm

I fixed this just by changing the default language in phpmyadmin com_languages table to en-GB and deleting the other language from _languages table (the latter may not even be neccessary). Then just reinstalled the deleted language.

User avatar
pishro
Joomla! Explorer
Joomla! Explorer
Posts: 301
Joined: Tue Oct 09, 2012 7:22 am

Re: Class 'JString not found Joomla 4.0

Post by pishro » Fri Jul 14, 2023 10:10 am

I reinstalled it and it was fixed
Thanks friends

cranbaries
Joomla! Intern
Joomla! Intern
Posts: 61
Joined: Mon Jan 28, 2013 7:25 pm
Location: Turkey
Contact:

Re: Class 'JString not found Joomla 4.0

Post by cranbaries » Thu Nov 30, 2023 10:06 pm

Balazs wrote:
Sat Sep 04, 2021 11:28 pm
I also got this error in the Hungarian language pack, but I fixed it. The Joomla 3 Hungarian language pack includes an hu-HU.localise.php, which has a transliterate function that uses JString, but Joomla 4 no longer includes JString.
In the transliterate function I replaced the following line:
$str = JString::strtolower($string);
for this line:
$str = StringHelper::strtolower($string);
Also, after the header, I added the following line:
use Joomla\String\StringHelper;

localise.php.txt
Thanks

Johan Jonker
Joomla! Intern
Joomla! Intern
Posts: 50
Joined: Sun Mar 03, 2013 9:34 pm
Location: Houten, Netherlands
Contact:

Re: Class 'JString not found Joomla 4.0

Post by Johan Jonker » Thu Feb 22, 2024 2:28 pm

What worked for me is disabling the dutch language by renaming the map nl-NL to nl-NL-X.
Then reinstall the dutch language.


Post Reply

Return to “Language - Joomla! 4.x”