[BUG]: translate not load in admin view #1154
Labels
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: joomla/Component-Builder#1154
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What Happened?
is specific situation , constant not loaded and when turn on language debug, then show ??key (joomla constant)?? instead value (joomla string)
when JCB compile a component and i install that on fresh joomla 4.4.6, then it can not load string. i don't understand this is a bug or not but i can find the problem (I found out after a lot of pain and bleeding):
If you have used the enter key on the keyboard (line break) in your expressions for translation (for example, the description of a field), Joomla 4 cannot load all or part of that translation file, and that is because of the existence of INI_SCANNER_RAW In this link:
4a21f3ee6a/libraries/src/Language/LanguageHelper.php (L425)
It is in Joomla 4. This problem did not exist in Joomla 3, and for this reason, our component could correctly load translations in Joomla 3, but it could not in Joomla 4.
Steps to reproduce the Bug
It is enough to use the Enter key instead of using \n for the description part of a field in the settings of one of the component fields. Then compile. See that the page of your component that wants to load that field, cannot load strings.
or for simplified the problem, if you do something which result of that like below in the .ini file:
COM_MOOJLA_COURSE_SHOWLOGINTAB_LABEL="Show login tab"
COM_MOOJLA_COURSE_SHOWREGTAB_DESCRIPTION="If you want the "Register" tab to be displayed in the login / course registration option, select Yes, otherwise No
Inherit option uses moojla configuration"
COM_MOOJLA_COURSE_SHOWREGTAB_LABEL="Show register tab"
COM_MOOJLA_COURSE_SHOW_LABEL_CONTENTS_DESCRIPTION="When check this option shows label activity content exclusive of user enrollment or visibility"
COM_MOOJLA_COURSE_SHOW_LABEL_CONTENTS_LABEL="Show label contents"
COM_MOOJLA_COURSE_SP_INPUT="Sp Input"
COM_MOOJLA_COURSE_STARTDATE_LABEL="startdate"
the joomla 4 can not load correctly this file because i use Enter in the value of COM_MOOJLA_COURSE_SHOWREGTAB_DESCRIPTION .
Which Joomla version are you compiling in?
3.2.2
Which PHP version are you compiling in?
8.1
Which Joomla versions are you targeting?
joomla 4.4.6
Which PHP version are you targeting?
8.1
Which Web server is JCB running on?
2.4
Which Relational Database is JCB running on?
10.6
Which OS is JCB running on?
8
Which JCB version are you using?
3.2.2
Where in JCB did this issue occur?
Installation of a component
On which browsers did you encounter the issue?
Chrome
Additional Comments
No response
you cant use:
ant the "Register" tab to be displa
inside a language string, I remember Joomla has some kind of workaround for that, but its generally not good idea.That means no
"
in language strings.Then about the new lines... JCB has a switch to remove new lines in the component:
Thank you
Can you give me an example when maybe need to set "Remove line breaks" set to NO ?
well at least you made me chuckle 😄
To be honest when we added it 4 years ago, we could still use [No] most of the times in Joomla 3.... and well I never looked at it again....
We could probably drop the switch and make it always do that.... lol