From c4bd5b5f156ae09425ef9112d90e7b53a74d20dc Mon Sep 17 00:00:00 2001 From: Zachary Doll Date: Wed, 4 Dec 2013 14:09:26 -0600 Subject: [PATCH] Synced locale up with definitions in use. Also namespaced most definitions --- controllers/class.actioncontroller.php | 10 +- controllers/class.badgecontroller.php | 16 +-- controllers/class.badgescontroller.php | 4 +- controllers/class.bestofcontroller.php | 4 +- controllers/class.configurecontroller.php | 2 +- controllers/class.rankcontroller.php | 16 +-- controllers/class.reactcontroller.php | 18 +-- controllers/class.rulescontroller.php | 2 +- locale/en-CA/definitions.php | 144 ++++++++++++++++++++++ models/class.badgemodel.php | 2 +- models/class.rankmodel.php | 2 +- modules/class.badgesmodule.php | 4 +- modules/class.leaderboardmodule.php | 8 +- rules/class.awardcombo.php | 8 +- rules/class.commentcount.php | 10 +- rules/class.commentmarathon.php | 8 +- rules/class.discussioncount.php | 10 +- rules/class.hasmentioned.php | 4 +- rules/class.holidayvisit.php | 6 +- rules/class.lengthofservice.php | 6 +- rules/class.manualaward.php | 4 +- rules/class.newbiecomment.php | 6 +- rules/class.photoexists.php | 4 +- rules/class.reactioncount.php | 8 +- rules/class.reflexcomment.php | 8 +- rules/class.socialconnection.php | 6 +- settings/class.hooks.php | 22 ++-- views/action/add.php | 6 +- views/action/settings.php | 6 +- views/badge/add.php | 4 +- views/badge/award.php | 8 +- views/badge/settings.php | 4 +- views/badges/all.php | 2 +- views/badges/detail.php | 8 +- views/rank/award.php | 8 +- views/rank/settings.php | 6 +- 36 files changed, 269 insertions(+), 125 deletions(-) diff --git a/controllers/class.actioncontroller.php b/controllers/class.actioncontroller.php index cd4affa..e6be5d5 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(T('Manage Reactions')); + $this->Title(T('Yaga.ManageReactions')); // 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(T('Add Action')); + $this->Title(T('Yaga.AddAction')); if($ActionID) { $this->Action = $this->ActionModel->GetAction($ActionID); $this->Form->AddHidden('ActionID', $ActionID); $Edit = TRUE; - $this->Title(T('Edit Action')); + $this->Title(T('Yaga.EditAction')); } // 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(T('Action updated successfully!')); + $this->InformMessage(T('Yaga.ActionUpdated')); } else { $this->JsonTarget('#Actions', $NewActionRow, 'Append'); - $this->InformMessage(T('Action added successfully!')); + $this->InformMessage(T('Yaga.ActionAdded')); } } } diff --git a/controllers/class.badgecontroller.php b/controllers/class.badgecontroller.php index 68ca022..ac186bb 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(T('Manage Badges')); + $this->Title(T('Yaga.ManageBadges')); // 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(T('You cannot add or edit badges without rules!')); + throw new Gdn_UserException(T('Yaga.Error.NoRules')); } $Edit = FALSE; @@ -111,10 +111,10 @@ class BadgeController extends DashboardController { $this->Form->SetFormValue('RuleCriteria', $SerializedCriteria); if($this->Form->Save()) { if($Edit) { - $this->InformMessage(T('Badge updated successfully!')); + $this->InformMessage(T('Yaga.BadgeUpdated')); } else { - $this->InformMessage(T('Badge added successfully!')); + $this->InformMessage(T('Yaga.BadgeAdded')); } Redirect('/yaga/badge/settings'); } @@ -153,7 +153,7 @@ class BadgeController extends DashboardController { */ public function Toggle($BadgeID) { if(!$this->Request->IsPostBack()) { - throw new Gdn_UserException(T('That must be done via Javascript')); + throw new Gdn_UserException(T('Yaga.Error.NeedJS')); } $this->Permission('Yaga.Badges.Manage'); $this->AddSideMenu('badge/settings'); @@ -191,7 +191,7 @@ class BadgeController extends DashboardController { if (Gdn::Session()->ValidateTransientKey($TransientKey)) { $this->BadgeModel->SetField($BadgeID, 'Photo', NULL); - $this->InformMessage(T('Badge photo has been deleted.')); + $this->InformMessage(T('Yaga.BadgePhotoDeleted')); } if ($this->_DeliveryType == DELIVERY_TYPE_ALL) { @@ -216,7 +216,7 @@ class BadgeController extends DashboardController { // Only allow awarding if some badges exist if(!$this->BadgeModel->GetBadgeCount()) { - throw new Gdn_UserException(T('You cannot award badges without any badges defined.')); + throw new Gdn_UserException(T('Yaga.Error.NoBadges')); } $UserModel = Gdn::UserModel(); @@ -242,7 +242,7 @@ class BadgeController extends DashboardController { if($Validation->Validate($this->Request->Post())) { $FormValues = $this->Form->FormValues(); if($this->BadgeModel->UserHasBadge($FormValues['UserID'], $FormValues['BadgeID'])) { - $this->Form->AddError($User->Name . T(' already has this badge!'), 'BadgeID'); + $this->Form->AddError(sprintf(T('Yaga.BadgeAlreadyAwarded'), $User->Name), 'BadgeID'); // Need to respecify the user id $this->Form->AddHidden('UserID', $User->UserID); } diff --git a/controllers/class.badgescontroller.php b/controllers/class.badgescontroller.php index 200e2fe..14ab83a 100644 --- a/controllers/class.badgescontroller.php +++ b/controllers/class.badgescontroller.php @@ -45,7 +45,7 @@ class BadgesController extends Gdn_Controller { * This renders out the full list of badges */ public function All() { - $this->Title(T('All Badges')); + $this->Title(T('Yaga.AllBadges')); $UserID = Gdn::Session()->UserID; // Get list of badges from the model and pass to the view @@ -78,7 +78,7 @@ class BadgesController extends Gdn_Controller { $this->SetData('UserBadgeAward', $UserBadgeAward); $this->SetData('Badge', $Badge); - $this->Title(T('View Badge: ') . $Badge->Name); + $this->Title(T('Yaga.ViewBadge') . $Badge->Name); $this->Render(); } diff --git a/controllers/class.bestofcontroller.php b/controllers/class.bestofcontroller.php index f1c859e..786f5a5 100644 --- a/controllers/class.bestofcontroller.php +++ b/controllers/class.bestofcontroller.php @@ -37,12 +37,12 @@ class BestOfController extends Gdn_Controller { * This renders out the full list of badges */ public function All() { - $this->Title(T('Best of Everything')); + $this->Title(T('Yaga.BestOfEverything')); $Module = new PromotedContentModule(); $Module->Selector = 'Score'; $this->SetData('Module', $Module); - $this->Title(T('Best Of...')); + $this->Title(T('Yaga.BestOf')); $this->Render('all'); } } diff --git a/controllers/class.configurecontroller.php b/controllers/class.configurecontroller.php index 7f87e41..c9a450a 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->Title(T('Yaga.Settings', 'Gamification Settings')); + $this->Title(T('Yaga.Settings')); $this->ConfigurationModule = $ConfigModule; $ConfigModule->RenderAll(); } diff --git a/controllers/class.rankcontroller.php b/controllers/class.rankcontroller.php index 2381c61..61d5034 100644 --- a/controllers/class.rankcontroller.php +++ b/controllers/class.rankcontroller.php @@ -40,7 +40,7 @@ class RankController extends DashboardController { $this->Permission('Yaga.Ranks.Manage'); $this->AddSideMenu('rank/settings'); - $this->Title(T('Manage Ranks')); + $this->Title(T('Yaga.ManageRanks')); // Get list of ranks from the model and pass to the view $this->SetData('Ranks', $this->RankModel->GetRanks()); @@ -59,13 +59,13 @@ class RankController extends DashboardController { $this->AddSideMenu('rank/settings'); $this->Form->SetModel($this->RankModel); - $this->Title(T('Add Rank')); + $this->Title(T('Yaga.AddRank')); $Edit = FALSE; if($RankID) { $this->Rank = $this->RankModel->GetRank($RankID); $this->Form->AddHidden('RankID', $RankID); $Edit = TRUE; - $this->Title(T('Edit Rank')); + $this->Title(T('Yaga.EditRank')); } // Load up all permissions @@ -101,10 +101,10 @@ class RankController extends DashboardController { if($this->Form->Save()) { if($Edit) { - $this->InformMessage(T('Rank updated successfully!')); + $this->InformMessage(T('Yaga.RankUpdated')); } else { - $this->InformMessage(T('Rank added successfully!')); + $this->InformMessage(T('Yaga.RankAdded')); } Redirect('/yaga/rank/settings'); } @@ -181,7 +181,7 @@ class RankController extends DashboardController { if (Gdn::Session()->ValidateTransientKey($TransientKey)) { $this->RankModel->SetField($RankID, 'Photo', NULL); - $this->InformMessage(T('Rank photo has been deleted.')); + $this->InformMessage(T('Yaga.RankPhotoDeleted')); } if ($this->_DeliveryType == DELIVERY_TYPE_ALL) { @@ -206,7 +206,7 @@ class RankController extends DashboardController { // Only allow awarding if some ranks exist if(!$this->RankModel->GetRankCount()) { - throw new Gdn_UserException(T('You cannot promote users without any ranks defined.')); + throw new Gdn_UserException(T('Yaga.Error.NoRanks')); } $UserModel = Gdn::UserModel(); @@ -232,7 +232,7 @@ class RankController extends DashboardController { if($Validation->Validate($this->Request->Post())) { $FormValues = $this->Form->FormValues(); if($this->RankModel->UserHasRank($FormValues['UserID'], $FormValues['RankID'])) { - $this->Form->AddError($User->Name . T(' already has this rank!'), 'RankID'); + $this->Form->AddError(sprintf(T('Yaga.RankAlreadyAttained'), $User->Name), 'RankID'); // Need to respecify the user id $this->Form->AddHidden('UserID', $User->UserID); } diff --git a/controllers/class.reactcontroller.php b/controllers/class.reactcontroller.php index 3b5580f..8c587a0 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(T('Invalid Action')); + throw new Gdn_UserException(T('Yaga.InvalidAction')); } if(!Gdn::Session()->CheckPermission($Action->Permission)) { @@ -62,13 +62,13 @@ class ReactController extends Gdn_Controller { $Anchor = '#Discussion_' . $DiscussionID . ' .ReactMenu'; } else { - throw new Gdn_UserException(T('Invalid ID')); + throw new Gdn_UserException(T('Yaga.InvalidID')); } $UserID = Gdn::Session()->UserID; if($Discussion->InsertUserID == $UserID) { - throw new Gdn_UserException(T('You cannot react to your own content.')); + throw new Gdn_UserException(T('Yaga.Error.ReactToOwn')); } // 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(T('Invalid Action')); + throw new Gdn_UserException(T('Yaga.InvalidAction')); } if(!Gdn::Session()->CheckPermission($Action->Permission)) { @@ -107,13 +107,13 @@ class ReactController extends Gdn_Controller { $Anchor = '#Comment_' . $CommentID . ' .ReactMenu'; } else { - throw new Gdn_UserException(T('Invalid ID')); + throw new Gdn_UserException(T('Yaga.InvalidID')); } $UserID = Gdn::Session()->UserID; if($Comment->InsertUserID == $UserID) { - throw new Gdn_UserException(T('You cannot react to your own content.')); + throw new Gdn_UserException(T('Yaga.Error.ReactToOwn')); } // 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(T('Invalid Action')); + throw new Gdn_UserException(T('Yaga.InvalidAction')); } if(!Gdn::Session()->CheckPermission($Action->Permission)) { @@ -152,13 +152,13 @@ class ReactController extends Gdn_Controller { $Anchor = '#Activity_' . $ActivityID . ' .ReactMenu'; } else { - throw new Gdn_UserException(T('Invalid ID')); + throw new Gdn_UserException(T('Yaga.InvalidID')); } $UserID = Gdn::Session()->UserID; if($Activity['ActivityUserID'] == $UserID) { - throw new Gdn_UserException(T('You cannot react to your own content.')); + throw new Gdn_UserException(T('Yaga.Error.ReactToOwn')); } // It has passed through the gauntlet diff --git a/controllers/class.rulescontroller.php b/controllers/class.rulescontroller.php index 26dc0e3..52a2bb4 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(T('Rule not found.'))); + $this->RenderException(new Gdn_UserException(T('Yaga.Error.Rule404'))); } } } diff --git a/locale/en-CA/definitions.php b/locale/en-CA/definitions.php index fc9e939..52cb8f0 100755 --- a/locale/en-CA/definitions.php +++ b/locale/en-CA/definitions.php @@ -1,4 +1,148 @@ {Data.Name,text} badge.'; +$Definition['Yaga.HeadlineFormat.Promoted'] = '{RegardingUserID,You} have been promoted to {Data.Name,text}.'; + +// Leaderboard Module +$Definition['Yaga.LeaderBoard.AllTime'] = 'All Time Leaders'; +$Definition['Yaga.LeaderBoard.Week'] = "This Week's Leaders"; +$Definition['Yaga.LeaderBoard.Month'] = "This Month's Leaders"; +$Definition['Yaga.LeaderBoard.Year'] = "This Years's Leaders"; + +// Notifications +$Definition['Yaga.Notifications.Badges'] = 'Notify me when I earn a badge.'; +$Definition['Yaga.Notifications.Ranks'] = 'Notify me when I am promoted in rank.'; + +// Misc +$Definition['Edit'] = 'Edit'; +$Definition['Delete'] = 'Delete'; +$Definition['Image'] = 'Image'; +$Definition['Rule'] = 'Rule'; +$Definition['Active'] = 'Active'; +$Definition['Options'] = 'Options'; +$Definition['Name'] = 'Name'; +$Definition['Description'] = 'Description'; +$Definition['None'] = 'None'; +$Definition['Icon'] = 'Icon'; +$Definition['Tooltip'] = 'Tooltip'; +$Definition['Award Value'] = 'Award Value'; +$Definition['Elevated Permission'] = 'Elevated Permission'; +$Definition['Points Required'] = 'Points Required'; +$Definition['Role Award'] = 'Role Award'; +$Definition['Auto Award'] = 'Auto Award'; +$Definition['Enabled'] = 'Enabled'; +$Definition['Disabled'] = 'Disabled'; + +// Rules +$Definition['Days'] = 'Days'; +$Definition['Weeks'] = 'Weeks'; +$Definition['Years'] = 'Years'; +$Definition['more than:'] = 'more than:'; +$Definition['less than:'] = 'less than:'; +$Definition['more than or equal to:'] = 'more than or equal to:'; +$Definition['User has'] = 'User has'; +$Definition['Number of Badge Types'] = 'Number of Badge Types'; +$Definition['Time Frame'] = 'Time Frame'; +$Definition['Number of Comments'] = 'Number of Comments'; +$Definition['Time Frame'] = 'Time Frame'; +$Definition['Total Comments'] = 'Total Comments'; +$Definition['Total Discussions'] = 'Total Discussions'; +$Definition['Holiday date'] = 'Holiday date'; +$Definition['Time Served'] = 'Time Served'; +$Definition['User Newbness'] = 'User Newbness'; +$Definition['Total Reactions'] = 'Total Reactions'; +$Definition['Time to Comment'] = 'Time to Comment'; +$Definition['seconds.'] = 'seconds.'; +$Definition['Social Networks'] = 'Social Networks'; +$Definition['User has connect to: '] = 'User has connect to: '; + +$Definition['Yaga.Rules.AwardCombo'] = 'Award Combo'; +$Definition['Yaga.Rules.AwardCombo.Desc'] = '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.'; +$Definition['Yaga.Rules.CommentCount'] = 'Comment Count Total'; +$Definition['Yaga.Rules.CommentCount.Desc'] = 'This rule checks a users total comment count against the criteria. If the user has more comments than the criteria, this will return true.'; +$Definition['Yaga.Rules.CommentMarathon'] = 'Comment Marathon'; +$Definition['Yaga.Rules.CommentMarathon.Desc'] = '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.'; +$Definition['Yaga.Rules.DiscussionCount'] = 'Discussion Count Total'; +$Definition['Yaga.Rules.DiscussionCount.Desc'] = 'This rule checks a users total discussion count against the criteria. It will return true once the comparison is true.'; +$Definition['Yaga.Rules.HasMentioned'] = 'Mention'; +$Definition['Yaga.Rules.HasMentioned.Desc'] = 'This rule checks a users comment for mentions. If the user mentions someone, this will return true.'; +$Definition['Yaga.Rules.HolidayVisit'] = 'Holiday Visit'; +$Definition['Yaga.Rules.HolidayVisit.Desc'] = 'This rule checks a users visit date against the target date. If they visited on the same day of the year, it is awarded.'; +$Definition['Yaga.Rules.LengthOfService'] = 'Length of Service'; +$Definition['Yaga.Rules.LengthOfService.Desc'] = '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.'; +$Definition['Yaga.Rules.ManualAward'] = 'Manual Award'; +$Definition['Yaga.Rules.ManualAward.Desc'] = 'This rule will never be awarded automatically and should be kept disabled. Use it for badges you want to hand out manually.'; +$Definition['Yaga.Rules.NewbieComment'] = "Comment on New User's Discussion"; +$Definition['Yaga.Rules.NewbieComment.Desc'] = 'This rule checks if a comment is placed on a newbs first discussion. If it is, this will return true.'; +$Definition['Yaga.Rules.PhotoExists'] = 'User has Avatar'; +$Definition['Yaga.Rules.PhotoExists.Desc'] = 'This rule returns true if the user has uploaded a profile photo.'; +$Definition['Yaga.Rules.ReactionCount'] = 'Reaction Count Total'; +$Definition['Yaga.Rules.ReactionCount.Desc'] = '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.'; +$Definition['Yaga.Rules.ReflexComment'] = 'Comment on New Discussion Quickly'; +$Definition['Yaga.Rules.ReflexComment.Desc'] = 'This rule checks if a comment is placed within x seconds. If it is, this will return true.'; +$Definition['Yaga.Rules.SocialConnection'] = 'Social Connections'; +$Definition['Yaga.Rules.SocialConnection.Desc'] = 'This rule checks if a user has connected to the target social network. If the user has, this will return true.'; diff --git a/models/class.badgemodel.php b/models/class.badgemodel.php index 98d0724..da0a298 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' => T('Yaga.HeadlineFormat.BadgeEarned', '{RegardingUserID,You} earned the {Data.Name,text} badge.'), + 'HeadlineFormat' => T('Yaga.HeadlineFormat.BadgeEarned'), 'Data' => array( 'Name' => $Badge->Name ), diff --git a/models/class.rankmodel.php b/models/class.rankmodel.php index 0663681..65c07cd 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' => T('Yaga.HeadlineFormat.Promoted', '{RegardingUserID,You} have been promoted to {Data.Name,text}.'), + 'HeadlineFormat' => T('Yaga.HeadlineFormat.Promoted'), 'Data' => array( 'Name' => $Rank->Name ), diff --git a/modules/class.badgesmodule.php b/modules/class.badgesmodule.php index 393e5b6..97eb126 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 = T('My Badges'); + $this->Title = T('Yaga.MyBadges'); } else { - $this->Title = T('Badges'); + $this->Title = T('Yaga.Badges'); } $BadgeModel = new BadgeModel(); diff --git a/modules/class.leaderboardmodule.php b/modules/class.leaderboardmodule.php index 00d5ac6..106127a 100755 --- a/modules/class.leaderboardmodule.php +++ b/modules/class.leaderboardmodule.php @@ -32,16 +32,16 @@ class LeaderBoardModule extends Gdn_Module { $this->Data = $Leaders; switch($SlotType) { case 'a': - $this->Title = T('All Time Leaders'); + $this->Title = T('Yaga.LeaderBoard.AllTime'); break; case 'w': - $this->Title = T("This Week's Leaders"); + $this->Title = T('Yaga.LeaderBoard.Week'); break; case 'm': - $this->Title = T("This Month's Leaders"); + $this->Title = T('Yaga.LeaderBoard.Month'); break; case 'y': - $this->Title = T("This Years's Leaders"); + $this->Title = T('Yaga.LeaderBoard.Year'); break; } diff --git a/rules/class.awardcombo.php b/rules/class.awardcombo.php index f0c19d2..756a2a1 100644 --- a/rules/class.awardcombo.php +++ b/rules/class.awardcombo.php @@ -41,9 +41,9 @@ class AwardCombo implements YagaRule { 'year' => T('Years') ); - $String = $Form->Label(T('Number of Badge Types'), 'AwardCombo'); + $String = $Form->Label('Number of Badge Types', 'AwardCombo'); $String .= $Form->Textbox('Target'); - $String .= $Form->Label(T('Time Frame')); + $String .= $Form->Label('Time Frame'); $String .= $Form->Textbox('Duration'); $String .= $Form->DropDown('Period', $Lengths); @@ -55,12 +55,12 @@ class AwardCombo implements YagaRule { } public function Description() { - $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.'); + $Description = T('Yaga.Rules.AwardCombo.Desc'); return $Description; } public function Name() { - return T('Award Combo'); + return T('Yaga.Rules.AwardCombo'); } } diff --git a/rules/class.commentcount.php b/rules/class.commentcount.php index 58d4a29..16c0d3a 100644 --- a/rules/class.commentcount.php +++ b/rules/class.commentcount.php @@ -40,11 +40,11 @@ class CommentCount implements YagaRule{ 'gte' => T('more than or equal to:') ); - $String = $Form->Label(T('Total comments'), 'CommentCount'); - $String .= T('User has '); + $String = $Form->Label('Total comments', 'CommentCount'); + $String .= T('User has') . ' '; $String .= $Form->DropDown('Comparison', $Comparisons); $String .= $Form->Textbox('Target'); - $String .= T(' comments'); + $String .= ' ' . T('comments'); return $String; } @@ -54,12 +54,12 @@ class CommentCount implements YagaRule{ } public function Description() { - $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.'); + $Description = T('Yaga.Rules.CommentCount.Desc'); return $Description; } public function Name() { - return T('Comment Count Total'); + return T('Yaga.Rules.CommentCount'); } } diff --git a/rules/class.commentmarathon.php b/rules/class.commentmarathon.php index f23f7f4..a3aff22 100644 --- a/rules/class.commentmarathon.php +++ b/rules/class.commentmarathon.php @@ -36,9 +36,9 @@ class CommentMarathon implements YagaRule { 'year' => T('Years') ); - $String = $Form->Label(T('Number of Comments'), 'Comment Marathon'); + $String = $Form->Label('Number of Comments', 'CommentMarathon'); $String .= $Form->Textbox('Target'); - $String .= $Form->Label(T('Time Frame')); + $String .= $Form->Label('Time Frame'); $String .= $Form->Textbox('Duration'); $String .= $Form->DropDown('Period', $Lengths); @@ -50,12 +50,12 @@ class CommentMarathon implements YagaRule { } public function Description() { - $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.'); + $Description = T('Yaga.Rules.CommentMarathon.Desc'); return $Description; } public function Name() { - return T('Comment Marathon'); + return T('Yaga.Rules.CommentMarathon'); } } diff --git a/rules/class.discussioncount.php b/rules/class.discussioncount.php index ab70a53..91d0c7f 100644 --- a/rules/class.discussioncount.php +++ b/rules/class.discussioncount.php @@ -42,11 +42,11 @@ class DiscussionCount implements YagaRule{ 'gte' => T('more than or equal to:') ); - $String = $Form->Label(T('Total Discussions'), 'DiscussionCount'); - $String .= T('User has '); + $String = $Form->Label('Total Discussions', 'DiscussionCount'); + $String .= T('User has') . ' '; $String .= $Form->DropDown('Comparison', $Comparisons); $String .= $Form->Textbox('Target'); - $String .= T(' discussions'); + $String .= ' ' . T('discussions'); return $String; } @@ -56,12 +56,12 @@ class DiscussionCount implements YagaRule{ } public function Description() { - $Description = T('This rule checks a users discussion count against the criteria. It will return true once the comparision is true.'); + $Description = T('Yaga.Rules.DiscussionCount.Desc'); return $Description; } public function Name() { - return T('Discussion Count Total'); + return T('Yaga.Rules.DiscussionCount'); } } diff --git a/rules/class.hasmentioned.php b/rules/class.hasmentioned.php index a5b6289..ea2d402 100644 --- a/rules/class.hasmentioned.php +++ b/rules/class.hasmentioned.php @@ -31,12 +31,12 @@ class HasMentioned implements YagaRule{ } public function Description() { - $Description = T('This rule checks a users comment for mentions. If the user mentions someone, this will return true.'); + $Description = T('Yaga.Rules.HasMentioned.Desc'); return $Description; } public function Name() { - return T('Mention'); + return T('Yaga.Rules.HasMentioned'); } } diff --git a/rules/class.holidayvisit.php b/rules/class.holidayvisit.php index 68f836a..1346d79 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(T('Holiday date'), 'HolidayVisit'); + $String = $Form->Label('Holiday date', 'HolidayVisit'); $String .= $Form->DropDown('Month', $Months); $String .= $Form->DropDown('Day', $Days); return $String; @@ -44,12 +44,12 @@ class HolidayVisit implements YagaRule { } public function Description() { - $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.'); + $Description = T('Yaga.Rules.HolidayVisit.Desc'); return $Description; } public function Name() { - return T('Holiday Visit'); + return T('Yaga.Rules.HolidayVisit'); } } diff --git a/rules/class.lengthofservice.php b/rules/class.lengthofservice.php index d043f18..83eca83 100644 --- a/rules/class.lengthofservice.php +++ b/rules/class.lengthofservice.php @@ -27,7 +27,7 @@ class LengthOfService implements YagaRule { 'year' => T('Years') ); - $String = $Form->Label(T('Time Served'), 'LengthOfService'); + $String = $Form->Label('Time Served', 'LengthOfService'); $String .= $Form->Textbox('Duration'); $String .= $Form->DropDown('Period', $Lengths); @@ -39,12 +39,12 @@ class LengthOfService implements YagaRule { } public function Description() { - $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.'); + $Description = T('Yaga.Rules.LengthOfService.Desc'); return $Description; } public function Name() { - return T('Length of Service'); + return T('Yaga.Rules.LengthOfService'); } } diff --git a/rules/class.manualaward.php b/rules/class.manualaward.php index 3cf2dec..0f116ce 100644 --- a/rules/class.manualaward.php +++ b/rules/class.manualaward.php @@ -23,12 +23,12 @@ class ManualAward implements YagaRule { } public function Description() { - $Description = T('This rule will never be awarded automatically and should be kept disabled. Use it for badges you want to hand out manually.'); + $Description = T('Yaga.Rules.ManualAward.Desc'); return $Description; } public function Name() { - return T('Manual Award'); + return T('Yaga.Rules.ManualAward'); } } diff --git a/rules/class.newbiecomment.php b/rules/class.newbiecomment.php index 36b8756..bfe040d 100644 --- a/rules/class.newbiecomment.php +++ b/rules/class.newbiecomment.php @@ -41,7 +41,7 @@ class NewbieComment implements YagaRule{ 'year' => T('Years') ); - $String = $Form->Label(T('User Newbness'), 'NewbieComment'); + $String = $Form->Label('User Newbness', 'NewbieComment'); $String .= $Form->Textbox('Duration'); $String .= $Form->DropDown('Period', $Lengths); @@ -53,12 +53,12 @@ class NewbieComment implements YagaRule{ } public function Description() { - $Description = T('This rule checks if a comment is placed on a newbs first discussion. If it is, this will return true.'); + $Description = T('Yaga.Rules.NewbieComment.Desc'); return $Description; } public function Name() { - return T("Comment on New User's Discussion"); + return T('Yaga.Rules.NewbieComment'); } } diff --git a/rules/class.photoexists.php b/rules/class.photoexists.php index 3f6bc21..baacbf7 100644 --- a/rules/class.photoexists.php +++ b/rules/class.photoexists.php @@ -27,12 +27,12 @@ class PhotoExists implements YagaRule { } public function Description() { - $Description = T('This rule returns true if the user has uploaded a profile photo.'); + $Description = T('Yaga.Rules.PhotoExists.Desc'); return $Description; } public function Name() { - return T('User has Avatar'); + return T('Yaga.Rules.PhotoExists'); } } diff --git a/rules/class.reactioncount.php b/rules/class.reactioncount.php index a79cd54..93a31b2 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(T('Total reactions'), 'ReactionCount'); - $String .= T('User has '); + $String = $Form->Label('Total Reactions', 'ReactionCount'); + $String .= T('User has') . ' '; $String .= $Form->Textbox('Target'); $String .= $Form->DropDown('ActionID', $Reactions); @@ -49,12 +49,12 @@ class ReactionCount implements YagaRule{ } public function Description() { - $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.'); + $Description = T('Yaga.Rules.ReactionCount.Desc'); return $Description; } public function Name() { - return T('Reaction Count Total'); + return T('Yaga.Rules.ReactionCount'); } } diff --git a/rules/class.reflexcomment.php b/rules/class.reflexcomment.php index 3e8e16a..d59a28b 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(T('Time to Comment'), 'ReflexComment'); + $String = $Form->Label('Time to Comment', 'ReflexComment'); $String .= $Form->Textbox('Seconds'); - $String .= T(' seconds.'); + $String .= ' ' . T('seconds.'); return $String; } @@ -38,12 +38,12 @@ class ReflexComment implements YagaRule{ } public function Description() { - $Description = T('This rule checks if a comment is placed within x seconds. If it is, this will return true.'); + $Description = T('Yaga.Rules.ReflexComment.Desc'); return $Description; } public function Name() { - return T('Comment on New Discussion Quickly'); + return T('Yaga.Rules.ReflexComment'); } } diff --git a/rules/class.socialconnection.php b/rules/class.socialconnection.php index 258b7c4..62b5a63 100644 --- a/rules/class.socialconnection.php +++ b/rules/class.socialconnection.php @@ -27,7 +27,7 @@ class SocialConnection implements YagaRule{ 'Facebook' => 'Facebook' ); - $String = $Form->Label(T('Social Networks'), 'SocialConnection'); + $String = $Form->Label('Social Networks', 'SocialConnection'); $String .= T('User has connect to: '); $String .= $Form->DropDown('SocialNetwork', $SocialNetworks); @@ -39,12 +39,12 @@ class SocialConnection implements YagaRule{ } public function Description() { - $Description = T('This rule checks if a user has connected to the target social network. If the user has, this will return true.'); + $Description = T('Yaga.Rules.SocialConnection.Desc'); return $Description; } public function Name() { - return T('Social Connections'); + return T('Yaga.Rules.SocialConnection'); } } diff --git a/settings/class.hooks.php b/settings/class.hooks.php index 6c412b6..1172451 100755 --- a/settings/class.hooks.php +++ b/settings/class.hooks.php @@ -19,13 +19,13 @@ class YagaHooks implements Gdn_IPlugin { $Menu->AddItem($Section, $Section, FALSE, $Attrs); $Menu->AddLink($Section, T('Settings'), 'configure', 'Garden.Settings.Manage'); if(C('Yaga.Reactions.Enabled')) { - $Menu->AddLink($Section, T('Reactions'), 'action/settings', 'Yaga.Reactions.Manage'); + $Menu->AddLink($Section, T('Yaga.Reactions'), 'action/settings', 'Yaga.Reactions.Manage'); } if(C('Yaga.Badges.Enabled')) { - $Menu->AddLink($Section, T('Badges'), 'badge/settings', 'Yaga.Badges.Manage'); + $Menu->AddLink($Section, T('Yaga.Badges'), 'badge/settings', 'Yaga.Badges.Manage'); } if(C('Yaga.Ranks.Enabled')) { - $Menu->AddLink($Section, T('Ranks'), 'rank/settings', 'Yaga.Ranks.Manage'); + $Menu->AddLink($Section, T('Yaga.Ranks'), 'rank/settings', 'Yaga.Ranks.Manage'); } } @@ -91,8 +91,8 @@ 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(T('Reactions'), 'reactions', 'profile', 'Yaga'); + $Sender->_SetBreadcrumbs(T('Yaga.Reactions'), UserUrl($Sender->User, '', 'reactions')); + $Sender->SetTabView(T('Yaga.Reactions'), 'reactions', 'profile', 'Yaga'); $Sender->AddJsFile('jquery.expander.js'); $Sender->AddJsFile('reactions.js', 'yaga'); @@ -309,13 +309,13 @@ class YagaHooks implements Gdn_IPlugin { */ public function ProfileController_AfterPreferencesDefined_Handler($Sender) { if(C('Yaga.Badges.Enabled')) { - $Sender->Preferences['Notifications']['Email.Badges'] = T('Notify me when I earn a badge.'); - $Sender->Preferences['Notifications']['Popup.Badges'] = T('Notify me when I earn a badge.'); + $Sender->Preferences['Notifications']['Email.Badges'] = T('Yaga.Notifications.Badges'); + $Sender->Preferences['Notifications']['Popup.Badges'] = T('Yaga.Notifications.Badges'); } if(C('Yaga.Ranks.Enabled')) { - $Sender->Preferences['Notifications']['Email.Ranks'] = T('Notify me when I am promoted in rank.'); - $Sender->Preferences['Notifications']['Popup.Ranks'] = T('Notify me when I am promoted in rank.'); + $Sender->Preferences['Notifications']['Email.Ranks'] = T('Yaga.Notifications.Ranks'); + $Sender->Preferences['Notifications']['Popup.Ranks'] = T('Yaga.Notifications.Ranks'); } } @@ -328,7 +328,7 @@ class YagaHooks implements Gdn_IPlugin { if(Gdn::Session()->IsValid()) { if(CheckPermission('Yaga.Badges.Add')) { $Sender->EventArguments['ProfileOptions'][] = array( - 'Text' => Sprite('SpRibbon') . ' ' . T('Give Badge'), + 'Text' => Sprite('SpRibbon') . ' ' . T('Yaga.Badge.Award'), 'Url' => '/badge/award/' . $Sender->User->UserID, 'CssClass' => 'Popup' ); @@ -336,7 +336,7 @@ class YagaHooks implements Gdn_IPlugin { if(CheckPermission('Yaga.Ranks.Add')) { $Sender->EventArguments['ProfileOptions'][] = array( - 'Text' => Sprite('SpModeratorActivities') . ' ' . T('Promote'), + 'Text' => Sprite('SpModeratorActivities') . ' ' . T('Yaga.Rank.Promote'), 'Url' => '/rank/promote/' . $Sender->User->UserID, 'CssClass' => 'Popup' ); diff --git a/views/action/add.php b/views/action/add.php index 98e10b7..e63f34c 100644 --- a/views/action/add.php +++ b/views/action/add.php @@ -1,10 +1,10 @@ Form->GetValue('CssClass'); @@ -54,7 +54,7 @@ echo $this->Form->Errors();
Form->Label('CSS Class', 'CssClass'); + echo $this->Form->Label('Css Class', 'CssClass'); echo $this->Form->TextBox('CssClass'); ?>
diff --git a/views/action/settings.php b/views/action/settings.php index 0b9c137..509de8a 100644 --- a/views/action/settings.php +++ b/views/action/settings.php @@ -3,10 +3,10 @@ // TODO: Consider using a reusable help_functions file like core echo Wrap($this->Title(), 'h1'); -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')); +echo Wrap(Wrap(T('Yaga.Actions.Settings.Desc'), 'div'), 'div', array('class' => 'Wrap')); +echo Wrap(Anchor(T('Yaga.AddAction'), 'yaga/action/add', array('class' => 'Popup SmallButton')), 'div', array('class' => 'Wrap')); ?> -

+

    Data('Actions') as $Action) { diff --git a/views/badge/add.php b/views/badge/add.php index e0cdd1b..81d7ce3 100644 --- a/views/badge/add.php +++ b/views/badge/add.php @@ -5,11 +5,11 @@ $Rules = RulesController::GetRules(); if(property_exists($this, 'Badge')) { - echo Wrap(T('Edit Badge'), 'h1'); + echo Wrap(T('Yaga.EditBadge'), 'h1'); $RuleClass = $this->Badge->RuleClass; } else { - echo Wrap(T('Add Badge'), 'h1'); + echo Wrap(T('Yaga.AddBadge'), 'h1'); reset($Rules); $RuleClass = key($Rules); } diff --git a/views/badge/award.php b/views/badge/award.php index 10caa85..4ab3a55 100644 --- a/views/badge/award.php +++ b/views/badge/award.php @@ -5,18 +5,18 @@ $Badges = $this->Data('Badges'); $Username = $this->Data('Username', 'Unknown'); echo '
    '; -echo Wrap(T('Give a Badge to ') . $Username, 'h1'); +echo Wrap(sprintf(T('Yaga.Badge.GiveTo'), $Username), 'h1'); echo $this->Form->Open(); echo $this->Form->Errors(); echo Wrap( Wrap( - $this->Form->Label('Badge', 'BadgeID') . + $this->Form->Label('Yaga.Badge', 'BadgeID') . $this->Form->Dropdown('BadgeID', $Badges), 'li') . Wrap( - $this->Form->Label('Reason (optional)', 'Reason') . + $this->Form->Label('Yaga.Reason', 'Reason') . $this->Form->TextBox('Reason', array('Multiline' => TRUE)), 'li') . Wrap( @@ -25,6 +25,6 @@ echo Wrap( 'ul' ); -echo $this->Form->Close('Give Badge'); +echo $this->Form->Close('Yaga.Badge.Award'); echo '
    '; diff --git a/views/badge/settings.php b/views/badge/settings.php index 8dcf832..1c67329 100644 --- a/views/badge/settings.php +++ b/views/badge/settings.php @@ -4,8 +4,8 @@ $Rules = $this->Data('Rules'); echo Wrap($this->Title(), 'h1'); -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')); +echo Wrap(Wrap(T('Yaga.Badges.Settings.Desc'), 'div'), 'div', array('class' => 'Wrap')); +echo Wrap(Anchor(T('Yaga.AddBadge'), 'yaga/badge/add', array('class' => 'SmallButton')), 'div', array('class' => 'Wrap')); ?> diff --git a/views/badges/all.php b/views/badges/all.php index e5e4ec2..5bdb5a4 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 = T('You earned this badge ') . Gdn_Format::Date($Badge->DateInserted, 'html') . T(' from ') . $Badge->InsertUserName; + $AwardDescription = sprintf(T('Yaga.Badge.Earned.Format'), Gdn_Format::Date($Badge->DateInserted, 'html'), $Badge->InsertUserName); if($Badge->Reason) { $AwardDescription .= ': "' . $Badge->Reason . '"'; } diff --git a/views/badges/detail.php b/views/badges/detail.php index 0c25322..bfb7516 100644 --- a/views/badges/detail.php +++ b/views/badges/detail.php @@ -18,21 +18,21 @@ echo '
    '; if($UserBadgeAward) { echo Wrap( UserPhoto(Gdn::Session()->User) . - T('You earned this badge') . ' ' . + T('Yaga.Badge.Earned') . ' ' . Wrap(Gdn_Format::Date($UserBadgeAward->DateInserted, 'html'), 'span', array('class' => 'DateReceived')), 'div', array('class' => 'EarnedThisBadge')); } if($AwardCount) { - echo Wrap(Plural($AwardCount, '%s person has earned this badge.', '%s people have earned this badge.'), 'p', array('class' => 'BadgeCountDisplay')); + echo Wrap(Plural($AwardCount, 'Yaga.Badge.EarnedBySingle', 'Yaga.Badge.EarnedByPlural'), 'p', array('class' => 'BadgeCountDisplay')); } else { - echo Wrap(T('Nobody has earned this badge yet.'), 'p'); + echo Wrap(T('Yaga.Badge.EarnedByNone'), 'p'); } if($RecentAwards) { - echo Wrap(T('Most recent recipients'), 'h2'); + echo Wrap(T('Yaga.Badge.RecentRecipients'), 'h2'); echo '
    '; foreach($RecentAwards as $Award) { $User = UserBuilder($Award); diff --git a/views/rank/award.php b/views/rank/award.php index 2ae77d4..f340a2e 100644 --- a/views/rank/award.php +++ b/views/rank/award.php @@ -5,18 +5,18 @@ $Ranks = $this->Data('Ranks'); $Username = $this->Data('Username', 'Unknown'); echo '
    '; -echo Wrap(T('Give a Rank to ') . $Username, 'h1'); +echo Wrap(T('Yaga.Rank.Promote') . ' ' . $Username, 'h1'); echo $this->Form->Open(); echo $this->Form->Errors(); echo Wrap( Wrap( - $this->Form->Label('Rank', 'RankID') . + $this->Form->Label('Yaga.Rank', 'RankID') . $this->Form->Dropdown('RankID', $Ranks), 'li') . Wrap( - $this->Form->Label('Reason (optional)', 'Reason') . + $this->Form->Label('Yaga.Reason', 'Reason') . $this->Form->TextBox('Reason', array('Multiline' => TRUE)), 'li') . Wrap( @@ -25,6 +25,6 @@ echo Wrap( 'ul' ); -echo $this->Form->Close('Give Rank'); +echo $this->Form->Close('Yaga.Rank.Award'); echo '
    '; diff --git a/views/rank/settings.php b/views/rank/settings.php index 3771399..bf6527b 100644 --- a/views/rank/settings.php +++ b/views/rank/settings.php @@ -2,8 +2,8 @@ /* Copyright 2013 Zachary Doll */ echo Wrap($this->Title(), 'h1'); -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')); +echo Wrap(Wrap(T('Yaga.Ranks.Settings.Desc'), 'div'), 'div', array('class' => 'Wrap')); +echo Wrap(Anchor(T('Yaga.AddRank'), 'yaga/rank/add', array('class' => 'SmallButton')), 'div', array('class' => 'Wrap')); ?>
    @@ -13,7 +13,7 @@ echo Wrap(Anchor(T('Add Rank'), 'yaga/rank/add', array('class' => 'SmallButton') - +