Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translate the disclaimer #3793

Merged
merged 1 commit into from
Apr 24, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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