HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Title to Reaction Icons when they are placed

jackmaessenjackmaessen ✭✭✭
edited October 2015 in Feedback

I noticed on my forum that when someone clicked on an Insightful, Awesome or LOL, the title of the placed icon was always: "Yaga.Reactions.RecordFormat'.
(not on the icons you have to click, but when they were already placed together with the usericon)
Don't know if other people have the same issue when using Yaga ReactionPoints
I made some changes in applications/yaga/library/functions.render.php
This is the original:
In function RenderReactionRecord($ID, $Type) { you can see this piece of code:

$DateTitle = sprintf(
                T('Yaga.Reactions.RecordFormat'), // this is the title of icon when it is placed
                $User->Name,
                $Reaction->Name,
                Gdn_Format::Date($Reaction->DateInserted, '%B %e, %Y')
              );
        $String = UserPhoto($User, array('Size' => 'Small', 'title' => $DateTitle));
        $String .= '<span class="ReactSprite Reaction-' . $Reaction->ActionID . ' ' . $Reaction->CssClass . '"></span>';
        $Wrapttributes = array(
            'class' => 'UserReactionWrap',
            'data-userid' => $User->UserID,
            'title' => $DateTitle
        );
        echo Wrap($String, 'span', $Wrapttributes);
      }

When looking to the source code, you can see that every icon has a unique ActionID like Reaction-1, Reaction-2 and so on...
I used this ACtionID for the title like this:

 //////////////// added icon title ///////////
        $IconTitle = 'Default Title';
        if($Reaction->ActionID == 1) {
          $IconTitle = 'Insightful';
        }
        elseif($Reaction->ActionID == 2) {
          $IconTitle = 'Awesome';
        }
        elseif($Reaction->ActionID == 3) {
          $IconTitle = 'LOL';
        }
        elseif($Reaction->ActionID == 4) {
          $IconTitle = 'Thank You';
        }
        //////////////////////////

and changed this line T('Yaga.Reactions.RecordFormat'), to this: T($IconTitle),

Comments

  • hgtonighthgtonight ∞ · New Moderator

    If you are seeing Yaga.Reactions.RecordFormat anywhere on your site, you have a translation issue. Following the proper install steps will make sure the locale cache gets cleared.

    Finally, you need to delete the /cache/locale_map.ini file to force refresh the locale definitions.

    If you are looking at something that is stored, like a notification, you will have to update the keys manually (or just remove it).

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

Sign In or Register to comment.