Merged PR 225: Implement translations

Implement translations with useContext in React
+Add events to allow changing the language in the app
+Refactor AppEvents
+Redesign vertical bars in elements
This commit is contained in:
Eric Nguyen 2022-11-04 10:58:06 +00:00
parent 60a3ead6aa
commit 505813d530
26 changed files with 527 additions and 160 deletions

21
public/svgld.d.ts vendored
View file

@ -88,6 +88,7 @@ export interface IAPIConfiguration {
/** Model of available container used in application configuration */
export interface IAvailableContainer {
/** type */
@ -212,7 +213,7 @@ export interface IAvailableContainer {
* (optional)
* User data that can be used for data storage or custom SVG
*/
UserData?: object;
UserData?: IKeyValue[];
}
@ -250,7 +251,6 @@ export interface IConfiguration {
export interface IContainerModel {
children: string[];
parent: IContainerModel | null;
properties: IContainerProperties;
userData: Record<string, string | number>;
}
@ -260,10 +260,9 @@ export interface IContainerModel {
*/
export class ContainerModel implements IContainerModel {
children: string[];
parent: IContainerModel | null;
properties: IContainerProperties;
userData: Record<string, string | number>;
constructor(parent: IContainerModel | null, properties: IContainerProperties, children?: string[], userData?: {});
constructor(properties: IContainerProperties, children?: string[], userData?: {});
}
@ -271,6 +270,7 @@ export class ContainerModel implements IContainerModel {
/**
* Properties of a container
*/
@ -363,7 +363,7 @@ export interface IContainerProperties {
* (optional)
* User data that can be used for data storage or custom SVG
*/
userData?: object;
userData?: IKeyValue[];
}
@ -428,6 +428,17 @@ export interface IInputGroup {
value: string;
}
export interface IKeyValue {
Key: string;
Value: string;
}
export interface ILanguage {
language: string;
dictionary: Record<string, string>;
languageChange?: (selected: string) => void;
}
export interface IMargin {
left?: number;
bottom?: number;