Skip to content

Commit

Permalink
Translate the disclaimer
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Apr 23, 2018
1 parent 77bc95d commit cb802c6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion contribs/gmf/src/directives/disclaimer.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ gmf.module.component('gmfDisclaimer', gmf.disclaimerComponent);
* @param {!angular.Scope} $scope Angular scope.
* @param {!angular.$sce} $sce Angular sce service.
* @param {!angular.$timeout} $timeout Angular timeout service.
* @param {!angularGettext.Catalog} gettextCatalog Gettext catalog.
* @param {!ngeo.CreatePopup} ngeoCreatePopup Popup service.
* @param {!ngeo.Disclaimer} ngeoDisclaimer Ngeo Disclaimer service.
* @param {!ngeo.EventHelper} ngeoEventHelper Ngeo Event Helper.
Expand All @@ -88,7 +89,7 @@ gmf.module.component('gmfDisclaimer', gmf.disclaimerComponent);
* @ngname GmfDisclaimerController
*/
gmf.DisclaimerController = function($element, $scope, $sce, $timeout,
ngeoCreatePopup, ngeoDisclaimer, ngeoEventHelper, ngeoLayerHelper) {
gettextCatalog, ngeoCreatePopup, ngeoDisclaimer, ngeoEventHelper, ngeoLayerHelper) {

/**
* @type {?ol.Map}
Expand Down Expand Up @@ -140,6 +141,11 @@ gmf.DisclaimerController = function($element, $scope, $sce, $timeout,
*/
this.timeout_ = $timeout;

/**
* @private
*/
this.gettextCatalog_ = gettextCatalog;

/**
* @type {!angular.JQLite}
* @private
Expand Down Expand Up @@ -299,6 +305,7 @@ gmf.DisclaimerController.prototype.$onDestroy = function() {
* @private
*/
gmf.DisclaimerController.prototype.showDisclaimerMessage_ = function(msg) {
msg = this.gettextCatalog_.getString(msg);
if (this.external) {
if (this.msgs_.indexOf(msg) < 0) {
this.msgs_.push(msg);
Expand All @@ -321,6 +328,7 @@ gmf.DisclaimerController.prototype.showDisclaimerMessage_ = function(msg) {
* @private
*/
gmf.DisclaimerController.prototype.closeDisclaimerMessage_ = function(msg) {
msg = this.gettextCatalog_.getString(msg);
if (this.external) {
this.visibility = false;
this.msgs_.length = 0;
Expand Down

0 comments on commit cb802c6

Please sign in to comment.