fix: add translations for every SCThing

fix: add field translations for  basic interfaces

fix: add translations for Message, Ticket & Video

fix: add translations for AcademicEvent, Article, Book and Building

fix: add translations

fix: add translations for Dish, Floor, Person and Room

fix: finalize  known translations

fix: add translations for setting

fix: add empty translations for fieldValues

style: applied tslint rules

fix: add missing fieldValueTranslations

fix: remove illegal nested translations
This commit is contained in:
Rainer Killinger
2019-06-05 12:31:48 +00:00
committed by Karl-Philipp Wulfert
parent 78b64bae08
commit f847a2aa0c
33 changed files with 736 additions and 205 deletions

View File

@@ -12,10 +12,10 @@
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {SCThing, SCThingTranslatableProperties, SCThingWithoutReferences} from '../Thing';
import {SCThing, SCThingMeta, SCThingTranslatableProperties, SCThingWithoutReferences} from '../Thing';
import {SCOrganizationWithoutReferences} from '../things/Organization';
import {SCPersonWithoutReferences} from '../things/Person';
import {SCTranslations} from '../types/i18n';
import {SCMetaTranslations, SCTranslations} from '../types/i18n';
import {SCInPlace} from '../types/Places';
import {SCISO8601Date} from '../types/Time';
@@ -134,3 +134,47 @@ export type SCThingThatCanBeOfferedAvailability =
| 'out of stock'
| 'online only'
| 'limited availability';
/**
* Meta information about a thing without references that accepts payments
*/
export class SCThingThatCanBeOfferedMeta<T extends SCPriceGroup> implements
SCMetaTranslations<SCThingThatCanBeOffered<T>> {
protected static _instance: any;
/**
* Translations of fields
*/
fieldTranslations = {
de: {
... SCThingMeta.getInstance().fieldTranslations.de,
offers: 'Angebote',
},
en: {
... SCThingMeta.getInstance().fieldTranslations.en,
offers: 'offers',
},
};
/**
* Translations of values of fields
*/
fieldValueTranslations = {
de: {
... SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.de,
},
en: {
... SCThingMeta.getInstance<SCThingMeta>().fieldValueTranslations.en,
},
};
/**
* Function to retrieve typed singleton instance (including generics)
*/
public static getInstance<T extends SCPriceGroup>(): SCThingThatCanBeOfferedMeta<T> {
return this._instance || (this._instance = new this<T>());
}
protected constructor() {}
}