From cb802c6120f01527772ca3deb8ce4021611f6dc5 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 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/contribs/gmf/src/directives/disclaimer.js b/contribs/gmf/src/directives/disclaimer.js index 06e02a007fd2..b9a940869a85 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,11 @@ gmf.DisclaimerController = function($element, $scope, $sce, $timeout, */ this.timeout_ = $timeout; + /** + * @private + */ + this.gettextCatalog_ = gettextCatalog; + /** * @type {!angular.JQLite} * @private @@ -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); @@ -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;