From 04e1beb35cfcd67a5db7c95d099c1d61f1e69f6f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Philippe=20Lafreni=C3=A8re?=
<53181414+PhilippeLafreniere18@users.noreply.github.com>
Date: Tue, 21 Jan 2020 12:08:01 -0500
Subject: [PATCH] fix(spatialFilter): missing traduction fix / CSS title update
(#554)
---
.../filter/shared/spatial-filter.service.ts | 35 +++++++++++++------
.../spatial-filter-item.component.html | 2 +-
.../spatial-filter-item.component.scss | 4 +++
3 files changed, 30 insertions(+), 11 deletions(-)
diff --git a/packages/geo/src/lib/filter/shared/spatial-filter.service.ts b/packages/geo/src/lib/filter/shared/spatial-filter.service.ts
index 57f6e13897..4157785ba0 100644
--- a/packages/geo/src/lib/filter/shared/spatial-filter.service.ts
+++ b/packages/geo/src/lib/filter/shared/spatial-filter.service.ts
@@ -91,23 +91,38 @@ export class SpatialFilterService {
name = substr.substring(index + 1, substr.length);
substr = substr.substring(0, index);
}
- item.name = this.languageService.translate.instant(
- 'igo.geo.terrapi.' + name
- );
+ try {
+ item.name = this.languageService.translate.instant(
+ 'igo.geo.terrapi.' + name
+ );
+ } catch (e) {
+ item.name = name.substring(0,1).toUpperCase() + name.substring(1, name.length - 1);
+ }
+
+ try {
+ item.group = this.languageService.translate.instant(
+ 'igo.geo.spatialFilter.group.' + substr
+ );
+ } catch (e) {
+ item.group = substr.substring(0,1).toUpperCase() + substr.substring(1, name.length - 1);
+ }
- item.group = this.languageService.translate.instant(
- 'igo.geo.spatialFilter.group.' + substr
- );
items.push(item);
} else {
if (this.getKeyByValue(this.urlFilterList, type)) {
const item: SpatialFilterThematic = {
- name: this.languageService.translate.instant(
- 'igo.geo.terrapi.' +
- this.getKeyByValue(this.urlFilterList, type)
- ),
+ name: undefined,
source: type
};
+ const name = this.getKeyByValue(this.urlFilterList, type);
+ try {
+ item.name = this.languageService.translate.instant(
+ 'igo.geo.terrapi.' + name);
+ } catch (e) {
+ item.name = name.substring(0,1).toUpperCase() + name.substring(1, name.length - 1);
+ }
+ item.source = type
+
items.push(item);
}
}
diff --git a/packages/geo/src/lib/filter/spatial-filter/spatial-filter-item/spatial-filter-item.component.html b/packages/geo/src/lib/filter/spatial-filter/spatial-filter-item/spatial-filter-item.component.html
index c81b961f47..98c7c768b6 100644
--- a/packages/geo/src/lib/filter/spatial-filter/spatial-filter-item/spatial-filter-item.component.html
+++ b/packages/geo/src/lib/filter/spatial-filter/spatial-filter-item/spatial-filter-item.component.html
@@ -38,7 +38,7 @@
- {{'igo.geo.spatialFilter.search' | translate}} :
+ {{'igo.geo.spatialFilter.search' | translate}} :