From: Tim Otten Date: Wed, 21 Jan 2015 06:59:16 +0000 (-0800) Subject: CRM-15832 - Fix domain used by core Angular apps X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=5d8901af0e2eb692e1381a474b8b2c4238c62bb9;p=civicrm-core.git CRM-15832 - Fix domain used by core Angular apps The old code was based on a misunderstanding. I thought that we had separate translation domains for each Civi component. This is half true -- when the translators work on them, there are separate .po files for each component. However, when we distribute the final .mo files, the components are aggregated together into one "civicrm.mo". Thus, at runtime, there is really only one domain for the core app. There are other domains the extensions, and there are a couple contexts within the civicrm domain (eg for states/provinces), but that's irrelevant to core's CiviCase and CiviMail UIs. --- diff --git a/js/angular-crmCaseType.js b/js/angular-crmCaseType.js index 256b1ae676..ba71d5c986 100644 --- a/js/angular-crmCaseType.js +++ b/js/angular-crmCaseType.js @@ -128,7 +128,7 @@ crmCaseType.controller('CaseTypeCtrl', function($scope, crmApi, apiCalls) { $scope.partialUrl = partialUrl; - var ts = $scope.ts = CRM.ts('CiviCase'); + var ts = $scope.ts = CRM.ts(null); $scope.activityStatuses = _.values(apiCalls.actStatuses.values); $scope.activityTypes = apiCalls.actTypes.values; diff --git a/js/angular-crmMailing.js b/js/angular-crmMailing.js index 27e6f0eb60..ff417eb1ed 100644 --- a/js/angular-crmMailing.js +++ b/js/angular-crmMailing.js @@ -73,7 +73,7 @@ $scope.crmMailingConst = CRM.crmMailing; $scope.partialUrl = partialUrl; - var ts = $scope.ts = CRM.ts('CiviMail'); + var ts = $scope.ts = CRM.ts(null); $scope.isSubmitted = function isSubmitted() { return _.size($scope.mailing.jobs) > 0; @@ -181,7 +181,7 @@ // - [input] mailing: object // - [output] recipients: array of recipient records angular.module('crmMailing').controller('EditRecipCtrl', function EditRecipCtrl($scope, dialogService, crmApi, crmMailingMgr) { - var ts = $scope.ts = CRM.ts('CiviMail'); + var ts = $scope.ts = CRM.ts(null); $scope.recipients = null; $scope.getRecipientsEstimate = function () { var ts = $scope.ts; @@ -276,7 +276,7 @@ // Note: Expects $scope.model to be an object with properties: // - recipients: array of contacts angular.module('crmMailing').controller('PreviewRecipCtrl', function ($scope) { - $scope.ts = CRM.ts('CiviMail'); + $scope.ts = CRM.ts(null); }); // Controller for the "Preview Mailing" dialog @@ -285,13 +285,13 @@ // - "body_html" // - "body_text" angular.module('crmMailing').controller('PreviewMailingDialogCtrl', function PreviewMailingDialogCtrl($scope) { - $scope.ts = CRM.ts('CiviMail'); + $scope.ts = CRM.ts(null); }); // Controller for the "Preview Mailing Component" segment // which displays header/footer/auto-responder angular.module('crmMailing').controller('PreviewComponentCtrl', function PreviewMailingDialogCtrl($scope, dialogService) { - var ts = $scope.ts = CRM.ts('CiviMail'); + var ts = $scope.ts = CRM.ts(null); $scope.previewComponent = function previewComponent(title, componentId) { var component = _.where(CRM.crmMailing.headerfooterList, {id: "" + componentId}); @@ -317,12 +317,12 @@ // - "body_html" // - "body_text" angular.module('crmMailing').controller('PreviewComponentDialogCtrl', function PreviewMailingDialogCtrl($scope) { - $scope.ts = CRM.ts('CiviMail'); + $scope.ts = CRM.ts(null); }); // Controller for the in-place msg-template management angular.module('crmMailing').controller('MsgTemplateCtrl', function MsgTemplateCtrl($scope, crmMsgTemplates, dialogService) { - var ts = $scope.ts = CRM.ts('CiviMail'); + var ts = $scope.ts = CRM.ts(null); $scope.crmMsgTemplates = crmMsgTemplates; // @return Promise MessageTemplate (per APIv3) @@ -368,7 +368,7 @@ // - "msg_text": string // - "msg_html": string angular.module('crmMailing').controller('SaveMsgTemplateDialogCtrl', function SaveMsgTemplateDialogCtrl($scope, crmMsgTemplates, dialogService) { - var ts = $scope.ts = CRM.ts('CiviMail'); + var ts = $scope.ts = CRM.ts(null); $scope.saveOpt = {mode: '', newTitle: ''}; $scope.selected = null; diff --git a/js/angular-crmMailing/directives.js b/js/angular-crmMailing/directives.js index 578da7caf6..85ba61c85a 100644 --- a/js/angular-crmMailing/directives.js +++ b/js/angular-crmMailing/directives.js @@ -28,7 +28,7 @@ var model = $parse(attr.crmMailing); scope.mailing = model(scope.$parent); scope.crmMailingConst = CRM.crmMailing; - scope.ts = CRM.ts('CiviMail'); + scope.ts = CRM.ts(null); scope[directiveName] = attr[directiveName] ? scope.$parent.$eval(attr[directiveName]) : {}; } }; @@ -44,7 +44,7 @@ var mailingModel = $parse(attr.crmMailing); scope.mailing = mailingModel(scope); scope.crmMailingConst = CRM.crmMailing; - scope.ts = CRM.ts('CiviMail'); + scope.ts = CRM.ts(null); scope.testContact = {email: CRM.crmMailing.defaultTestEmail}; scope.testGroup = {gid: null}; @@ -72,7 +72,7 @@ var mailingModel = $parse(attr.crmMailing); scope.mailing = mailingModel(scope.$parent); scope.crmMailingConst = CRM.crmMailing; - scope.ts = CRM.ts('CiviMail'); + scope.ts = CRM.ts(null); scope.previewMailing = function previewMailing(mailing, mode) { return crmMailingPreviewMgr.preview(mailing, mode); }; @@ -243,7 +243,7 @@ scope.groups = scope.$parent.$eval(attrs.crmAvailGroups); scope.mailings = scope.$parent.$eval(attrs.crmAvailMailings); - scope.ts = CRM.ts('CiviMail'); + scope.ts = CRM.ts(null); /// Convert MySQL date ("yyyy-mm-dd hh:mm:ss") to JS date object scope.parseDate = function (date) { diff --git a/js/angular-crmMailingAB.js b/js/angular-crmMailingAB.js index cb19d023bd..ddc532a319 100644 --- a/js/angular-crmMailingAB.js +++ b/js/angular-crmMailingAB.js @@ -44,7 +44,7 @@ ]); angular.module('crmMailingAB').controller('CrmMailingABListCtrl', function ($scope, mailingABList, crmMailingABCriteria, crmMailingABStatus) { - var ts = $scope.ts = CRM.ts('CiviMail'); + var ts = $scope.ts = CRM.ts(null); $scope.mailingABList = mailingABList.values; $scope.crmMailingABCriteria = crmMailingABCriteria; $scope.crmMailingABStatus = crmMailingABStatus; @@ -52,7 +52,7 @@ angular.module('crmMailingAB').controller('CrmMailingABEditCtrl', function ($scope, abtest, crmMailingABCriteria, crmMailingMgr, crmMailingPreviewMgr, crmStatus, $q, $location) { $scope.abtest = abtest; - var ts = $scope.ts = CRM.ts('CiviMail'); + var ts = $scope.ts = CRM.ts(null); $scope.crmMailingABCriteria = crmMailingABCriteria; $scope.crmMailingConst = CRM.crmMailing; $scope.partialUrl = partialUrl; @@ -175,7 +175,7 @@ }); angular.module('crmMailingAB').controller('CrmMailingABReportCtrl', function ($scope, abtest, crmApi, crmMailingPreviewMgr, dialogService) { - var ts = $scope.ts = CRM.ts('CiviMail'); + var ts = $scope.ts = CRM.ts(null); $scope.abtest = abtest; @@ -211,7 +211,7 @@ angular.module('crmMailingAB').controller('CrmMailingABWinnerDialogCtrl', function ($scope, $timeout, dialogService, crmMailingMgr, crmStatus) { - var ts = $scope.ts = CRM.ts('CiviMail'); + var ts = $scope.ts = CRM.ts(null); var abtest = $scope.abtest = $scope.model.abtest; var mailingName = $scope.model.mailingName; diff --git a/js/angular-crmMailingAB/directives.js b/js/angular-crmMailingAB/directives.js index 49e5def2af..ebd388aa6d 100644 --- a/js/angular-crmMailingAB/directives.js +++ b/js/angular-crmMailingAB/directives.js @@ -23,7 +23,7 @@ scope.abtest = model(scope.$parent); scope.crmMailingConst = CRM.crmMailing; scope.crmMailingABCriteria = crmMailingABCriteria; - scope.ts = CRM.ts('CiviMail'); + scope.ts = CRM.ts(null); var fieldsModel = $parse(attr[directiveName]); scope.fields = fieldsModel(scope.$parent); @@ -44,7 +44,7 @@ var sliderTests = $('.slider-test', element); var sliderWin = $('.slider-win', element); - scope.ts = CRM.ts('CiviMail'); + scope.ts = CRM.ts(null); scope.testValue = 0; scope.winValue = 100;