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 c0197dc
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 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,12 @@ gmf.DisclaimerController = function($element, $scope, $sce, $timeout,
*/
this.timeout_ = $timeout;

/**
* @type {!angularGettext.Catalog}
* @private
*/
this.gettextCatalog_ = gettextCatalog;

/**
* @type {!angular.JQLite}
* @private
Expand Down Expand Up @@ -299,6 +306,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 +329,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 c0197dc

Please sign in to comment.