diff --git a/controllers/class.actioncontroller.php b/controllers/class.actioncontroller.php index 0609685..cd4affa 100644 --- a/controllers/class.actioncontroller.php +++ b/controllers/class.actioncontroller.php @@ -41,7 +41,7 @@ class ActionController extends DashboardController { $this->Permission('Yaga.Reactions.Manage'); $this->AddSideMenu('action/settings'); - $this->Title('Manage Reactions'); + $this->Title(T('Manage Reactions')); // Get list of actions from the model and pass to the view $this->SetData('Actions', $this->ActionModel->GetActions()); @@ -60,12 +60,12 @@ class ActionController extends DashboardController { $this->Form->SetModel($this->ActionModel); $Edit = FALSE; - $this->Title('Add Action'); + $this->Title(T('Add Action')); if($ActionID) { $this->Action = $this->ActionModel->GetAction($ActionID); $this->Form->AddHidden('ActionID', $ActionID); $Edit = TRUE; - $this->Title('Edit Action'); + $this->Title(T('Edit Action')); } // TODO: Autoload these, or something @@ -109,11 +109,11 @@ class ActionController extends DashboardController { Wrap($Action->Name, 'span', array('class' => 'ReactLabel')), 'div', array('class' => 'Preview Reactions')), 'div', array('class' => 'Action')), 'li', array('id' => 'Action_' . $Action->ActionID)); if($Edit) { $this->JsonTarget('#Action_' . $this->Action->ActionID, $NewActionRow, 'ReplaceWith'); - $this->InformMessage('Action updated successfully!'); + $this->InformMessage(T('Action updated successfully!')); } else { $this->JsonTarget('#Actions', $NewActionRow, 'Append'); - $this->InformMessage('Action added successfully!'); + $this->InformMessage(T('Action added successfully!')); } } } diff --git a/controllers/class.badgecontroller.php b/controllers/class.badgecontroller.php index 13c9c62..68ca022 100644 --- a/controllers/class.badgecontroller.php +++ b/controllers/class.badgecontroller.php @@ -40,7 +40,7 @@ class BadgeController extends DashboardController { $this->Permission('Yaga.Badges.Manage'); $this->AddSideMenu('badge/settings'); - $this->Title('Manage Badges'); + $this->Title(T('Manage Badges')); // Get list of badges from the model and pass to the view $this->SetData('Badges', $this->BadgeModel->GetBadges()); @@ -62,7 +62,7 @@ class BadgeController extends DashboardController { // Only allow editing if some rules exist if(!RulesController::GetRules()) { - throw new Gdn_UserException('You cannot add or edit badges without rules!'); + throw new Gdn_UserException(T('You cannot add or edit badges without rules!')); } $Edit = FALSE; @@ -111,10 +111,10 @@ class BadgeController extends DashboardController { $this->Form->SetFormValue('RuleCriteria', $SerializedCriteria); if($this->Form->Save()) { if($Edit) { - $this->InformMessage('Badge updated successfully!'); + $this->InformMessage(T('Badge updated successfully!')); } else { - $this->InformMessage('Badge added successfully!'); + $this->InformMessage(T('Badge added successfully!')); } Redirect('/yaga/badge/settings'); } @@ -153,7 +153,7 @@ class BadgeController extends DashboardController { */ public function Toggle($BadgeID) { if(!$this->Request->IsPostBack()) { - throw PermissionException('Javascript'); + throw new Gdn_UserException(T('That must be done via Javascript')); } $this->Permission('Yaga.Badges.Manage'); $this->AddSideMenu('badge/settings'); @@ -216,7 +216,7 @@ class BadgeController extends DashboardController { // Only allow awarding if some badges exist if(!$this->BadgeModel->GetBadgeCount()) { - throw ForbiddenException('award badges without any badges defined'); + throw new Gdn_UserException(T('You cannot award badges without any badges defined.')); } $UserModel = Gdn::UserModel(); diff --git a/controllers/class.bestofcontroller.php b/controllers/class.bestofcontroller.php index c8357aa..f1c859e 100644 --- a/controllers/class.bestofcontroller.php +++ b/controllers/class.bestofcontroller.php @@ -42,7 +42,7 @@ class BestOfController extends Gdn_Controller { $Module->Selector = 'Score'; $this->SetData('Module', $Module); - $this->Title(T('Best Of')); + $this->Title(T('Best Of...')); $this->Render('all'); } } diff --git a/controllers/class.configurecontroller.php b/controllers/class.configurecontroller.php index 3f2b4ae..7f87e41 100644 --- a/controllers/class.configurecontroller.php +++ b/controllers/class.configurecontroller.php @@ -55,7 +55,7 @@ class ConfigureController extends DashboardController { 'Yaga.LeaderBoard.Limit' => array('LabelCode' => 'Maximum number of leaders to show', 'Control' => 'Textbox', 'Options' => array('Size' => 45, 'class' => 'SmallInput')) )); $this->AddSideMenu('configure'); - $this->SetData('Title', 'Gamification Settings'); + $this->Title(T('Yaga.Settings', 'Gamification Settings')); $this->ConfigurationModule = $ConfigModule; $ConfigModule->RenderAll(); } diff --git a/controllers/class.rankcontroller.php b/controllers/class.rankcontroller.php index 8780a81..2381c61 100644 --- a/controllers/class.rankcontroller.php +++ b/controllers/class.rankcontroller.php @@ -101,10 +101,10 @@ class RankController extends DashboardController { if($this->Form->Save()) { if($Edit) { - $this->InformMessage('Rank updated successfully!'); + $this->InformMessage(T('Rank updated successfully!')); } else { - $this->InformMessage('Rank added successfully!'); + $this->InformMessage(T('Rank added successfully!')); } Redirect('/yaga/rank/settings'); } @@ -206,7 +206,7 @@ class RankController extends DashboardController { // Only allow awarding if some ranks exist if(!$this->RankModel->GetRankCount()) { - throw ForbiddenException('award ranks without any ranks defined'); + throw new Gdn_UserException(T('You cannot promote users without any ranks defined.')); } $UserModel = Gdn::UserModel(); diff --git a/controllers/class.reactcontroller.php b/controllers/class.reactcontroller.php index d9526ae..3b5580f 100644 --- a/controllers/class.reactcontroller.php +++ b/controllers/class.reactcontroller.php @@ -48,7 +48,7 @@ class ReactController extends Gdn_Controller { // Make sure the action exists and the user is allowed to react if(!$Action) { - throw new Gdn_UserException('Invalid Action'); + throw new Gdn_UserException(T('Invalid Action')); } if(!Gdn::Session()->CheckPermission($Action->Permission)) { @@ -62,13 +62,13 @@ class ReactController extends Gdn_Controller { $Anchor = '#Discussion_' . $DiscussionID . ' .ReactMenu'; } else { - throw new Gdn_UserException('Invalid ID'); + throw new Gdn_UserException(T('Invalid ID')); } $UserID = Gdn::Session()->UserID; if($Discussion->InsertUserID == $UserID) { - throw new Gdn_UserException('You cannot react to your own content.'); + throw new Gdn_UserException(T('You cannot react to your own content.')); } // It has passed through the gauntlet @@ -93,7 +93,7 @@ class ReactController extends Gdn_Controller { // Make sure the action exists and the user is allowed to react if(!$Action) { - throw new Gdn_UserException('Invalid Action'); + throw new Gdn_UserException(T('Invalid Action')); } if(!Gdn::Session()->CheckPermission($Action->Permission)) { @@ -107,13 +107,13 @@ class ReactController extends Gdn_Controller { $Anchor = '#Comment_' . $CommentID . ' .ReactMenu'; } else { - throw new Gdn_UserException('Invalid ID'); + throw new Gdn_UserException(T('Invalid ID')); } $UserID = Gdn::Session()->UserID; if($Comment->InsertUserID == $UserID) { - throw new Gdn_UserException('You cannot react to your own content.'); + throw new Gdn_UserException(T('You cannot react to your own content.')); } // It has passed through the gauntlet @@ -138,7 +138,7 @@ class ReactController extends Gdn_Controller { // Make sure the action exists and the user is allowed to react if(!$Action) { - throw new Gdn_UserException('Invalid Action'); + throw new Gdn_UserException(T('Invalid Action')); } if(!Gdn::Session()->CheckPermission($Action->Permission)) { @@ -152,13 +152,13 @@ class ReactController extends Gdn_Controller { $Anchor = '#Activity_' . $ActivityID . ' .ReactMenu'; } else { - throw new Gdn_UserException('Invalid ID'); + throw new Gdn_UserException(T('Invalid ID')); } $UserID = Gdn::Session()->UserID; if($Activity['ActivityUserID'] == $UserID) { - throw new Gdn_UserException('You cannot react to your own content.'); + throw new Gdn_UserException(T('You cannot react to your own content.')); } // It has passed through the gauntlet diff --git a/controllers/class.rulescontroller.php b/controllers/class.rulescontroller.php index 8ceb3ba..26dc0e3 100644 --- a/controllers/class.rulescontroller.php +++ b/controllers/class.rulescontroller.php @@ -72,7 +72,7 @@ class RulesController extends YagaController { $this->RenderData($Data); } else { - $this->RenderException(new Gdn_UserException('Rule not found.')); + $this->RenderException(new Gdn_UserException(T('Rule not found.'))); } } } diff --git a/lib/functions.render.php b/lib/functions.render.php index a38cc5d..33a8d92 100644 --- a/lib/functions.render.php +++ b/lib/functions.render.php @@ -13,7 +13,7 @@ * @param bool $Echo Should it be echoed? * @return mixed String if $Echo is false, TRUE otherwise */ -if(!function_exists('RenderActions')) { +if(!function_exists('RenderReactions')) { function RenderReactions($ID, $Type, $Echo = TRUE) { $Reactions = Yaga::ReactionModel()->GetAllReactions($ID, $Type); @@ -46,7 +46,7 @@ if(!function_exists('RenderActions')) { * @param int $ID * @param enum $Type 'discussion', 'activity', or 'comment' */ -if(!function_exists('RenderActions')) { +if(!function_exists('RenderReactionRecord')) { function RenderReactionRecord($ID, $Type) { $Reactions = Yaga::ReactionModel()->GetAllReactions($ID, $Type); diff --git a/models/class.badgemodel.php b/models/class.badgemodel.php index d4c0d51..98d0724 100644 --- a/models/class.badgemodel.php +++ b/models/class.badgemodel.php @@ -188,7 +188,7 @@ class BadgeModel extends Gdn_Model { 'RecordType' => 'Badge', 'RecordID' => $BadgeID, 'Route' => '/badges/detail/' . $Badge->BadgeID . '/' . Gdn_Format::Url($Badge->Name), - 'HeadlineFormat' => '{RegardingUserID,You} earned the {Data.Name,text} badge.', + 'HeadlineFormat' => T('Yaga.HeadlineFormat.BadgeEarned', '{RegardingUserID,You} earned the {Data.Name,text} badge.'), 'Data' => array( 'Name' => $Badge->Name ), diff --git a/models/class.rankmodel.php b/models/class.rankmodel.php index 3c28335..0663681 100644 --- a/models/class.rankmodel.php +++ b/models/class.rankmodel.php @@ -145,7 +145,7 @@ class RankModel extends Gdn_Model { 'RecordType' => 'Rank', 'RecordID' => $RankID, 'Route' => '/ranks/detail/' . $Rank->RankID . '/' . Gdn_Format::Url($Rank->Name), - 'HeadlineFormat' => '{RegardingUserID,You} have been promoted to {Data.Name,text}.', + 'HeadlineFormat' => T('Yaga.HeadlineFormat.Promoted', '{RegardingUserID,You} have been promoted to {Data.Name,text}.'), 'Data' => array( 'Name' => $Rank->Name ), diff --git a/models/empty b/models/empty deleted file mode 100755 index e69de29..0000000 diff --git a/modules/class.badgesmodule.php b/modules/class.badgesmodule.php index 2b9ba7e..393e5b6 100755 --- a/modules/class.badgesmodule.php +++ b/modules/class.badgesmodule.php @@ -19,10 +19,10 @@ class BadgesModule extends Gdn_Module { } if(Gdn::Session()->UserID == $UserID) { - $this->Title = 'My Badges'; + $this->Title = T('My Badges'); } else { - $this->Title = 'Badges'; + $this->Title = T('Badges'); } $BadgeModel = new BadgeModel(); diff --git a/rules/class.awardcombo.php b/rules/class.awardcombo.php index a113292..f0c19d2 100644 --- a/rules/class.awardcombo.php +++ b/rules/class.awardcombo.php @@ -36,14 +36,14 @@ class AwardCombo implements YagaRule { public function Form($Form) { $Lengths = array( - 'day' => 'Days', - 'week' => 'Weeks', - 'year' => 'Years' + 'day' => T('Days'), + 'week' => T('Weeks'), + 'year' => T('Years') ); - $String = $Form->Label('Number of Badge Types', 'AwardCombo'); + $String = $Form->Label(T('Number of Badge Types'), 'AwardCombo'); $String .= $Form->Textbox('Target'); - $String .= $Form->Label('Time Frame'); + $String .= $Form->Label(T('Time Frame')); $String .= $Form->Textbox('Duration'); $String .= $Form->DropDown('Period', $Lengths); @@ -55,14 +55,12 @@ class AwardCombo implements YagaRule { } public function Description() { - $Description = 'This rule checks a users badge award type count within the past day. If it is a greater than or equal to the target, it will return true.'; + $Description = T('This rule checks a users badge award type count within the past day. If it is a greater than or equal to the target, it will return true.'); return $Description; } public function Name() { - return 'Award Combo'; + return T('Award Combo'); } } - -?> diff --git a/rules/class.commentcount.php b/rules/class.commentcount.php index defc0b0..58d4a29 100644 --- a/rules/class.commentcount.php +++ b/rules/class.commentcount.php @@ -35,16 +35,16 @@ class CommentCount implements YagaRule{ public function Form($Form) { $Comparisons = array( - 'gt' => 'more than:', - 'lt' => 'less than:', - 'gte' => 'more than or equal to:' + 'gt' => T('more than:'), + 'lt' => T('less than:'), + 'gte' => T('more than or equal to:') ); - $String = $Form->Label('Total comments', 'CommentCount'); - $String .= 'User has '; + $String = $Form->Label(T('Total comments'), 'CommentCount'); + $String .= T('User has '); $String .= $Form->DropDown('Comparison', $Comparisons); $String .= $Form->Textbox('Target'); - $String .= ' comments'; + $String .= T(' comments'); return $String; } @@ -54,14 +54,12 @@ class CommentCount implements YagaRule{ } public function Description() { - $Description = 'This rule checks a users total comment count against the criteria. If the user has more comments than the criteria, this will return true.'; + $Description = T('This rule checks a users total comment count against the criteria. If the user has more comments than the criteria, this will return true.'); return $Description; } public function Name() { - return 'Comment Count Total'; + return T('Comment Count Total'); } } - -?> diff --git a/rules/class.commentmarathon.php b/rules/class.commentmarathon.php index 7eb44d8..f23f7f4 100644 --- a/rules/class.commentmarathon.php +++ b/rules/class.commentmarathon.php @@ -31,14 +31,14 @@ class CommentMarathon implements YagaRule { public function Form($Form) { $Lengths = array( - 'day' => 'Days', - 'week' => 'Weeks', - 'year' => 'Years' + 'day' => T('Days'), + 'week' => T('Weeks'), + 'year' => T('Years') ); - $String = $Form->Label('Number of Comments', 'Comment Marathon'); + $String = $Form->Label(T('Number of Comments'), 'Comment Marathon'); $String .= $Form->Textbox('Target'); - $String .= $Form->Label('Time Frame'); + $String .= $Form->Label(T('Time Frame')); $String .= $Form->Textbox('Duration'); $String .= $Form->DropDown('Period', $Lengths); @@ -50,14 +50,12 @@ class CommentMarathon implements YagaRule { } public function Description() { - $Description = 'This rule checks a users comment count within the past duratio. If it is a greater than or equal to the target, it will return true.'; + $Description = T('This rule checks a users comment count within the past duratio. If it is a greater than or equal to the target, it will return true.'); return $Description; } public function Name() { - return 'Comment Marathon'; + return T('Comment Marathon'); } } - -?> diff --git a/rules/class.discussioncount.php b/rules/class.discussioncount.php index 20416a0..ab70a53 100644 --- a/rules/class.discussioncount.php +++ b/rules/class.discussioncount.php @@ -37,16 +37,16 @@ class DiscussionCount implements YagaRule{ public function Form($Form) { $Comparisons = array( - 'gt' => 'more than:', - 'lt' => 'less than:', - 'gte' => 'more than or equal to:' + 'gt' => T('more than:'), + 'lt' => T('less than:'), + 'gte' => T('more than or equal to:') ); - $String = $Form->Label('Total Discussions', 'DiscussionCount'); - $String .= 'User has '; + $String = $Form->Label(T('Total Discussions'), 'DiscussionCount'); + $String .= T('User has '); $String .= $Form->DropDown('Comparison', $Comparisons); $String .= $Form->Textbox('Target'); - $String .= ' discussions'; + $String .= T(' discussions'); return $String; } @@ -56,14 +56,12 @@ class DiscussionCount implements YagaRule{ } public function Description() { - $Description = 'This rule checks a users discussion count against the criteria. It will return true once the comparision is true.'; + $Description = T('This rule checks a users discussion count against the criteria. It will return true once the comparision is true.'); return $Description; } public function Name() { - return 'Discussion Count Total'; + return T('Discussion Count Total'); } } - -?> diff --git a/rules/class.hasmentioned.php b/rules/class.hasmentioned.php index 33591ae..a5b6289 100644 --- a/rules/class.hasmentioned.php +++ b/rules/class.hasmentioned.php @@ -31,14 +31,12 @@ class HasMentioned implements YagaRule{ } public function Description() { - $Description = 'This rule checks a users comment for mentions. If the user mentions someone, this will return true.'; + $Description = T('This rule checks a users comment for mentions. If the user mentions someone, this will return true.'); return $Description; } public function Name() { - return 'Mention'; + return T('Mention'); } } - -?> diff --git a/rules/class.holidayvisit.php b/rules/class.holidayvisit.php index 7f953a9..68f836a 100644 --- a/rules/class.holidayvisit.php +++ b/rules/class.holidayvisit.php @@ -33,7 +33,7 @@ class HolidayVisit implements YagaRule { $Days[$i] = $i; } - $String = $Form->Label('Holiday date', 'HolidayVisit'); + $String = $Form->Label(T('Holiday date'), 'HolidayVisit'); $String .= $Form->DropDown('Month', $Months); $String .= $Form->DropDown('Day', $Days); return $String; @@ -44,14 +44,12 @@ class HolidayVisit implements YagaRule { } public function Description() { - $Description = 'This rule checks a users visit date against the target date. If they visited on the same day of the year, it is awarded.'; + $Description = T('This rule checks a users visit date against the target date. If they visited on the same day of the year, it is awarded.'); return $Description; } public function Name() { - return 'Holiday Visit'; + return T('Holiday Visit'); } } - -?> diff --git a/rules/class.lengthofservice.php b/rules/class.lengthofservice.php index f85eeee..d043f18 100644 --- a/rules/class.lengthofservice.php +++ b/rules/class.lengthofservice.php @@ -22,12 +22,12 @@ class LengthOfService implements YagaRule { public function Form($Form) { $Lengths = array( - 'day' => 'Days', - 'week' => 'Weeks', - 'year' => 'Years' + 'day' => T('Days'), + 'week' => T('Weeks'), + 'year' => T('Years') ); - $String = $Form->Label('Time Served', 'LengthOfService'); + $String = $Form->Label(T('Time Served'), 'LengthOfService'); $String .= $Form->Textbox('Duration'); $String .= $Form->DropDown('Period', $Lengths); @@ -39,14 +39,12 @@ class LengthOfService implements YagaRule { } public function Description() { - $Description = 'This rule checks a users join date against the current date. It will return true if the account is older than the specified number of days, weeks, or years.'; + $Description = T('This rule checks a users join date against the current date. It will return true if the account is older than the specified number of days, weeks, or years.'); return $Description; } public function Name() { - return 'Length of Service'; + return T('Length of Service'); } } - -?> diff --git a/rules/class.manualaward.php b/rules/class.manualaward.php index 5057376..3cf2dec 100644 --- a/rules/class.manualaward.php +++ b/rules/class.manualaward.php @@ -23,14 +23,12 @@ class ManualAward implements YagaRule { } public function Description() { - $Description = 'This rule will never be awarded automatically and should be kept disabled. Use it for custom badges you want to hand out manually.'; + $Description = T('This rule will never be awarded automatically and should be kept disabled. Use it for badges you want to hand out manually.'); return $Description; } public function Name() { - return 'Manual Award'; + return T('Manual Award'); } } - -?> diff --git a/rules/class.newbiecomment.php b/rules/class.newbiecomment.php index 2dc0d9d..36b8756 100644 --- a/rules/class.newbiecomment.php +++ b/rules/class.newbiecomment.php @@ -36,12 +36,12 @@ class NewbieComment implements YagaRule{ public function Form($Form) { $Lengths = array( - 'day' => 'Days', - 'week' => 'Weeks', - 'year' => 'Years' + 'day' => T('Days'), + 'week' => T('Weeks'), + 'year' => T('Years') ); - $String = $Form->Label('User Newbness', 'NewbieComment'); + $String = $Form->Label(T('User Newbness'), 'NewbieComment'); $String .= $Form->Textbox('Duration'); $String .= $Form->DropDown('Period', $Lengths); @@ -53,14 +53,12 @@ class NewbieComment implements YagaRule{ } public function Description() { - $Description = 'This rule checks if a comment is placed on a newbs first discussion. If it is, this will return true.'; + $Description = T('This rule checks if a comment is placed on a newbs first discussion. If it is, this will return true.'); return $Description; } public function Name() { - return 'Comment on New User\'s Discussion'; + return T("Comment on New User's Discussion"); } } - -?> diff --git a/rules/class.photoexists.php b/rules/class.photoexists.php index 482481e..3f6bc21 100644 --- a/rules/class.photoexists.php +++ b/rules/class.photoexists.php @@ -27,14 +27,12 @@ class PhotoExists implements YagaRule { } public function Description() { - $Description = 'This rule returns true if the user has uploaded a profile photo'; + $Description = T('This rule returns true if the user has uploaded a profile photo.'); return $Description; } public function Name() { - return 'User has Avatar'; + return T('User has Avatar'); } } - -?> diff --git a/rules/class.reactioncount.php b/rules/class.reactioncount.php index b94401e..a79cd54 100644 --- a/rules/class.reactioncount.php +++ b/rules/class.reactioncount.php @@ -36,8 +36,8 @@ class ReactionCount implements YagaRule{ $Reactions[$Action->ActionID] = $Action->Name; } - $String = $Form->Label('Total reactions', 'ReactionCount'); - $String .= 'User has '; + $String = $Form->Label(T('Total reactions'), 'ReactionCount'); + $String .= T('User has '); $String .= $Form->Textbox('Target'); $String .= $Form->DropDown('ActionID', $Reactions); @@ -49,14 +49,12 @@ class ReactionCount implements YagaRule{ } public function Description() { - $Description = 'This rule checks a users reaction count against the target. It will return true once the user has as many or more than the given reactions count.'; + $Description = T('This rule checks a users reaction count against the target. It will return true once the user has as many or more than the given reactions count.'); return $Description; } public function Name() { - return 'Reaction Count Total'; + return T('Reaction Count Total'); } } - -?> diff --git a/rules/class.reflexcomment.php b/rules/class.reflexcomment.php index 13d67a5..3e8e16a 100644 --- a/rules/class.reflexcomment.php +++ b/rules/class.reflexcomment.php @@ -26,9 +26,9 @@ class ReflexComment implements YagaRule{ } public function Form($Form) { - $String = $Form->Label('Time to Comment', 'ReflexComment'); + $String = $Form->Label(T('Time to Comment'), 'ReflexComment'); $String .= $Form->Textbox('Seconds'); - $String .= ' seconds.'; + $String .= T(' seconds.'); return $String; } @@ -38,14 +38,12 @@ class ReflexComment implements YagaRule{ } public function Description() { - $Description = 'This rule checks if a comment is placed within x seconds. If it is, this will return true.'; + $Description = T('This rule checks if a comment is placed within x seconds. If it is, this will return true.'); return $Description; } public function Name() { - return 'Comment on New Discussion Quickly'; + return T('Comment on New Discussion Quickly'); } } - -?> diff --git a/rules/class.socialconnection.php b/rules/class.socialconnection.php index 08c44cd..258b7c4 100644 --- a/rules/class.socialconnection.php +++ b/rules/class.socialconnection.php @@ -27,8 +27,8 @@ class SocialConnection implements YagaRule{ 'Facebook' => 'Facebook' ); - $String = $Form->Label('Social Networks', 'SocialConnection'); - $String .= 'User has connect to: '; + $String = $Form->Label(T('Social Networks'), 'SocialConnection'); + $String .= T('User has connect to: '); $String .= $Form->DropDown('SocialNetwork', $SocialNetworks); return $String; @@ -39,14 +39,12 @@ class SocialConnection implements YagaRule{ } public function Description() { - $Description = 'This rule checks if a user has connected to the target social network. If the user has, this will return true.'; + $Description = T('This rule checks if a user has connected to the target social network. If the user has, this will return true.'); return $Description; } public function Name() { - return 'Social Connections'; + return T('Social Connections'); } } - -?> diff --git a/rules/interface.yagarule.php b/rules/interface.yagarule.php index 3b7fa6e..474718a 100644 --- a/rules/interface.yagarule.php +++ b/rules/interface.yagarule.php @@ -47,4 +47,3 @@ interface YagaRule { */ public function Description(); } -?> diff --git a/settings/class.hooks.php b/settings/class.hooks.php index 817b03a..6c412b6 100755 --- a/settings/class.hooks.php +++ b/settings/class.hooks.php @@ -17,15 +17,15 @@ class YagaHooks implements Gdn_IPlugin { $Section = 'Gamification'; $Attrs = array('class' => $Section); $Menu->AddItem($Section, $Section, FALSE, $Attrs); - $Menu->AddLink($Section, 'Settings', 'configure', 'Garden.Settings.Manage'); + $Menu->AddLink($Section, T('Settings'), 'configure', 'Garden.Settings.Manage'); if(C('Yaga.Reactions.Enabled')) { - $Menu->AddLink($Section, 'Reactions', 'action/settings', 'Yaga.Reactions.Manage'); + $Menu->AddLink($Section, T('Reactions'), 'action/settings', 'Yaga.Reactions.Manage'); } if(C('Yaga.Badges.Enabled')) { - $Menu->AddLink($Section, 'Badges', 'badge/settings', 'Yaga.Badges.Manage'); + $Menu->AddLink($Section, T('Badges'), 'badge/settings', 'Yaga.Badges.Manage'); } if(C('Yaga.Ranks.Enabled')) { - $Menu->AddLink($Section, 'Ranks', 'rank/settings', 'Yaga.Ranks.Manage'); + $Menu->AddLink($Section, T('Ranks'), 'rank/settings', 'Yaga.Ranks.Manage'); } } @@ -92,7 +92,7 @@ class YagaHooks implements Gdn_IPlugin { // Tell the ProfileController what tab to load $Sender->GetUserInfo($UserReference, $Username, $UserID); $Sender->_SetBreadcrumbs(T('Reactions'), UserUrl($Sender->User, '', 'reactions')); - $Sender->SetTabView('Reactions', 'reactions', 'profile', 'Yaga'); + $Sender->SetTabView(T('Reactions'), 'reactions', 'profile', 'Yaga'); $Sender->AddJsFile('jquery.expander.js'); $Sender->AddJsFile('reactions.js', 'yaga'); diff --git a/views/action/add.php b/views/action/add.php index 7b394ec..98e10b7 100644 --- a/views/action/add.php +++ b/views/action/add.php @@ -51,7 +51,7 @@ echo $this->Form->Errors(); ?>
  • - Advanced Settings +
    Form->Label('CSS Class', 'CssClass'); diff --git a/views/action/settings.php b/views/action/settings.php index b701df3..0b9c137 100644 --- a/views/action/settings.php +++ b/views/action/settings.php @@ -3,8 +3,8 @@ // TODO: Consider using a reusable help_functions file like core echo Wrap($this->Title(), 'h1'); -echo Wrap(Wrap('Add or edit the available actions that can be used as reactions.', 'div'), 'div', array('class' => 'Wrap')); -echo Wrap(Anchor('Add Action', 'yaga/action/add', array('class' => 'Popup SmallButton')), 'div', array('class' => 'Wrap')); +echo Wrap(Wrap(T('Add or edit the available actions that can be used as reactions.'), 'div'), 'div', array('class' => 'Wrap')); +echo Wrap(Anchor(T('Add Action'), 'yaga/action/add', array('class' => 'Popup SmallButton')), 'div', array('class' => 'Wrap')); ?>

      diff --git a/views/badge/settings.php b/views/badge/settings.php index 0bd5506..8dcf832 100644 --- a/views/badge/settings.php +++ b/views/badge/settings.php @@ -4,20 +4,20 @@ $Rules = $this->Data('Rules'); echo Wrap($this->Title(), 'h1'); -echo Wrap(Wrap('Add or edit the available badges that can be earned.', 'div'), 'div', array('class' => 'Wrap')); -echo Wrap(Anchor('Add Badge', 'yaga/badge/add', array('class' => 'SmallButton')), 'div', array('class' => 'Wrap')); +echo Wrap(Wrap(T('Add or edit the available badges that can be earned.'), 'div'), 'div', array('class' => 'Wrap')); +echo Wrap(Anchor(T('Add Badge'), 'yaga/badge/add', array('class' => 'SmallButton')), 'div', array('class' => 'Wrap')); ?> - - - - - - - + + + + + + + diff --git a/views/badges/all.php b/views/badges/all.php index 1b78057..e5e4ec2 100644 --- a/views/badges/all.php +++ b/views/badges/all.php @@ -14,7 +14,7 @@ foreach($this->Data('Badges') as $Badge) { if($Badge->UserID == Gdn::Session()->UserID) { $ReadClass = ''; - $AwardDescription = 'You earned this badge ' . Gdn_Format::Date($Badge->DateInserted, 'html') . ' from ' . $Badge->InsertUserName; + $AwardDescription = T('You earned this badge ') . Gdn_Format::Date($Badge->DateInserted, 'html') . T(' from ') . $Badge->InsertUserName; if($Badge->Reason) { $AwardDescription .= ': "' . $Badge->Reason . '"'; } diff --git a/views/modules/badges.php b/views/modules/badges.php index e5f55dd..f2da94a 100644 --- a/views/modules/badges.php +++ b/views/modules/badges.php @@ -2,7 +2,7 @@ /* Copyright 2013 Zachary Doll */ echo '
      '; -echo '

      ' . T($this->Title) . '

      '; +echo '

      ' . $this->Title . '

      '; echo '
      '; foreach($this->Data as $Badge) { echo Anchor( diff --git a/views/modules/leaderboard.php b/views/modules/leaderboard.php index 5edf190..b04bf77 100644 --- a/views/modules/leaderboard.php +++ b/views/modules/leaderboard.php @@ -2,7 +2,7 @@ /* Copyright 2013 Zachary Doll */ echo '
      '; -echo '

      ' . T($this->Title) . '

      '; +echo '

      ' . $this->Title . '

      '; echo '
        '; foreach($this->Data as $Leader) { diff --git a/views/rank/settings.php b/views/rank/settings.php index 0fef503..3771399 100644 --- a/views/rank/settings.php +++ b/views/rank/settings.php @@ -2,20 +2,20 @@ /* Copyright 2013 Zachary Doll */ echo Wrap($this->Title(), 'h1'); -echo Wrap(Wrap('Add or edit the available ranks that can be earned.', 'div'), 'div', array('class' => 'Wrap')); -echo Wrap(Anchor('Add Rank', 'yaga/rank/add', array('class' => 'SmallButton')), 'div', array('class' => 'Wrap')); +echo Wrap(Wrap(T('Add or edit the available ranks that can be earned.'), 'div'), 'div', array('class' => 'Wrap')); +echo Wrap(Anchor(T('Add Rank'), 'yaga/rank/add', array('class' => 'SmallButton')), 'div', array('class' => 'Wrap')); ?>
      ImageNameDescriptionRuleAward ValueActiveOptions
      - - - - - - - + + + + + + +
      ImageNameDescriptionPoints RequiredPermission AwardAuto AwardOptions