Joomla Language string missing #596
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: joomla/Component-Builder#596
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?
Steps to reproduce the issue
I have placed coding in adminview "JCBGUI.admin_view.php_before_publish" section to test certain criteria to make sure that publish is allowed, if not I generate error message and return false before record is updated.
Eg. here I generate error message and return false...
$msg1 = JText::('COM_MYTEST_CANNOT_PUBLISH_RECORD');
$msg2 = JText::('COM_MYTEST_THE_LINKED_RECORD_NO_LONGER_EXISTS_PLEASE_DELETE_THIS_RECORD_AND_RECREATE_IT');
JFactory::getApplication()->enqueueMessage($msg1 . ‘ ‘ . $id . ‘. ’ . $msg2, 'error');
return false;
Expected result
If I Try to publish record, this should happen:
"Error
Cannot publish record 6. The linked record no longer exists. Please delete this record and re-Create it!!"
Actual result
I get joomla standard message also...
"Error
Cannot publish record 6. The linked record no longer exists. Please delete this record and re-Create it!!
COM_MYTEST_MYVIEWNAME_N_ITEMS_FAILED_PUBLISHING"
System information
Additional comments
On reviewing Joomla code in ‘libraries/source/mvc/controller/admincontroller.php
Lines 202-5 in function publish shows the following:
if ($errors)
{
\JFactory::getApplication()->enqueueMessage(\JText::plural($this->text_prefix . '_N_ITEMS_FAILED_PUBLISHING', count($cid)), 'error');
}
However, JCB does not appear to generate a language string for ‘COM_MYTEST_MYVIEWNAME_N_ITEMS_FAILED_PUBLISHING’ in the file “en-GB_com_mytest.ini”.
I am not clear as to how I get JCB (or how to make coding changes) to actually generate the PHP language string necessary for the joomla message to be displayed correctly. Do I have to manually had the required string to the INI file for each view where I perform such a test??
Please advise..
The languages strings are build for you of course, but there are some system strings, and there are strings build for each view, field and where ever JCB gets the
JText::_(
So JCB does not target
JText::plural(
in the code, but it does add these language strings. Here is where JCB adds internal language strings (there is a few function here doing internal strings), and just that you know it has been requested that I move these into the GUI so it could be changed or adapted per/view.Does seem like FAILED Publishing is not added, here is where publishing is added. There is also items related strings added here, but I also do not see the FAILED option. As you can see the
setLangContent(
function is the function to follow all over the compiler, to see what is done, where and when.I am willing to add it in, just not sure where, so do some tests and let me know.
Thanks for feedback Llewellyn
I inserted the following code into the last link you provide, (i.e. file c_field.php, function setfieldset, at line 487) and message is now displayed correctly.
$this->setLangContent($this->lang, $langViews . '_N_ITEMS_FAILED_PUBLISHING', "%s " . $view['settings']->name_list . " failed publishing." );
$this->setLangContent($this->lang, $langViews . '_N_ITEMS_FAILED_PUBLISHING_1', "%s " . $view['settings']->name_single . " failed publishing." );