Translations in frontend


  • Default avatar
    comenaranjas    
     7 years ago  last edited 7 years ago
    0

    Hello after this post https://awodev.com/forum/other-applications/aworewards/emails-in-multiple-languages I though I had my languages working since I checked the database table and the translations are stored following your method.


    However in the frontend of the page the Invitation form and content of the invitation email is only displayed in spanish (default language site).

    Switching language from the frontend doesn't change the content language of that section.

    I clarify this point "The component translation does switch and work" is only the invitation message and description of the invitation section that fails to show in selected language in frontend.


    I even have menu items created for invitation menu items per language.

    There is something strange, if I go to Joomla backend/Extensions/Languages and change the frontend language to "English" the english text appears in english in the Invitation form. So the languages are stored in database but are not switching with the language switcher in frontend.


    Regards

  • Your avatar
    seyi    
     7 years ago  last edited 7 years ago
    0

    Hello,

    In www/administrator/components/com_aworewards/helpers/helper.php, around line 400 is this:
    <?php
        
    static function getLangUser($user_id=0) {
            $languages = array();
    ?>


    Right after that add this:
    <?php
           
    if(!JFactory::getApplication()->isAdmin()) $languages[] = JFactory::getLanguage()->getTag(); 
    ?>


    That will fix the issue.
  • Default avatar
    comenaranjas    
     7 years ago
    0

    Thank you, that fixed it. Have a good start of year 2017.