From c0197dcb67295ef769e62c817464023f679af8d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Mon, 23 Apr 2018 13:27:54 +0200 Subject: [PATCH] Translate the disclaimer --- contribs/gmf/src/directives/disclaimer.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/contribs/gmf/src/directives/disclaimer.js b/contribs/gmf/src/directives/disclaimer.js index 06e02a007fd2..feaf50edef84 100644 --- a/contribs/gmf/src/directives/disclaimer.js +++ b/contribs/gmf/src/directives/disclaimer.js @@ -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. @@ -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} @@ -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 @@ -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); @@ -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;