From 55be9d4d4e234a7ea66ea40b2aa65e3c47322c4e Mon Sep 17 00:00:00 2001 From: Rainer Killinger Date: Mon, 22 Mar 2021 13:40:49 +0100 Subject: [PATCH] refactor: use i18n in every data component --- src/app/modules/data/data.html | 18 ------------ .../modules/data/elements/address-detail.html | 14 ++++----- .../modules/data/elements/offers-detail.html | 4 +-- .../modules/data/elements/offers-in-list.html | 2 +- .../modules/data/elements/origin-detail.html | 22 +++++++------- .../modules/data/elements/simple-card.html | 2 +- src/app/modules/data/list/data-list-item.html | 6 ++-- .../article-detail-content.component.ts | 21 +------------- .../types/article/article-detail-content.html | 6 ++-- .../data/types/article/article-list-item.html | 4 +-- .../catalog-detail-content.component.ts | 21 +------------- .../types/catalog/catalog-detail-content.html | 2 +- .../data/types/catalog/catalog-list-item.html | 4 +-- .../date-series-detail-content.component.ts | 21 +------------- .../date-series-detail-content.html | 6 ++-- .../date-series/date-series-list-item.html | 4 +-- .../dish/dish-detail-content.component.ts | 10 ------- .../favorite-detail-content.component.ts | 21 +------------- .../types/favorite/favorite-list-item.html | 6 ++-- .../message-detail-content.component.ts | 21 +------------- .../types/message/message-detail-content.html | 10 +++---- .../data/types/message/message-list-item.html | 6 ++-- .../organization-detail-content.component.ts | 22 +------------- .../organization-detail-content.html | 4 +-- .../organization/organization-list-item.html | 8 ++--- .../person/person-detail-content.component.ts | 22 +------------- .../types/person/person-detail-content.html | 24 +++++++-------- .../data/types/person/person-list-item.html | 2 +- .../place/place-detail-content.component.ts | 22 +------------- .../types/place/place-detail-content.html | 6 ++-- .../data/types/place/place-list-item.html | 8 ++--- .../mensa/place-mensa-detail.component.ts | 15 ++-------- .../semester-detail-content.component.ts | 22 +------------- .../semester/semester-detail-content.html | 5 ++-- .../types/semester/semester-list-item.html | 4 +-- .../video/video-detail-content.component.ts | 22 +------------- .../types/video/video-detail-content.html | 10 +++---- .../data/types/video/video-list-item.html | 8 ++--- src/assets/i18n/de.json | 29 +++++++++++++++++-- src/assets/i18n/en.json | 29 +++++++++++++++++-- 40 files changed, 156 insertions(+), 337 deletions(-) delete mode 100644 src/app/modules/data/data.html diff --git a/src/app/modules/data/data.html b/src/app/modules/data/data.html deleted file mode 100644 index fef81512..00000000 --- a/src/app/modules/data/data.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - data - - - - - - - - diff --git a/src/app/modules/data/elements/address-detail.html b/src/app/modules/data/elements/address-detail.html index 77799282..4345ae12 100644 --- a/src/app/modules/data/elements/address-detail.html +++ b/src/app/modules/data/elements/address-detail.html @@ -1,39 +1,39 @@ - Address + {{'data.detail.address.TITLE' | translate | titlecase}} - Street: + {{'data.detail.address.STREET' | translate | titlecase}}: {{address.streetAddress}} - Postal code: + {{'data.detail.address.POSTCODE' | translate | titlecase}}: {{address.postalCode}} - City: + {{'data.detail.address.CITY' | translate | titlecase}}: {{address.addressLocality}} - Region: + {{'data.detail.address.REGION' | translate | titlecase}}: {{address.addressRegion}} - Country: + {{'data.detail.address.COUNTRY' | translate | titlecase}}: {{address.addressCountry}} - Post office box: + {{'data.detail.address.POST_OFFICE_BOX' | translate | titlecase}} {{address.postOfficeBoxNumber}} diff --git a/src/app/modules/data/elements/offers-detail.html b/src/app/modules/data/elements/offers-detail.html index 02c222d8..7024dc73 100644 --- a/src/app/modules/data/elements/offers-detail.html +++ b/src/app/modules/data/elements/offers-detail.html @@ -1,10 +1,10 @@ - Offers + {{'data.detail.offers.TITLE' | translate | titlecase}}

- {{offer.inPlace.name}},  + {{'name' | thingTranslate: item.inPlace}} {{offer.availabilityStarts | amDateFormat:'ll'}} diff --git a/src/app/modules/data/elements/offers-in-list.html b/src/app/modules/data/elements/offers-in-list.html index 950274cf..0c5a0e9a 100644 --- a/src/app/modules/data/elements/offers-in-list.html +++ b/src/app/modules/data/elements/offers-in-list.html @@ -1,6 +1,6 @@

{{offers[0].prices.default | currency:'EUR':'symbol':undefined:'de'}}

- {{offers[0].inPlace.name}} ... + {{offers[0].inPlace.name}}...

diff --git a/src/app/modules/data/elements/origin-detail.html b/src/app/modules/data/elements/origin-detail.html index 452d2cd2..09d01f89 100644 --- a/src/app/modules/data/elements/origin-detail.html +++ b/src/app/modules/data/elements/origin-detail.html @@ -1,25 +1,27 @@ - Origin(user) + {{'data.types.origin.TITLE' | translate | titlecase}}: {{'data.types.origin.USER' | translate | titlecase}} -

Created: {{origin.created | amDateFormat:'ll'}}

-

Updated: {{origin.updated | amDateFormat:'ll'}}

-

Modified: {{origin.modified | amDateFormat:'ll'}}

+

{{'data.types.origin.detail.CREATED' | translate | titlecase}}: {{origin.created | amDateFormat:'ll'}}

+

{{'data.types.origin.detail.UPDATED' | translate | titlecase}}: {{origin.updated | amDateFormat:'ll'}}

+

{{'data.types.origin.detail.MODIFIED' | translate | titlecase}}: {{origin.modified | amDateFormat:'ll'}}

+

{{'data.types.origin.detail.MAINTAINER' | translate }}: {{origin.name}}

- Maintainer: {{origin.maintainer.name}} + {{'data.types.origin.detail.MAINTAINER' | translate }}: {{origin.maintainer.name}}

- Origin(remote) + {{'data.types.origin.TITLE' | translate | titlecase}}: {{'data.types.origin.REMOTE' | translate | titlecase}} -

Indexed: {{origin.indexed | amDateFormat:'ll'}}

-

Modified: {{origin.modified | amDateFormat:'ll'}}

+

{{'data.types.origin.detail.INDEXED' | translate | titlecase}}: {{origin.indexed | amDateFormat:'ll'}}

+

{{'data.types.origin.detail.MODIFIED' | translate | titlecase}}: {{origin.modified | amDateFormat:'ll'}}

+

{{'data.types.origin.detail.MAINTAINER' | translate }}: {{origin.name}}

- Maintainer: {{origin.maintainer.name}} + {{'data.types.origin.detail.MAINTAINER' | translate | titlecase}}: {{origin.maintainer.name}}

- Responsible: {{origin.responsibleEntity.name}} + {{'data.types.origin.detail.RESPONSIBLE' | translate | titlecase}}: {{origin.responsibleEntity.name}}

diff --git a/src/app/modules/data/elements/simple-card.html b/src/app/modules/data/elements/simple-card.html index a0eca93c..06e01fa8 100644 --- a/src/app/modules/data/elements/simple-card.html +++ b/src/app/modules/data/elements/simple-card.html @@ -16,7 +16,7 @@ -

{{thing.name}}

+

{{'name' | thingTranslate: thing}}

diff --git a/src/app/modules/data/list/data-list-item.html b/src/app/modules/data/list/data-list-item.html index b1e10b90..6020400c 100644 --- a/src/app/modules/data/list/data-list-item.html +++ b/src/app/modules/data/list/data-list-item.html @@ -23,11 +23,11 @@
-

{{item.name}}

+

{{'name' | thingTranslate: item}}

- +

- {{item.type}} + {{'type' | thingTranslate: item}}
diff --git a/src/app/modules/data/types/article/article-detail-content.component.ts b/src/app/modules/data/types/article/article-detail-content.component.ts index 2b37313b..6de71a84 100644 --- a/src/app/modules/data/types/article/article-detail-content.component.ts +++ b/src/app/modules/data/types/article/article-detail-content.component.ts @@ -13,8 +13,7 @@ * this program. If not, see . */ import {Component, Input} from '@angular/core'; -import {SCArticle, SCThing, SCTranslations} from '@openstapps/core'; -import {SCThingTranslator} from '@openstapps/core'; +import {SCArticle} from '@openstapps/core'; /** * TODO @@ -28,22 +27,4 @@ export class ArticleDetailContentComponent { * TODO */ @Input() item: SCArticle; - /** - * TODO - */ - @Input() language: keyof SCTranslations; - /** - * TODO - */ - objectKeys = Object.keys; - /** - * TODO - */ - translator: SCThingTranslator; - /** - * TODO - */ - constructor() { - this.translator = new SCThingTranslator(this.language); - } } diff --git a/src/app/modules/data/types/article/article-detail-content.html b/src/app/modules/data/types/article/article-detail-content.html index 477a11a7..a3a14308 100644 --- a/src/app/modules/data/types/article/article-detail-content.html +++ b/src/app/modules/data/types/article/article-detail-content.html @@ -1,6 +1,6 @@ - + - - + diff --git a/src/app/modules/data/types/article/article-list-item.html b/src/app/modules/data/types/article/article-list-item.html index e582f293..4b9ec7bb 100644 --- a/src/app/modules/data/types/article/article-list-item.html +++ b/src/app/modules/data/types/article/article-list-item.html @@ -1,12 +1,12 @@ -

{{item.name}}

+

{{'name' | thingTranslate: item}}

- {{item.type}} + {{'type' | thingTranslate: item}}
diff --git a/src/app/modules/data/types/catalog/catalog-detail-content.component.ts b/src/app/modules/data/types/catalog/catalog-detail-content.component.ts index 01e5233c..83b0106e 100644 --- a/src/app/modules/data/types/catalog/catalog-detail-content.component.ts +++ b/src/app/modules/data/types/catalog/catalog-detail-content.component.ts @@ -13,8 +13,7 @@ * this program. If not, see . */ import {Component, Input} from '@angular/core'; -import {SCCatalog, SCThing, SCTranslations} from '@openstapps/core'; -import {SCThingTranslator} from '@openstapps/core'; +import {SCCatalog} from '@openstapps/core'; /** * TODO @@ -28,22 +27,4 @@ export class CatalogDetailContentComponent { * TODO */ @Input() item: SCCatalog; - /** - * TODO - */ - @Input() language: keyof SCTranslations; - /** - * TODO - */ - objectKeys = Object.keys; - /** - * TODO - */ - translator: SCThingTranslator; - /** - * TODO - */ - constructor() { - this.translator = new SCThingTranslator(this.language); - } } diff --git a/src/app/modules/data/types/catalog/catalog-detail-content.html b/src/app/modules/data/types/catalog/catalog-detail-content.html index 5f340582..ce0708a5 100644 --- a/src/app/modules/data/types/catalog/catalog-detail-content.html +++ b/src/app/modules/data/types/catalog/catalog-detail-content.html @@ -1,2 +1,2 @@ - + diff --git a/src/app/modules/data/types/catalog/catalog-list-item.html b/src/app/modules/data/types/catalog/catalog-list-item.html index 25c58920..80bd340a 100644 --- a/src/app/modules/data/types/catalog/catalog-list-item.html +++ b/src/app/modules/data/types/catalog/catalog-list-item.html @@ -2,9 +2,9 @@
-

{{item.name}}

+

{{'name' | thingTranslate: item}}

- +

{{item.academicTerm.name}}

diff --git a/src/app/modules/data/types/date-series/date-series-detail-content.component.ts b/src/app/modules/data/types/date-series/date-series-detail-content.component.ts index 87d4338a..4063ab87 100644 --- a/src/app/modules/data/types/date-series/date-series-detail-content.component.ts +++ b/src/app/modules/data/types/date-series/date-series-detail-content.component.ts @@ -13,8 +13,7 @@ * this program. If not, see . */ import {Component, Input} from '@angular/core'; -import {SCDateSeries, SCThing, SCTranslations} from '@openstapps/core'; -import {SCThingTranslator} from '@openstapps/core'; +import {SCDateSeries} from '@openstapps/core'; /** * TODO @@ -28,22 +27,4 @@ export class DateSeriesDetailContentComponent { * TODO */ @Input() item: SCDateSeries; - /** - * TODO - */ - @Input() language: keyof SCTranslations; - /** - * TODO - */ - objectKeys = Object.keys; - /** - * TODO - */ - translator: SCThingTranslator; - /** - * TODO - */ - constructor() { - this.translator = new SCThingTranslator(this.language); - } } diff --git a/src/app/modules/data/types/date-series/date-series-detail-content.html b/src/app/modules/data/types/date-series/date-series-detail-content.html index 47de4f8e..9238af14 100644 --- a/src/app/modules/data/types/date-series/date-series-detail-content.html +++ b/src/app/modules/data/types/date-series/date-series-detail-content.html @@ -1,12 +1,12 @@ - Place + {{'inPlace' | propertyNameTranslate: item | titlecase}} - {{item.inPlace.name}} + {{'name' | thingTranslate: item.inPlace}} - + diff --git a/src/app/modules/data/types/date-series/date-series-list-item.html b/src/app/modules/data/types/date-series/date-series-list-item.html index 65544990..e598c8da 100644 --- a/src/app/modules/data/types/date-series/date-series-list-item.html +++ b/src/app/modules/data/types/date-series/date-series-list-item.html @@ -2,7 +2,7 @@
-

{{item.name}}

+

{{'name' | thingTranslate: item}}

@@ -10,7 +10,7 @@ ({{item.dates[0] | amDateFormat:'ll'}} - {{item.dates[item.dates.length - 1] | amDateFormat:'ll'}})

- {{item.event.categories.join(', ')}} + {{'categories' | thingTranslate: item.event | join: ', '}}
diff --git a/src/app/modules/data/types/dish/dish-detail-content.component.ts b/src/app/modules/data/types/dish/dish-detail-content.component.ts index 1a8e41d4..a344d3bb 100644 --- a/src/app/modules/data/types/dish/dish-detail-content.component.ts +++ b/src/app/modules/data/types/dish/dish-detail-content.component.ts @@ -27,14 +27,4 @@ export class DishDetailContentComponent { * TODO */ @Input() item: SCDish; - /** - * TODO - */ - objectKeys = Object.keys; - /** - * TODO - */ - constructor() { - // nothing yet - } } diff --git a/src/app/modules/data/types/favorite/favorite-detail-content.component.ts b/src/app/modules/data/types/favorite/favorite-detail-content.component.ts index baba11a4..24876583 100644 --- a/src/app/modules/data/types/favorite/favorite-detail-content.component.ts +++ b/src/app/modules/data/types/favorite/favorite-detail-content.component.ts @@ -13,8 +13,7 @@ * this program. If not, see . */ import {Component, Input} from '@angular/core'; -import {SCFavorite, SCThing, SCTranslations} from '@openstapps/core'; -import {SCThingTranslator} from '@openstapps/core'; +import {SCFavorite} from '@openstapps/core'; /** * TODO @@ -28,22 +27,4 @@ export class FavoriteDetailContentComponent { * TODO */ @Input() item: SCFavorite; - /** - * TODO - */ - @Input() language: keyof SCTranslations; - /** - * TODO - */ - objectKeys = Object.keys; - /** - * TODO - */ - translator: SCThingTranslator; - /** - * TODO - */ - constructor() { - this.translator = new SCThingTranslator(this.language); - } } diff --git a/src/app/modules/data/types/favorite/favorite-list-item.html b/src/app/modules/data/types/favorite/favorite-list-item.html index 5d947c40..389f0640 100644 --- a/src/app/modules/data/types/favorite/favorite-list-item.html +++ b/src/app/modules/data/types/favorite/favorite-list-item.html @@ -2,11 +2,11 @@
-

{{item.name}}: {{item.data.name}}

+

{{'name' | thingTranslate: item}}: {{'name' | thingTranslate: item.data}}

- +

- {{item.type}} ({{item.data.type}}) + {{'type' | thingTranslate: item}} ({{'type' | thingTranslate: item.data}})
diff --git a/src/app/modules/data/types/message/message-detail-content.component.ts b/src/app/modules/data/types/message/message-detail-content.component.ts index 904cb26e..3f559215 100644 --- a/src/app/modules/data/types/message/message-detail-content.component.ts +++ b/src/app/modules/data/types/message/message-detail-content.component.ts @@ -13,8 +13,7 @@ * this program. If not, see . */ import {Component, Input} from '@angular/core'; -import {SCMessage, SCThing, SCTranslations} from '@openstapps/core'; -import {SCThingTranslator} from '@openstapps/core'; +import {SCMessage} from '@openstapps/core'; /** * TODO @@ -28,22 +27,4 @@ export class MessageDetailContentComponent { * TODO */ @Input() item: SCMessage; - /** - * TODO - */ - @Input() language: keyof SCTranslations; - /** - * TODO - */ - objectKeys = Object.keys; - /** - * TODO - */ - translator: SCThingTranslator; - /** - * TODO - */ - constructor() { - this.translator = new SCThingTranslator(this.language); - } } diff --git a/src/app/modules/data/types/message/message-detail-content.html b/src/app/modules/data/types/message/message-detail-content.html index c34b2c49..cc2cb40f 100644 --- a/src/app/modules/data/types/message/message-detail-content.html +++ b/src/app/modules/data/types/message/message-detail-content.html @@ -1,5 +1,5 @@ - - - - - + + + + + diff --git a/src/app/modules/data/types/message/message-list-item.html b/src/app/modules/data/types/message/message-list-item.html index 31cdf049..792cd253 100644 --- a/src/app/modules/data/types/message/message-list-item.html +++ b/src/app/modules/data/types/message/message-list-item.html @@ -2,11 +2,11 @@
-

{{item.name}}

+

{{'name' | thingTranslate: item}}

- +

- {{item.type}} + {{'type' | thingTranslate: item}}
diff --git a/src/app/modules/data/types/organization/organization-detail-content.component.ts b/src/app/modules/data/types/organization/organization-detail-content.component.ts index 53642c6c..6c701984 100644 --- a/src/app/modules/data/types/organization/organization-detail-content.component.ts +++ b/src/app/modules/data/types/organization/organization-detail-content.component.ts @@ -13,8 +13,7 @@ * this program. If not, see . */ import {Component, Input} from '@angular/core'; -import {SCOrganization, SCThing, SCTranslations} from '@openstapps/core'; -import {SCThingTranslator} from '@openstapps/core'; +import {SCOrganization} from '@openstapps/core'; /** * TODO @@ -28,23 +27,4 @@ export class OrganizationDetailContentComponent { * TODO */ @Input() item: SCOrganization; - /** - * TODO - */ - @Input() language: keyof SCTranslations; - /** - * TODO - */ - objectKeys = Object.keys; - /** - * TODO - */ - translator: SCThingTranslator; - - /** - * TODO - */ - constructor() { - this.translator = new SCThingTranslator(this.language); - } } diff --git a/src/app/modules/data/types/organization/organization-detail-content.html b/src/app/modules/data/types/organization/organization-detail-content.html index 97b42ee0..0ab5e40d 100644 --- a/src/app/modules/data/types/organization/organization-detail-content.html +++ b/src/app/modules/data/types/organization/organization-detail-content.html @@ -1,9 +1,9 @@ - Place + {{'inPlace' | propertyNameTranslate: item | titlecase}} - {{item.inPlace.name}} + {{'name' | thingTranslate: item.inPlace}} diff --git a/src/app/modules/data/types/organization/organization-list-item.html b/src/app/modules/data/types/organization/organization-list-item.html index f1ad829f..eb52e942 100644 --- a/src/app/modules/data/types/organization/organization-list-item.html +++ b/src/app/modules/data/types/organization/organization-list-item.html @@ -2,14 +2,14 @@
-

{{item.name}}

-

{{item.description}}

- {{item.type}} +

{{'name' | thingTranslate: item}}

+

{{'description' | thingTranslate: item}}

+ {{'type' | thingTranslate: item}}
- {{item.inPlace.name}} + {{'name' | thingTranslate: item.inPlace}}
diff --git a/src/app/modules/data/types/person/person-detail-content.component.ts b/src/app/modules/data/types/person/person-detail-content.component.ts index 5f0c57e6..88466af6 100644 --- a/src/app/modules/data/types/person/person-detail-content.component.ts +++ b/src/app/modules/data/types/person/person-detail-content.component.ts @@ -13,8 +13,7 @@ * this program. If not, see . */ import {Component, Input} from '@angular/core'; -import {SCPerson, SCThing, SCTranslations} from '@openstapps/core'; -import {SCThingTranslator} from '@openstapps/core'; +import {SCPerson} from '@openstapps/core'; /** * TODO @@ -28,23 +27,4 @@ export class PersonDetailContentComponent { * TODO */ @Input() item: SCPerson; - /** - * TODO - */ - @Input() language: keyof SCTranslations; - /** - * TODO - */ - objectKeys = Object.keys; - /** - * TODO - */ - translator: SCThingTranslator; - - /** - * TODO - */ - constructor() { - this.translator = new SCThingTranslator(this.language); - } } diff --git a/src/app/modules/data/types/person/person-detail-content.html b/src/app/modules/data/types/person/person-detail-content.html index e3e556e0..424a2710 100644 --- a/src/app/modules/data/types/person/person-detail-content.html +++ b/src/app/modules/data/types/person/person-detail-content.html @@ -1,32 +1,32 @@ - Contact information + {{'type' | thingTranslate: item.workLocations[0] | titlecase}} -

Tel: {{'telephone' | propertyNameTranslate: item.workLocations[0] | titlecase}}: {{item.workLocations[0].telephone}}

-

Email: {{'email' | propertyNameTranslate: item.workLocations[0] | titlecase}}: {{item.workLocations[0].email}}

-

Fax: {{item.workLocations[0].faxNumber}}

-

URL: {{'faxNumber' | propertyNameTranslate: item.workLocations[0] | titlecase}}: {{item.workLocations[0].faxNumber}}

+

{{'url' | propertyNameTranslate: item.workLocations[0] | titlecase}}: {{item.workLocations[0].url}}

-

Office: {{'areaServed' | propertyNameTranslate: item.workLocations[0] | titlecase}}: {{item.workLocations[0].areaServed.name}}

-

Tel: {{'telephone' | propertyNameTranslate: item.workLocation | titlecase}}: {{workLocation.telephone}}

-

Email: {{workLocation.email}} +

{{'email' | propertyNameTranslate: item.workLocation | titlecase}}: {{workLocation.email}}

-

Fax: {{workLocation.faxNumber}}

-

URL: {{workLocation.url}}

-

Office: {{'faxNumber' | propertyNameTranslate: item.workLocation | titlecase}}: {{workLocation.faxNumber}}

+

{{'url' | propertyNameTranslate: item.workLocation | titlecase}}: {{workLocation.url}}

+

{{'areaServed' | propertyNameTranslate: item.workLocation | titlecase}}: {{workLocation.areaServed.name}}

@@ -35,4 +35,4 @@
- + diff --git a/src/app/modules/data/types/person/person-list-item.html b/src/app/modules/data/types/person/person-list-item.html index 1a803ec6..86c3ae0a 100644 --- a/src/app/modules/data/types/person/person-list-item.html +++ b/src/app/modules/data/types/person/person-list-item.html @@ -2,7 +2,7 @@
-

{{item.name}} , {{item.honorificPrefix}}

+

{{'name' | thingTranslate: item}} , {{item.honorificPrefix}}

 {{item.telephone}}  diff --git a/src/app/modules/data/types/place/place-detail-content.component.ts b/src/app/modules/data/types/place/place-detail-content.component.ts index 85ca75c6..78e58aac 100644 --- a/src/app/modules/data/types/place/place-detail-content.component.ts +++ b/src/app/modules/data/types/place/place-detail-content.component.ts @@ -13,8 +13,7 @@ * this program. If not, see . */ import {Component, Input} from '@angular/core'; -import {SCBuilding, SCFloor, SCPointOfInterest, SCRoom, SCThing, SCTranslations} from '@openstapps/core'; -import {SCThings, SCThingTranslator} from '@openstapps/core'; +import {SCBuilding, SCFloor, SCPointOfInterest, SCRoom, SCThings} from '@openstapps/core'; import {DataProvider} from '../../data.provider'; /** @@ -30,25 +29,6 @@ export class PlaceDetailContentComponent { * TODO */ @Input() item: SCBuilding | SCRoom | SCPointOfInterest | SCFloor; - /** - * TODO - */ - @Input() language: keyof SCTranslations; - /** - * TODO - */ - objectKeys = Object.keys; - /** - * TODO - */ - translator: SCThingTranslator; - - /** - * TODO - */ - constructor() { - this.translator = new SCThingTranslator(this.language); - } /** * TODO diff --git a/src/app/modules/data/types/place/place-detail-content.html b/src/app/modules/data/types/place/place-detail-content.html index bc33a943..688f27f8 100644 --- a/src/app/modules/data/types/place/place-detail-content.html +++ b/src/app/modules/data/types/place/place-detail-content.html @@ -1,15 +1,15 @@ - + - Building: + {{'inPlace' | propertyNameTranslate: item | titlecase}} - {{item.inPlace.name}} + {{'name' | thingTranslate: item.inPlace}} diff --git a/src/app/modules/data/types/place/place-list-item.html b/src/app/modules/data/types/place/place-list-item.html index 08a0781b..f7d6730d 100644 --- a/src/app/modules/data/types/place/place-list-item.html +++ b/src/app/modules/data/types/place/place-list-item.html @@ -2,14 +2,14 @@

-

{{item.name}}

-

{{item.description}}

- {{item.type}} +

{{'name' | thingTranslate: item}}

+

{{'description' | thingTranslate: item}}

+ {{'type' | thingTranslate: item}}
- {{item.inPlace.name}} + {{'name' | thingTranslate: item.inPlace}} diff --git a/src/app/modules/data/types/place/special/mensa/place-mensa-detail.component.ts b/src/app/modules/data/types/place/special/mensa/place-mensa-detail.component.ts index 7b2ac9f2..48ea83b7 100644 --- a/src/app/modules/data/types/place/special/mensa/place-mensa-detail.component.ts +++ b/src/app/modules/data/types/place/special/mensa/place-mensa-detail.component.ts @@ -16,7 +16,7 @@ import moment, {Moment} from 'moment'; import {AfterViewInit, ChangeDetectorRef, Component, Input} from '@angular/core'; -import {SCDish, SCPlace, SCThing, SCThingTranslator, SCTranslations} from '@openstapps/core'; +import {SCDish, SCPlace} from '@openstapps/core'; import {PlaceMensaService} from './place-mensa-service'; /** @@ -44,11 +44,6 @@ export class PlaceMensaDetailComponent implements AfterViewInit { */ @Input() item: SCPlace; - /** - * TODO - */ - @Input() language: keyof SCTranslations; - /** * TODO */ @@ -59,15 +54,9 @@ export class PlaceMensaDetailComponent implements AfterViewInit { */ startingDay: Moment; - /** - * TODO - */ - translator: SCThingTranslator; - constructor(private mensaService: PlaceMensaService, private changeDectectorRef: ChangeDetectorRef) { // TODO: translation - this.translator = new SCThingTranslator(this.language); this.startingDay = moment(); this.startingDay.hour(0); this.startingDay.minute(0); @@ -120,7 +109,7 @@ export class PlaceMensaDetailComponent implements AfterViewInit { } } } - if (selectedDishes.length) { + if (selectedDishes.length > 0) { out[startingDay.format('L')] = selectedDishes; } // tslint:disable-next-line:no-parameter-reassignment diff --git a/src/app/modules/data/types/semester/semester-detail-content.component.ts b/src/app/modules/data/types/semester/semester-detail-content.component.ts index d7b680f9..227811d6 100644 --- a/src/app/modules/data/types/semester/semester-detail-content.component.ts +++ b/src/app/modules/data/types/semester/semester-detail-content.component.ts @@ -13,8 +13,7 @@ * this program. If not, see . */ import {Component, Input} from '@angular/core'; -import {SCSemester, SCThing, SCTranslations} from '@openstapps/core'; -import {SCThingTranslator} from '@openstapps/core'; +import {SCSemester} from '@openstapps/core'; /** * TODO @@ -28,23 +27,4 @@ export class SemesterDetailContentComponent { * TODO */ @Input() item: SCSemester; - /** - * TODO - */ - @Input() language: keyof SCTranslations; - /** - * TODO - */ - objectKeys = Object.keys; - /** - * TODO - */ - translator: SCThingTranslator; - - /** - * TODO - */ - constructor() { - this.translator = new SCThingTranslator(this.language); - } } diff --git a/src/app/modules/data/types/semester/semester-detail-content.html b/src/app/modules/data/types/semester/semester-detail-content.html index 1849ddfc..4fdc5ed8 100644 --- a/src/app/modules/data/types/semester/semester-detail-content.html +++ b/src/app/modules/data/types/semester/semester-detail-content.html @@ -1,2 +1,3 @@ - - + diff --git a/src/app/modules/data/types/semester/semester-list-item.html b/src/app/modules/data/types/semester/semester-list-item.html index 0015bed6..308bedd5 100644 --- a/src/app/modules/data/types/semester/semester-list-item.html +++ b/src/app/modules/data/types/semester/semester-list-item.html @@ -2,12 +2,12 @@
-

{{item.name}}

+

{{'name' | thingTranslate: item}}

{{item.startDate | amDateFormat: 'll'}} - {{item.endDate | amDateFormat:'ll'}}

- {{item.type}} + {{'type' | thingTranslate: item}}
diff --git a/src/app/modules/data/types/video/video-detail-content.component.ts b/src/app/modules/data/types/video/video-detail-content.component.ts index 0e260c67..657f291f 100644 --- a/src/app/modules/data/types/video/video-detail-content.component.ts +++ b/src/app/modules/data/types/video/video-detail-content.component.ts @@ -13,8 +13,7 @@ * this program. If not, see . */ import {Component, Input} from '@angular/core'; -import {SCThing, SCTranslations, SCVideo} from '@openstapps/core'; -import {SCThingTranslator} from '@openstapps/core'; +import {SCVideo} from '@openstapps/core'; /** * TODO @@ -28,23 +27,4 @@ export class VideoDetailContentComponent { * TODO */ @Input() item: SCVideo; - /** - * TODO - */ - @Input() language: keyof SCTranslations; - /** - * TODO - */ - objectKeys = Object.keys; - /** - * TODO - */ - translator: SCThingTranslator; - - /** - * TODO - */ - constructor() { - this.translator = new SCThingTranslator(this.language); - } } diff --git a/src/app/modules/data/types/video/video-detail-content.html b/src/app/modules/data/types/video/video-detail-content.html index bf6f172c..1e19edc4 100644 --- a/src/app/modules/data/types/video/video-detail-content.html +++ b/src/app/modules/data/types/video/video-detail-content.html @@ -1,6 +1,6 @@ - - - - + + + + diff --git a/src/app/modules/data/types/video/video-list-item.html b/src/app/modules/data/types/video/video-list-item.html index bf2fe409..714ce432 100644 --- a/src/app/modules/data/types/video/video-list-item.html +++ b/src/app/modules/data/types/video/video-list-item.html @@ -2,10 +2,10 @@
-

{{item.name}}

-

-

Duration: {{item.duration | amDuration:'seconds'}}

- {{item.type}} +

{{'name' | thingTranslate: item}}

+

+

{{'duration' | propertyNameTranslate: item | titlecase}}: {{item.duration | amDuration:'seconds'}}

+ {{'type' | thingTranslate: item}}
diff --git a/src/assets/i18n/de.json b/src/assets/i18n/de.json index 08a02d00..07f9b7a9 100644 --- a/src/assets/i18n/de.json +++ b/src/assets/i18n/de.json @@ -5,7 +5,19 @@ "detail": { "TITLE": "Detailansicht", "NOT_FOUND": "Nicht gefunden", - "COULD_NOT_CONNECT": "Verbindung fehlgeschlagen" + "COULD_NOT_CONNECT": "Verbindung fehlgeschlagen", + "address": { + "TITLE": "Adresse", + "STREET": "Straße", + "POSTCODE": "Postleitzahl", + "CITY": "Stadt", + "REGION": "Region", + "Country": "Land", + "POST_OFFICE_BOX": "Postfach" + }, + "offers": { + "TITLE": "Angebote" + } }, "types": { "dish": { @@ -13,12 +25,25 @@ "AVG_NUTRITION_INFO": "Durchschnittliche Nährwertangaben", "CALORIES": "Brennwert", "FAT_TOTAL": "Fett", - "FAT_SATURATED": "davon gesättinge Fettsäuren", + "FAT_SATURATED": "davon gesättigte Fettsäuren", "CARBOHYDRATE" : "Kohlenhydrate", "SALT": "Salz", "SUGAR": "davon Zucker", "PROTEIN": "Protein" } + }, + "origin": { + "TITLE": "Ursprung", + "USER": "Nutzer", + "REMOTE": "Datenquelle", + "detail": { + "CREATED": "Erstellt am", + "UPDATED": "Aktualisiert am", + "MODIFIED": "Geändert am", + "INDEXED": "Indexiert am", + "MAINTAINER": "zur Verfügung gestellt von", + "RESPONSIBLE": "Verantwortlich" + } } } }, diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index 2e852052..d850cd64 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -5,7 +5,19 @@ "detail": { "TITLE": "Details", "NOT_FOUND": "Not found", - "COULD_NOT_CONNECT": "Couldn't connect" + "COULD_NOT_CONNECT": "Couldn't connect", + "address": { + "TITLE": "address", + "STREET": "street", + "POSTCODE": "postcode", + "CITY": "city", + "REGION": "region", + "Country": "country", + "POST_OFFICE_BOX": "post office box" + }, + "offers": { + "TITLE": "offers" + } }, "types": { "dish": { @@ -19,6 +31,19 @@ "SUGAR": "Sugars", "PROTEIN": "Protein" } + }, + "origin": { + "TITLE": "origin", + "USER": "user", + "REMOTE": "remote", + "detail": { + "CREATED": "created at", + "UPDATED": "updated at", + "MODIFIED": "modified at", + "INDEXED": "indexed", + "MAINTAINER": "maintainer", + "RESPONSIBLE": "responsible entity" + } } } }, @@ -45,7 +70,7 @@ }, "settings": { "resetAlert.title": "Reset all settings?", - "resetAlert.message": "Are you shure to reset all settings to defaults values?", + "resetAlert.message": "Are you sure to reset all settings to their default values?", "resetAlert.buttonYes": "yes", "resetAlert.buttonCancel": "cancel", "resetToast.message": "Settings reset",