Skip to content

Commit

Permalink
adding translations
Browse files Browse the repository at this point in the history
  • Loading branch information
srenberg committed Jan 12, 2012
1 parent 2168839 commit 5ccf990
Show file tree
Hide file tree
Showing 54 changed files with 3,519 additions and 676 deletions.
Binary file modified src/.DS_Store
Binary file not shown.
18 changes: 9 additions & 9 deletions src/classes/Milestone1_Email_Handler.cls
Expand Up @@ -38,15 +38,15 @@ global class Milestone1_Email_Handler implements Messaging.InboundEmailHandler
Parent Milestone is looked up based on Milestone Alias provided in Subject.
*/

public static final String REGEX_FWD_RE = '^[ ]*((([Ff][Ww][Dd])|([Rr][Ee]))[ ]*:[ ]*)*';
public static String ERROR_USERS_NOT_FOUND = 'The User seaches for Assignment (To Address) and/or Ownership (From Address) did not find matches to users in Salesforce.';
public static String ERROR_SUBJECT_MISSING_ALIAS = 'The subject line did not contain a milestone alias.';
public static String ERROR_ALIAS_NOT_FOUND = 'The alias provided in subject line did not match a milestone alias in Salesforce.';
public static String ERROR_FROM_USER_NOT_FOUND = 'The email sender did not match a user in Salesforce.';
public static String ERROR_TO_USER_NOT_FOUND = 'The list of recipients did not have any matches to a user in Salesforce.';
public static String ERROR_TASK_NOT_FOUND = 'A matching task was not found for this Email thread in Salesforce. Salesforce was unable to attach this email to the notes for a task.';
public static String ERROR_SUBJECT_MISSING_TASK = 'The subject line did not contain a task.';
public static String ERROR_SUBJECT_MISSING = 'The subject line did is empty.';
public static final String REGEX_FWD_RE = system.label.RegexFwdRe;
public static String ERROR_USERS_NOT_FOUND = system.label.UsersNotFound;
public static String ERROR_SUBJECT_MISSING_ALIAS = system.label.SubjectMissingAlias;
public static String ERROR_ALIAS_NOT_FOUND = system.label.ALiasNotFound;
public static String ERROR_FROM_USER_NOT_FOUND = system.label.FromUsersNotFound;
public static String ERROR_TO_USER_NOT_FOUND = system.label.ToUsersNotFound;
public static String ERROR_TASK_NOT_FOUND = system.label.TaskNotFound;
public static String ERROR_SUBJECT_MISSING_TASK = system.label.SubjectMissingTask;
public static String ERROR_SUBJECT_MISSING = system.label.SubjectMissing;

global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email, Messaging.InboundEnvelope envelope)
{
Expand Down
6 changes: 3 additions & 3 deletions src/classes/Milestone1_Email_Utility.cls
Expand Up @@ -28,9 +28,9 @@ OF THE POSSIBILITY OF SUCH DAMAGE.
*/
public with sharing class Milestone1_Email_Utility
{
public static final String EMAIL_SENDER_NAME = 'Project Milestone Nag Engine';
public static final String EMAIL_SUBJECT = 'Project Milestone Notification - Items require attention.';
public static final String EMAIL_BODY_START = 'The following Salesforce Project Milestone items are nagging you for attention: \n';
public static final String EMAIL_SENDER_NAME = system.label.ProjectMilestoneNagEngine;
public static final String EMAIL_SUBJECT = system.label.ProjectMilestoneNotification;
public static final String EMAIL_BODY_START = system.label.TheFollowingSalesforceProjectMilestoneItems;

public static Messaging.SingleEmailMessage buildEmail(List<Milestone1_Nag__c> nags, User recipient)
{
Expand Down
4 changes: 2 additions & 2 deletions src/classes/Milestone1_Export_Project_Controller.cls
Expand Up @@ -29,8 +29,8 @@ OF THE POSSIBILITY OF SUCH DAMAGE.
public with sharing class Milestone1_Export_Project_Controller {

private final String ERROR_STRING_FILE_TOO_LONG =
'Project is too large to export. Total characters must be less than ' + Milestone1_Import_Project_Controller.MAX_FILE_SIZE +
'. Current export would be $1 characters long. Please edit your project and try again';
system.label.ProjectIsTooLarge + Milestone1_Import_Project_Controller.MAX_FILE_SIZE +
system.label.CurrentExport;

public Milestone1_Project__c rec {get; set;}
public Boolean exportSuccess{get;set;}
Expand Down
2 changes: 1 addition & 1 deletion src/classes/Milestone1_GettingStartedController.cls
Expand Up @@ -43,7 +43,7 @@ public with sharing class Milestone1_GettingStartedController {
Milestone1_Settings__c settings = Milestone1_Settings__c.getOrgDefaults();

if (settings != null) {
lastResult = 'Settings already exist. No changes made.';
lastResult = system.label.SettingsAlreadyExistNoChanges;
} else {
settings = getInitialSettingsWithoutSave();

Expand Down
8 changes: 4 additions & 4 deletions src/classes/Milestone1_Import_Exception.cls
Expand Up @@ -28,9 +28,9 @@ OF THE POSSIBILITY OF SUCH DAMAGE.
*/
public with sharing class Milestone1_Import_Exception extends Exception {

public static final String ERROR_NO_FILE_SELECTED = 'No import XML files selected. Please select an XML file to import.';
public static final String ERROR_EMPTY_XML = 'The Project cannot be null. This is a critical error during import of XML. Please try exporting and re-importing.';
public static final String ERROR_INVALID_XML = 'Import Failed -- Milestone was unable to import your file.';
public static final String ERROR_FILESIZE_TOO_LARGE = 'The XML file is too large.';
public static final String ERROR_NO_FILE_SELECTED = system.label.NoImportXMLFilesSelected;
public static final String ERROR_EMPTY_XML = system.label.TheProjectCannotBeNull;
public static final String ERROR_INVALID_XML = system.label.ImportFailed;
public static final String ERROR_FILESIZE_TOO_LARGE = system.label.TheXMLFileIsTooLarge;

}
2 changes: 1 addition & 1 deletion src/classes/Milestone1_Import_Project_Controller.cls
Expand Up @@ -38,7 +38,7 @@ public with sharing class Milestone1_Import_Project_Controller {
public Integer maxFileSize {get; set;}
public static Integer MAX_FILE_SIZE = 500000;

private static String CONTENT_ERROR = 'Content is not allowed in prolog.';
private static String CONTENT_ERROR = system.label.ContentIsNotAllowedInProlog;

public Milestone1_Import_Project_Controller(ApexPages.StandardSetController ssc)
{
Expand Down
8 changes: 4 additions & 4 deletions src/classes/Milestone1_Milestone_Trigger_Utility.cls
Expand Up @@ -28,8 +28,8 @@ OF THE POSSIBILITY OF SUCH DAMAGE.
*/
public with sharing class Milestone1_Milestone_Trigger_Utility {

public static final String INSUFFICIENT_PRIVILEGES_TO_ACCESS_PARENT_MILESTONE = 'Insufficient privileges to access parent milestone.';
public static final String INSUFFICIENT_PRIVILEGES_TO_ACCESS_PROJECT = 'Insufficient privileges to access project.';
public static final String INSUFFICIENT_PRIVILEGES_TO_ACCESS_PARENT_MILESTONE = system.label.InsufficientPrivilegesToAccessParentMilestone;
public static final String INSUFFICIENT_PRIVILEGES_TO_ACCESS_PROJECT = system.label.InsufficientPrivileges;

public static Boolean alreadyMadeParent = false;

Expand Down Expand Up @@ -66,7 +66,7 @@ public with sharing class Milestone1_Milestone_Trigger_Utility {
if(oldRec.Project__c != newRec.Project__c && newRec.Okay_to_Reparent__c == false){
//don't want to reparent if not OK to reparent.
allPassed = false;
newRec.Project__c.addError('Milestones should not be moved to different Projects, except through the "Move to New Project" button in Milestone list view.');
newRec.Project__c.addError(system.label.MilestonesShouldNotBeMoved);
}
}

Expand Down Expand Up @@ -197,7 +197,7 @@ public with sharing class Milestone1_Milestone_Trigger_Utility {
if(rec.Parent_Milestone__c != null){
// Parent milestone not accessible
if(parentMilestonesMap.get(rec.Parent_Milestone__c).Parent_Milestone__c != null){
rec.Parent_Milestone__c.addError('Sub-milestones can only go one level deep. Please select a top-level milestone as this record\'s parent milestone.');
rec.Parent_Milestone__c.addError(system.label.SubMilestonesCanOnlyGoOneLevelDeep);
} else {
rec.Project__c = parentMilestonesMap.get(rec.Parent_Milestone__c).Project__c;
}
Expand Down
10 changes: 5 additions & 5 deletions src/classes/Milestone1_Move_Exception.cls
Expand Up @@ -28,11 +28,11 @@ OF THE POSSIBILITY OF SUCH DAMAGE.
*/
public with sharing class Milestone1_Move_Exception extends Exception{

public static final String ERROR_MILESTONE_ALREADY_ASSIGNED_PROJECT = 'A milestone you are attempting to move is already assigned to this project. Please review your selection and try again.';
public static final String ERROR_TASK_ALREADY_ASSIGNED_MILESTONE = 'A task you are attempting to move is already assigned to this milestone. Please review your selection and try again.';
public static final String ERROR_MILESTONE_COMPLETE = 'Milestone is Complete, the Task can not be moved';
public static final String ERROR_MILESTONE_HAS_SUCCESSORS = 'Top Level Milestone has successors and cannot be moved. Redirect those successors and try again.';
public static final String ERROR_MILESTONE_HAS_PREDECESSOR = 'Top Level Milestone has predecessor and cannot be moved. Remove that predecessor and try again.';
public static final String ERROR_MILESTONE_ALREADY_ASSIGNED_PROJECT = system.label.MilestoneYouAreAttempting;
public static final String ERROR_TASK_ALREADY_ASSIGNED_MILESTONE = system.label.TaskYouAreAttempting;
public static final String ERROR_MILESTONE_COMPLETE = system.label.MilestoneIsComplete;
public static final String ERROR_MILESTONE_HAS_SUCCESSORS = system.label.TopLevelMilestoneHasSuccessors;
public static final String ERROR_MILESTONE_HAS_PREDECESSOR = system.label.TopLevelMilestoneHasPredecessor;

static testMethod void testConstants()
{
Expand Down
6 changes: 3 additions & 3 deletions src/classes/Milestone1_One_Line_Controller.cls
Expand Up @@ -62,17 +62,17 @@ public with sharing class Milestone1_One_Line_Controller {
line = '';
}catch(Exception e)
{
ApexPages.Message errorMsg = new ApexPages.Message(ApexPages.Severity.FATAL, 'There was a Salesforce DML Error: ' + e.getMessage());
ApexPages.Message errorMsg = new ApexPages.Message(ApexPages.Severity.FATAL, system.label.SalesforceDMLError + e.getMessage());
ApexPages.addMessage(errorMsg);
}
}else
{
ApexPages.Message errorMsg = new ApexPages.Message(ApexPages.Severity.FATAL, 'The alias( ' + milestoneAlias + ') did not match any milestone.');
ApexPages.Message errorMsg = new ApexPages.Message(ApexPages.Severity.FATAL, system.label.Thealias + milestoneAlias + system.label.DidNotMatch);
ApexPages.addMessage(errorMsg);
}
}else
{
ApexPages.Message errorMsg = new ApexPages.Message(ApexPages.Severity.FATAL, 'The line command was incorrect. Please use format <Alias> --- <DESCRIPTION>');
ApexPages.Message errorMsg = new ApexPages.Message(ApexPages.Severity.FATAL, system.label.PleaseUseFormat);
ApexPages.addMessage(errorMsg);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/classes/Milestone1_One_Liner_Controller_Tst.cls
Expand Up @@ -79,7 +79,7 @@ private class Milestone1_One_Liner_Controller_Tst {
System.assert(controller.task == null);
List<ApexPages.Message> messages = ApexPages.getMessages();
system.assertEquals(messages.size(),1);
system.assertEquals(messages.get(0).getDetail(),'The alias( XY()BC#1?) did not match any milestone.');
system.assertEquals(messages.get(0).getDetail(),system.label.Thealias + 'XY()BC#1?' + system.label.DidNotMatch);
}

static testMethod void testInvalidLineFound()
Expand All @@ -91,7 +91,7 @@ private class Milestone1_One_Liner_Controller_Tst {
System.assert(controller.task == null);
List<ApexPages.Message> messages = ApexPages.getMessages();
system.assertEquals(messages.size(),1);
system.assertEquals(messages.get(0).getDetail(),'The line command was incorrect. Please use format <Alias> --- <DESCRIPTION>');
system.assertEquals(messages.get(0).getDetail(),system.label.PleaseUseFormat);
}

}
2 changes: 1 addition & 1 deletion src/classes/Milestone1_Task_Trigger_Utility.cls
Expand Up @@ -28,7 +28,7 @@ OF THE POSSIBILITY OF SUCH DAMAGE.
*/
public class Milestone1_Task_Trigger_Utility {

public static final string SUBSCRIPTION_LIMIT_EXCEEDED = 'Maximum per user chatter subscription limit has been exceeded';
public static final string SUBSCRIPTION_LIMIT_EXCEEDED = system.label.MaximumPer;

public static void handleTaskAfterTrigger(List<Milestone1_Task__c> recs, List<Milestone1_Task__c> oldRecs) {
Milestone1_Task__c oldRec;
Expand Down
6 changes: 3 additions & 3 deletions src/classes/Milestone1_XML_Import_Utility.cls
Expand Up @@ -85,7 +85,7 @@ public with sharing class Milestone1_XML_Import_Utility {
//System.debug('Number of Tasks: ' + this.tasks.size());
if(project == null || project.Name == null || project.ImportID__c == null || project.ImportID__c.length() < 15)
{
throw new Milestone1_Import_Exception('The Project cannot be null. This is a critical error during import of XML. Please try exporting and re-importing.');
throw new Milestone1_Import_Exception(system.label.ProjectCannotBeNull);
}

//attempt to validate 10 variations of the name
Expand Down Expand Up @@ -174,7 +174,7 @@ public with sharing class Milestone1_XML_Import_Utility {
reader.next();
project.Name = getDecodedString(reader);
if (project.Name.length() == 0) {
throw new Milestone1_Import_Exception('Invalid name (length cannot be zero)');
throw new Milestone1_Import_Exception(system.label.InvalidName);
}
}
if (reader.getEventType() == XMLTag.START_ELEMENT && reader.getLocalName() == 'Description__c') {
Expand Down Expand Up @@ -399,7 +399,7 @@ public with sharing class Milestone1_XML_Import_Utility {
if(metadata.ExportVersion != Milestone1_Constants.XML_EXPORT_VERSION_VAL)
{
//system.debug('Throw the Exception');
throw new Milestone1_Import_Exception('Invalid Version. This project was exported from a different version(' + metadata.ExportVersion + ') than this organizations version(' + Milestone1_Constants.XML_EXPORT_VERSION_VAL + '). Projects must be exported and imported in same version. ');
throw new Milestone1_Import_Exception(system.label.InvalidVersion + metadata.ExportVersion + system.label.OrganizationsVersion + Milestone1_Constants.XML_EXPORT_VERSION_VAL + system.label.ProjectsMustBeExported);
}
}
if (reader.getEventType() == XMLTag.START_ELEMENT && reader.getLocalName() == Milestone1_Constants.XML_EXPORT_PACKAGE) {
Expand Down
8 changes: 4 additions & 4 deletions src/classes/Milestone1_repeatCon.cls
Expand Up @@ -30,10 +30,10 @@ public with sharing class Milestone1_repeatCon {

public List<SelectOption> filterList {get;set;}
public String filterItem {get;set;}
private final String ALL_ITEMS = 'All Items';
private final String MY_TASKS = 'My Tasks Only';
private final String MY_MILESTONES_ONLY = 'My Milestones Only';
private final String MY_PROJECTS_AND_ITEMS = 'My Projects And Sub-Project Items';
private final String ALL_ITEMS = system.label.AllItems;
private final String MY_TASKS = system.label.MyTasksOnly;
private final String MY_MILESTONES_ONLY = system.label.MyMilestonesOnly;
private final String MY_PROJECTS_AND_ITEMS = system.label.MyProjectsAndSubProjectItems;
private Date currentDay;
public void next() {
addMonth(1);
Expand Down
48 changes: 24 additions & 24 deletions src/components/MIlestone1_Calendar_Full.component
@@ -1,23 +1,23 @@
<apex:Component controller="Milestone1_repeatCon" id="thePage">
<apex:form id="theForm">
<table cellspacing="0" cellpadding="6" border="0">
<tr>
<td colspan="3">
<h1>Calendar Legend</h1>
</td>
<td>Filter Calendar By: </td>
<td><apex:selectList size="1" value="{!filterItem}">
<apex:selectOptions value="{!filterList}"/>
</apex:selectList></td>
<td><apex:commandButton action="{!filter}" value="Filter" id="FilterButton" /></td>
<td><apex:commandLink action="{!fiveDayView}" value="Week"/></td>
<td><apex:commandLink action="{!monthView}" value="Full Month"/></td>
</tr>
<tr>
<td style="color:maroon">Projects </td>
<td style="color:navy">Milestones </td>
<td style="color:green">Tasks </td>
</tr>
<tr>
<td colspan="3">
<h1>{!$Label.CalendarLegend}</h1>
</td>
<td>{!$Label.FilterCalendarBy}: </td>
<td><apex:selectList size="1" value="{!filterItem}">
<apex:selectOptions value="{!filterList}"/>
</apex:selectList></td>
<td><apex:commandButton action="{!filter}" value="{!$Label.Filter}" id="FilterButton" /></td>
<td><apex:commandLink action="{!fiveDayView}" value="Week"/></td>
<td><apex:commandLink action="{!monthView}" value="{!$Label.FullMonth}"/></td>
</tr>
<tr>
<td style="color:maroon">{!$Label.ProjectsCalendar} </td>
<td style="color:navy">{!$Label.MilestonesCalendar} </td>
<td style="color:green">{!$Label.TasksCalendar} </td>
</tr>
</table>
<apex:outputPanel id="theCalendar">
<div class="bCalendar">
Expand All @@ -36,13 +36,13 @@ src="/s.gif" />
</caption>
<tbody>
<tr class="headerRow">
<th scope="col" class="calDays">Sunday</th>
<th scope="col" class="calDays">Monday</th>
<th scope="col" class="calDays">Tuesday</th>
<th scope="col" class="calDays">Wednesday</th>
<th scope="col" class="calDays">Thursday</th>
<th scope="col" class="calDays">Friday</th>
<th scope="col" class="calDays">Saturday</th>
<th scope="col" class="calDays">{!$Label.Sunday}</th>
<th scope="col" class="calDays">{!$Label.Monday}</th>
<th scope="col" class="calDays">{!$Label.Tuesday}</th>
<th scope="col" class="calDays">{!$Label.Wednesday}</th>
<th scope="col" class="calDays">{!$Label.Thursday}</th>
<th scope="col" class="calDays">{!$Label.Friday}</th>
<th scope="col" class="calDays">{!$Label.Saturday}</th>
</tr>

<apex:repeat value="{!weeks}" var="wk" id="foreachWeek">
Expand Down

0 comments on commit 5ccf990

Please sign in to comment.