1

I am using the FJRelated plugin. There is a menu item for fjrelated to display a page almost the same as Joomla's default Category List.

I have this line:

<?php echo JHtml::_('grid.sort', 'COM_FJRELATED_'.$date.'_DATE', $dateOrder, $listDirn, $listOrder); ?>

which I change to:

<?php echo JHtml::_('grid.sort', 'COM_CONTENT_'.$date.'_DATE', $dateOrder, $listDirn, $listOrder); ?>

but in the front end I see the string COM_CONTENT_CREATED_DATE instead of the actual translation.

In Joomla's default_articles.php there is the same line:

<?php echo JHtml::_('grid.sort', 'COM_CONTENT_' . $date . '_DATE', 'a.created', $listDirn, $listOrder); ?>

which works perfectly fine in the front end.

I do not remember anything else to be needed in order to use Joomla's language strings in any custom php page. What am I doing wrong?

1

You need to load com_content language file.

JFactory::getLanguage()->load('com_content');
  • yes! that did it. i placed it in the same file override in my template folder. I guess it is correct since it won't get overwritten in future updates. right? – JoePanpi Jan 9 at 18:09
  • Yes, that is correct. – Sharky Jan 10 at 7:42

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.