problem language

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.
Post Reply
mehdininja
Joomla! Apprentice
Joomla! Apprentice
Posts: 27
Joined: Sun Feb 18, 2018 9:56 am

problem language

Post by mehdininja » Thu Nov 30, 2023 3:00 am

Hello
The language of my site is persian and extensions language is persian. (joomla 4.4.0 no problem).

I updated Joomla from 4.4.0 to 4.4.1, but why did the language of some extensions become English !
What is the problem in joomla 4.4.1?

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 17510
Joined: Thu Feb 15, 2007 5:48 am
Location: Sydney, Australia

Re: problem language

Post by toivo » Thu Nov 30, 2023 5:14 am

This sounds like the language strings in the language files have linebreaks, which are not allowed after the update to Joomla 4.4.1.

Code: Select all

<br> <br />
Edit the language files and remove the linebreaks.

This behaviour was reported yesterday and removing the linebreaks brings up the translated text:
Update to 4.4.1 and Helix-ultimate Template blip
Toivo Talikka, Global Moderator

nacc
I've been banned!
Posts: 347
Joined: Mon Jul 03, 2023 7:08 pm

Re: problem language

Post by nacc » Thu Nov 30, 2023 5:33 am

My understanding of the issue, introduced in J! 4.4.1 and J! 5.0.1, is not that a language constant contains literally <br /> is taken from @brian's explanation on GitHub:
As can be seen there is one invalid string. Instead of it being on one line ending with " it is spread across multiple line
In other words, it looks like it is not valid to have a language constant defined as:

Code: Select all

CONSTANT_NAME="This is the translation
of the constant
spread over
multiple lines."
It would be acceptable to define the constant as:

Code: Select all

CONSTANT_NAME="This is the translation of the same language constant that does not have hard-coded line-breaks in it even though the translation may result in text that wraps over several lines."
I don't see how the following would be invalid:

Code: Select all

CONSTANT_NAME="This is the translation<br />of the constant<br />spread over<br />multiple lines."

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 17510
Joined: Thu Feb 15, 2007 5:48 am
Location: Sydney, Australia

Re: problem language

Post by toivo » Thu Nov 30, 2023 6:49 am

@nacc, you are right. The HTML linebreak tags <br> are allowed. The lines I tested with had linebreak tags and extended into a second line. Once combined into one line, the translation worked.
Toivo Talikka, Global Moderator

mehdininja
Joomla! Apprentice
Joomla! Apprentice
Posts: 27
Joined: Sun Feb 18, 2018 9:56 am

Re: problem language

Post by mehdininja » Sat Dec 09, 2023 1:00 pm

hello
The problem is not from <br> <br />. The problem is with the new line.

PLG_Test="test1
test2"

User avatar
ceford
Joomla! Hero
Joomla! Hero
Posts: 2762
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: problem language

Post by ceford » Sat Dec 09, 2023 1:27 pm

mehdininja wrote:
Thu Nov 30, 2023 3:00 am
What is the problem in joomla 4.4.1?
In J4.4.1 and 5.0.1, in LanguageHelper.php (3 instances), this line:

Code: Select all

                $strings = parse_ini_file($fileName, false, INI_SCANNER_RAW);
Replaced this line in previous versions:

Code: Select all

                $strings = parse_ini_file($fileName);
I think this was for security reasons. The outcome is that any multi-line string in a language ini file will cause the whole ini file to be skipped.


Post Reply

Return to “Language - Joomla! 4.x”