CRM-16141 - Fix untranslated strings in CaseType UI
authorColeman Watts <coleman@civicrm.org>
Thu, 26 Mar 2015 01:49:15 +0000 (21:49 -0400)
committerColeman Watts <coleman@civicrm.org>
Thu, 26 Mar 2015 01:54:27 +0000 (21:54 -0400)
js/angular-crmCaseType.js
partials/crmCaseType/activitySetDetails.html
partials/crmCaseType/activityTypesTable.html
partials/crmCaseType/caseTypeDetails.html
partials/crmCaseType/edit.html
partials/crmCaseType/list.html
partials/crmCaseType/rolesTable.html
partials/crmCaseType/sequenceTable.html
partials/crmCaseType/timelineTable.html

index cb5e5797a57d99f50ab29e697c22ec6d17b7e52c..d7b9b2086a3a0af538c66f4840fe3faa75ea0d32 100644 (file)
   });
 
   crmCaseType.controller('CaseTypeListCtrl', function($scope, crmApi, caseTypes) {
+    var ts = $scope.ts = CRM.ts(null);
+
     $scope.caseTypes = caseTypes.values;
     $scope.toggleCaseType = function (caseType) {
       caseType.is_active = (caseType.is_active == '1') ? '0' : '1';
     $scope.deleteCaseType = function (caseType) {
       crmApi('CaseType', 'delete', {id: caseType.id}, {
         error: function (data) {
-          CRM.alert(data.error_message, ts('Error'));
+          CRM.alert(data.error_message, ts('Error'), 'error');
         }
       })
         .then(function (data) {
index 4b4be9bd3a6b42379ea3ff741c1a1a251455fcb9..44a6c061b9c42bbfa240aad06b30349c255bca22 100644 (file)
@@ -5,13 +5,13 @@ Required vars: activitySet
 <table class="form-layout-compressed">
   <tbody>
   <tr>
-    <td class="label">Label</td>
+    <td class="label">{{ts('Label')}}</td>
     <td>
       <input type="text" name="label" ng-model="activitySet.label"/>
     </td>
   </tr>
   <tr>
-    <td class="label">Name</td>
+    <td class="label">{{ts('Name')}}</td>
     <td>
       <input type="text" name="name" ng-model="activitySet.name" ng-disabled="locks.activitySetName" />
       <a crm-ui-lock binding="locks.activitySetName"></a>
@@ -19,7 +19,7 @@ Required vars: activitySet
     </td>
   </tr>
   <tr>
-    <td class="label">Workflow</td>
+    <td class="label">{{ts('Workflow')}}</td>
     <td>
       {{ getWorkflowName(activitySet) }}
     </td>
index 724ef6e2a6b79451391d43c7a45ab7eefad7aad4..a721292472bc68b67b82588044fa2a5ef2a13cce 100644 (file)
@@ -5,8 +5,8 @@ Required vars: caseType
 <table>
   <thead>
   <tr>
-    <th>Activity Type</th>
-    <th>Max Instances</th>
+    <th>{{ts('Activity Type')}}</th>
+    <th>{{ts('Max Instances')}}</th>
     <th></th>
   </tr>
   </thead>
@@ -21,7 +21,7 @@ Required vars: caseType
       <input class="number" type="text" ng-pattern="/^[0-9]*$/" ng-model="activityType.max_instances" />
     </td>
     <td>
-      <a crm-icon="trash" class="crm-hover-button" ng-click="removeItem(caseType.definition.activityTypes, activityType)" title="Remove"></a>
+      <a crm-icon="trash" class="crm-hover-button" ng-click="removeItem(caseType.definition.activityTypes, activityType)" title="{{ts('Remove')}}"></a>
     </td>
   </tr>
   </tbody>
@@ -29,7 +29,7 @@ Required vars: caseType
   <tfoot>
   <tr class="addRow">
     <td colspan="3">
-      Add activity type:
+      {{ts('Add activity type:')}}
       <span crm-add-name
            crm-options="activityTypeNames"
            crm-var="newActivity"
index 1d8558ec1b5c5fb0a39c91d04904eb94acb3de54..fb644f1a946878824d8d62c6bdc45623cc88bc6a 100644 (file)
@@ -29,10 +29,10 @@ The original form used table layout; don't know if we have an alternative, CSS-b
       <a crm-ui-lock binding="locks.caseTypeName"></a>
 
       <div ng-show="!isValidName(caseType.name)">
-        <em>WARNING: The case type name includes deprecated characters.</em>
+        <em>{{ts('WARNING: The case type name includes deprecated characters.')}}</em>
       </div>
       <div ng-show="caseType.id && !locks.caseTypeName">
-        <em>WARNING: If any external files or programs reference the old "Name", then they must be updated manually.</em>
+        <em>{{ts('WARNING: If any external files or programs reference the old "Name", then they must be updated manually.')}}</em>
       </div>
     </div>
     <div crm-ui-field="{name: 'caseTypeDetailForm.description', title: ts('Description')}">
index 93ec51e837636c0d69868084d2a11761a981ce1c..300007c2d3e0678db98e08567bccecbe3a7c7704 100644 (file)
@@ -5,43 +5,43 @@ Required vars: caseType
 <form name="editCaseTypeForm" unsaved-warning-form>
 <div class="crm-block crm-form-block crmCaseType">
   <div class="help">
-    Use this screen to define or update the Case Roles, Activity Types, and Timelines for a case type (<a href="http://book.civicrm.org/user/current/case-management/setup/" target="_blank">learn more...</a>).
+    {{ts('Use this screen to define or update the Case Roles, Activity Types, and Timelines for a case type.')}} <a href="http://book.civicrm.org/user/current/case-management/setup/" target="_blank">{{ts('Learn more...')}}</a>).
   </div>
   <div class="crm-submit-buttons">
-    <span class="crm-button">
-      <input type="submit" ng-click="editCaseTypeForm.$setPristine(); save()" ng-disabled="editCaseTypeForm.$invalid" value="Save" />
-    </span>
-    <span class="crm-button">
-      <input type="submit" ng-click="editCaseTypeForm.$setPristine(); goto('caseType')" value="Cancel" />
-    </span>
+    <button crm-icon="check" ng-click="editCaseTypeForm.$setPristine(); save()" ng-disabled="editCaseTypeForm.$invalid">
+      {{ts('Save')}}
+    </button>
+    <button crm-icon="close" ng-click="editCaseTypeForm.$setPristine(); goto('caseType')">
+      {{ts('Cancel')}}
+    </button>
   </div>
 
   <div ng-include="'~/crmCaseType/caseTypeDetails.html'"></div>
 
-  <h2 ng-show="isForkable()">Roles</h2>
+  <h2 ng-show="isForkable()">{{ts('Roles')}}</h2>
 
   <div ng-show="isForkable()" ng-include="'~/crmCaseType/rolesTable.html'"></div>
 
-  <h2 ng-show="isForkable()">Activities</h2>
+  <h2 ng-show="isForkable()">{{ts('Activities')}}</h2>
 
   <div ng-show="isForkable()" class="crmCaseType-acttab" ui-jq="tabs" ui-options="{show: true, hide: true}">
     <ul>
-      <li><a href="#acttab-actType">Activity Types</a></li>
+      <li><a href="#acttab-actType">{{ts('Activity Types')}}</a></li>
       <li ng-repeat="activitySet in caseType.definition.activitySets">
         <a href="#acttab-{{$index}}">{{ activitySet.label }}</a>
-        <span class="ui-icon ui-icon-trash" title="Remove"
+        <span class="ui-icon ui-icon-trash" title="{{ts('Remove')}}"
           ng-hide="activitySet.name == 'standard_timeline'"
-          ng-click="removeItem(caseType.definition.activitySets, activitySet)">Remove</span>
+          ng-click="removeItem(caseType.definition.activitySets, activitySet)">{{ts('Remove')}}</span>
         <!-- Weird spacing:
         <a class="crm-hover-button" ng-click="removeItem(caseType.definition.activitySets, activitySet)">
           <span class="ui-icon delete-icon" title="Remove">Remove</span>
         </a>
         -->
       </li>
-      <select ng-model="newActivitySetWorkflow" ng-change="addActivitySet(newActivitySetWorkflow); newActivitySetWorkflow='';">
-        <option value="">(Add)</option>
-        <option value="timeline" ng-show="isNewActivitySetAllowed('timeline')">Timeline</option>
-        <option value="sequence" ng-show="isNewActivitySetAllowed('sequence')">Sequence</option>
+      <select class="crm-form-select" ng-model="newActivitySetWorkflow" ng-change="addActivitySet(newActivitySetWorkflow); newActivitySetWorkflow='';">
+        <option value="">{{ts('Add...')}}</option>
+        <option value="timeline" ng-show="isNewActivitySetAllowed('timeline')">{{ts('Timeline')}}</option>
+        <option value="sequence" ng-show="isNewActivitySetAllowed('sequence')">{{ts('Sequence')}}</option>
       </select>
     </ul>
 
@@ -53,20 +53,19 @@ Required vars: caseType
       <div ng-include="activityTableTemplate(activitySet)"></div>
 
       <div class="crm-accordion-wrapper collapsed">
-        <div class="crm-accordion-header">Advanced</div>
+        <div class="crm-accordion-header">{{ts('Advanced')}}</div>
         <div class="crm-accordion-body" ng-include="'~/crmCaseType/activitySetDetails.html'"></div>
       </div>
     </div>
   </div>
 
-  <!--<button ng-click="dump()">Log</button>-->
   <div class="crm-submit-buttons">
-    <span class="crm-button">
-      <input type="submit" ng-click="editCaseTypeForm.$setPristine(); save()" ng-disabled="editCaseTypeForm.$invalid" value="Save" />
-    </span>
-    <span class="crm-button">
-      <input type="submit" ng-click="editCaseTypeForm.$setPristine(); goto('caseType')" value="Cancel" />
-    </span>
+    <button crm-icon="check" ng-click="editCaseTypeForm.$setPristine(); save()" ng-disabled="editCaseTypeForm.$invalid">
+      {{ts('Save')}}
+    </button>
+    <button crm-icon="close" ng-click="editCaseTypeForm.$setPristine(); goto('caseType')">
+      {{ts('Cancel')}}
+    </button>
   </div>
 </div>
 </form>
index a4d08bd17b9e0e0ae5c025430da7ba33cb6e23ca..73ce281eb8baf1b55b0f540b1771199cc5f6afa3 100644 (file)
@@ -3,16 +3,16 @@ Controller: CaseTypeListsCtrl
 Required vars: caseTypes
 -->
 <div class="help">
-  A Case Type describes a group of related tasks, interactions, or processes.
+  {{ts('A Case Type describes a group of related tasks, interactions, or processes.')}}
 </div>
 
 <table class="display">
   <thead>
   <tr>
-    <th>Title</th>
-    <th>Name</th>
-    <th>Description</th>
-    <th>Enabled?</th>
+    <th>{{ts('Title')}}</th>
+    <th>{{ts('Name')}}</th>
+    <th>{{ts('Description')}}</th>
+    <th>{{ts('Enabled?')}}</th>
     <th></th>
   </tr>
   </thead>
@@ -25,39 +25,39 @@ Required vars: caseTypes
     <td>{{caseType.title}}</td>
     <td>{{caseType.name}}</td>
     <td>{{caseType.description}}</td>
-    <td>{{caseType.is_active == 1 ? 'Yes' : 'No'}}</td>
+    <td>{{caseType.is_active == 1 ? ts('Yes') : ts('No')}}</td>
     <!-- FIXME: Can't figure out how styling in other tables gets the nowrap effect... in absence of a consistent fix, KISS -->
     <td style="white-space: nowrap">
       <span>
-        <a class="action-item crm-hover-button" ng-href="#/caseType/{{caseType.id}}">Edit</a>
+        <a class="action-item crm-hover-button" ng-href="#/caseType/{{caseType.id}}">{{ts('Edit')}}</a>
 
         <span class="btn-slide crm-hover-button">
-          more
+          {{ts('more')}}
           <ul class="panel" style="display: none;">
             <li ng-hide="caseType.is_active">
               <a class="action-item crm-hover-button" ng-click="toggleCaseType(caseType)">
-                Enable
+                {{ts('Enable')}}
               </a>
             </li>
             <li ng-show="caseType.is_active">
               <a class="action-item crm-hover-button"
                  crm-confirm="{type: 'disable', obj: caseType}"
                  on-yes="toggleCaseType(caseType)">
-                Disable
+                {{ts('Disable')}}
               </a>
             </li>
             <li ng-show="caseType.is_forked">
               <a class="action-item crm-hover-button"
                  crm-confirm="{type: 'revert', obj: caseType}"
                  on-yes="revertCaseType(caseType)">
-                Revert
+                {{ts('Revert')}}
               </a>
             </li>
             <li>
               <a class="action-item crm-hover-button"
                  crm-confirm="{type: 'delete', obj: caseType}"
                  on-yes="deleteCaseType(caseType)">
-                Delete
+                {{ts('Delete')}}
               </a>
             </li>
           </ul>
@@ -69,5 +69,5 @@ Required vars: caseTypes
 </table>
 
 <div class="crm-submit-buttons">
-  <a ng-href="#/caseType/new" class="button"><span><div class="icon ui-icon-circle-plus"></div>New Case Type</span></a>
+  <a ng-href="#/caseType/new" class="button"><span><div class="icon ui-icon-circle-plus"></div>{{ts('New Case Type')}}</span></a>
 </div>
\ No newline at end of file
index 57bd47f2bb6ae31894b9e772c9d0de1a8d491282..93a7a963ef0dc892055c4e11849d8f2efa5e19c0 100644 (file)
@@ -5,9 +5,9 @@ Required vars: caseType
 <table>
   <thead>
          <tr>
-           <th>Name</th>
-           <th>Assign to Creator</th>
-           <th>Is Manager</th>
+           <th>{{ts('Name')}}</th>
+           <th>{{ts('Assign to Creator')}}</th>
+           <th>{{ts('Is Manager')}}</th>
            <th></th>
          </tr>
   </thead>
@@ -17,7 +17,7 @@ Required vars: caseType
            <td><input type="checkbox" ng-model="relType.creator" ng-true-value="1" ng-false-value="0"/></td>
            <td><input type="radio" ng-model="relType.manager" value="1" ng-change="onManagerChange(relType)"/></td>
            <td>
-             <a crm-icon="trash" class="crm-hover-button" ng-click="removeItem(caseType.definition.caseRoles,relType)" title="Remove"></a>
+             <a crm-icon="trash" class="crm-hover-button" ng-click="removeItem(caseType.definition.caseRoles,relType)" title="{{ts('Remove')}}"></a>
            </td>
          </tr>
   </tbody>
@@ -25,7 +25,7 @@ Required vars: caseType
   <tfoot>
          <tr class="addRow">
            <td colspan="4">
-             Add role:
+             {{ts('Add role:')}}
              <span crm-add-name
                   crm-options="relationshipTypeNames"
                   crm-var="newRole"
index c76788314873b074c3feaabfc79afa9cc22cd87b..a472078f4103cbfc5a93b7ae369d44fd4ecf7e95 100644 (file)
@@ -5,7 +5,7 @@ Required vars: activitySet
 <table>
   <thead>
   <tr>
-    <th>Activity</th>
+    <th>{{ts('Activity')}}</th>
     <th></th>
   </tr>
   </thead>
@@ -17,7 +17,7 @@ Required vars: activitySet
       {{ activity.name }}
     </td>
     <td>
-      <a crm-icon="trash" class="crm-hover-button" ng-click="removeItem(activitySet.activityTypes, activity)" title="Remove"></a>
+      <a crm-icon="trash" class="crm-hover-button" ng-click="removeItem(activitySet.activityTypes, activity)" title="{{ts('Remove')}}"></a>
     </td>
   </tr>
   </tbody>
@@ -25,7 +25,7 @@ Required vars: activitySet
   <tfoot>
   <tr class="addRow">
     <td colspan="3">
-      Add activity:
+      {{ts('Add activity:')}}
       <span crm-add-name
            crm-options="activityTypeNames"
            crm-var="newActivity"
index 9eb68c615a039d8113f4f8ec1904baacc94425ec..b05a816903ef5595751f25ac8d6456101ea6501e 100644 (file)
@@ -5,11 +5,11 @@ Required vars: activitySet
 <table>
   <thead>
   <tr>
-    <th>Activity</th>
-    <th>Status</th>
-    <th>Reference</th>
-    <th>Offset</th>
-    <th>Select</th>
+    <th>{{ts('Activity')}}</th>
+    <th>{{ts('Status')}}</th>
+    <th>{{ts('Reference')}}</th>
+    <th>{{ts('Offset')}}</th>
+    <th>{{ts('Select')}}</th>
     <th></th>
   </tr>
   </thead>
@@ -67,7 +67,7 @@ Required vars: activitySet
          crm-icon="trash"
          ng-show="isActivityRemovable(activitySet, activity)"
          ng-click="removeItem(activitySet.activityTypes, activity)"
-         title="Remove">
+         title="{{ts('Remove')}}">
       </a>
     </td>
   </tr>
@@ -76,7 +76,7 @@ Required vars: activitySet
   <tfoot>
   <tr class="addRow">
     <td colspan="6">
-      Add activity:
+      {{ts('Add activity:')}}
       <span crm-add-name
            crm-options="activityTypeNames"
            crm-var="newActivity"