Add internationalization.

This commit is contained in:
Paulo Gustavo Veiga 2022-12-21 21:22:17 -08:00
parent 94e8046bae
commit b3587acfee
11 changed files with 189 additions and 43 deletions

View File

@ -93,7 +93,7 @@
"defaultMessage": "Zoom zu passen"
},
"editor-panel.tooltip-add-icon": {
"defaultMessage":"Symbol hinzufügen"
"defaultMessage": "Symbol hinzufügen"
},
"editor-panel.tooltip-add-link": {
"defaultMessage": "Link hinzufügen"
@ -150,75 +150,87 @@
"defaultMessage": "Themenstil"
},
"shortcut-help-pane.action": {
"defaultMessage": "Aktion"
"defaultMessage": "Aktion"
},
"shortcut-help-pane.add-child": {
"defaultMessage": "Kinderthema hinzufügen"
"defaultMessage": "Kinderthema hinzufügen"
},
"shortcut-help-pane.add-link": {
"defaultMessage": "Link hinzufügen"
"defaultMessage": "Link hinzufügen"
},
"shortcut-help-pane.add-note": {
"defaultMessage": "Notiz hinzufügen"
"defaultMessage": "Notiz hinzufügen"
},
"shortcut-help-pane.add-sibling": {
"defaultMessage": "Geschwisterthema hinzufügen"
"defaultMessage": "Geschwisterthema hinzufügen"
},
"shortcut-help-pane.cancel-text-changes": {
"defaultMessage": "Textänderungen abbrechen"
"defaultMessage": "Textänderungen abbrechen"
},
"shortcut-help-pane.change-font-bold": {
"defaultMessage": "Text in fett gedruckt"
"defaultMessage": "Text in fett gedruckt"
},
"shortcut-help-pane.change-font-italic": {
"defaultMessage": "Text in Kursivschrift ändern"
"defaultMessage": "Text in Kursivschrift ändern"
},
"shortcut-help-pane.collapse-children": {
"defaultMessage": "Kinder zusammenbrechen"
"defaultMessage": "Kinder zusammenbrechen"
},
"shortcut-help-pane.copy-and-text": {
"defaultMessage": "Themen kopieren und einfügen"
"defaultMessage": "Themen kopieren und einfügen"
},
"shortcut-help-pane.delete-topic": {
"defaultMessage":"Thema löschen"
"defaultMessage": "Thema löschen"
},
"shortcut-help-pane.deselect-all-topics": {
"defaultMessage": "Alle Themen auswählen"
"defaultMessage": "Alle Themen auswählen"
},
"shortcut-help-pane.edit-multiline": {
"defaultMessage": "Multi-Line-Thementext hinzufügen"
"defaultMessage": "Multi-Line-Thementext hinzufügen"
},
"shortcut-help-pane.edit-topic": {
"defaultMessage": "Thementext bearbeiten"
"defaultMessage": "Thementext bearbeiten"
},
"shortcut-help-pane.edit-topic-key": {
"defaultMessage": "Fang einfach an zu tippen"
"defaultMessage": "Fang einfach an zu tippen"
},
"shortcut-help-pane.navigation": {
"defaultMessage": "navigation"
"defaultMessage": "navigation"
},
"shortcut-help-pane.navigation-keys": {
"defaultMessage": "Pfeiltasten"
"defaultMessage": "Pfeiltasten"
},
"shortcut-help-pane.redo": {
"defaultMessage": "redoEdition"
"defaultMessage": "redoEdition"
},
"shortcut-help-pane.save-changes": {
"defaultMessage": "Änderungen speichern"
"defaultMessage": "Änderungen speichern"
},
"shortcut-help-pane.select-all-topics": {
"defaultMessage": "Wählen Sie alle Themen aus"
"defaultMessage": "Wählen Sie alle Themen aus"
},
"shortcut-help-pane.select-topics": {
"defaultMessage": "Wählen Sie mehrere Themen aus"
"defaultMessage": "Wählen Sie mehrere Themen aus"
},
"shortcut-help-pane.select-topics-keys": {
"defaultMessage": "Mausklick"
"defaultMessage": "Mausklick"
},
"shortcut-help-pane.undo": {
"defaultMessage": "Rückgängerausgabe"
"defaultMessage": "Rückgängerausgabe"
},
"icon-picker.show-images": {
"defaultMessage": "Bilder anzeigen"
"defaultMessage": "Bilder anzeigen"
},
"editor-panel.tooltip-connection-style": {
"defaultMessage": "Verbindungsstil"
},
"editor-panel.tooltip-connection-style-curved": {
"defaultMessage": "Kurve"
},
"editor-panel.tooltip-connection-style-polyline": {
"defaultMessage": "Polylinie"
},
"editor-panel.tooltip-connection-style-polyline-curved": {
"defaultMessage": "Gekrümmte Polylinie"
}
}

View File

@ -62,6 +62,18 @@
"editor-panel.tooltip-add-topic": {
"defaultMessage": "Add Topic"
},
"editor-panel.tooltip-connection-style": {
"defaultMessage": "Connection Style"
},
"editor-panel.tooltip-connection-style-curved": {
"defaultMessage": "Curved"
},
"editor-panel.tooltip-connection-style-polyline": {
"defaultMessage": "Polyline"
},
"editor-panel.tooltip-connection-style-polyline-curved": {
"defaultMessage": "Curved Polyline"
},
"editor-panel.tooltip-delete-topic": {
"defaultMessage": "Delete Topic"
},

View File

@ -214,5 +214,17 @@
},
"icon-picker.show-images": {
"defaultMessage": "Mostrar imagenes"
},
"editor-panel.tooltip-connection-style": {
"defaultMessage": "Estilo de Connexión"
},
"editor-panel.tooltip-connection-style-curved": {
"defaultMessage": "Curva"
},
"editor-panel.tooltip-connection-style-polyline": {
"defaultMessage": "Polilinea"
},
"editor-panel.tooltip-connection-style-polyline-curved": {
"defaultMessage": "Polilinea Curva"
}
}

View File

@ -214,5 +214,17 @@
},
"icon-picker.show-images": {
"defaultMessage": "Afficher les images"
},
"editor-panel.tooltip-connection-style": {
"defaultMessage": "Style de connexion"
},
"editor-panel.tooltip-connection-style-curved": {
"defaultMessage": "Courbe"
},
"editor-panel.tooltip-connection-style-polyline": {
"defaultMessage": "Polyligne"
},
"editor-panel.tooltip-connection-style-polyline-curved": {
"defaultMessage": "Polyligne courbe"
}
}

View File

@ -131,6 +131,30 @@
"value": "Thema hinzufügen"
}
],
"editor-panel.tooltip-connection-style": [
{
"type": 0,
"value": "Verbindungsstil"
}
],
"editor-panel.tooltip-connection-style-curved": [
{
"type": 0,
"value": "Kurve"
}
],
"editor-panel.tooltip-connection-style-polyline": [
{
"type": 0,
"value": "Polylinie"
}
],
"editor-panel.tooltip-connection-style-polyline-curved": [
{
"type": 0,
"value": "Gekrümmte Polylinie"
}
],
"editor-panel.tooltip-delete-topic": [
{
"type": 0,

View File

@ -125,6 +125,30 @@
"value": "Add Topic"
}
],
"editor-panel.tooltip-connection-style": [
{
"type": 0,
"value": "Connection Style"
}
],
"editor-panel.tooltip-connection-style-curved": [
{
"type": 0,
"value": "Curved"
}
],
"editor-panel.tooltip-connection-style-polyline": [
{
"type": 0,
"value": "Polyline"
}
],
"editor-panel.tooltip-connection-style-polyline-curved": [
{
"type": 0,
"value": "Curved Polyline"
}
],
"editor-panel.tooltip-delete-topic": [
{
"type": 0,

View File

@ -125,6 +125,30 @@
"value": "Agregar tópico"
}
],
"editor-panel.tooltip-connection-style": [
{
"type": 0,
"value": "Estilo de Connexión"
}
],
"editor-panel.tooltip-connection-style-curved": [
{
"type": 0,
"value": "Curva"
}
],
"editor-panel.tooltip-connection-style-polyline": [
{
"type": 0,
"value": "Polilinea"
}
],
"editor-panel.tooltip-connection-style-polyline-curved": [
{
"type": 0,
"value": "Polilinea Curva"
}
],
"editor-panel.tooltip-delete-topic": [
{
"type": 0,

View File

@ -125,6 +125,30 @@
"value": "Agregar Topico"
}
],
"editor-panel.tooltip-connection-style": [
{
"type": 0,
"value": "Style de connexion"
}
],
"editor-panel.tooltip-connection-style-curved": [
{
"type": 0,
"value": "Courbe"
}
],
"editor-panel.tooltip-connection-style-polyline": [
{
"type": 0,
"value": "Polyligne"
}
],
"editor-panel.tooltip-connection-style-polyline-curved": [
{
"type": 0,
"value": "Polyligne courbe"
}
],
"editor-panel.tooltip-delete-topic": [
{
"type": 0,

View File

@ -158,6 +158,15 @@ export function buildEditorPanelConfig(model: Editor, intl: IntlShape): ActionCo
defaultMessage: 'Connection Style',
}),
options: [
{
icon: <GestureOutlined />,
tooltip: intl.formatMessage({
id: 'editor-panel.tooltip-connection-style-curved',
defaultMessage: 'Curved',
}),
onClick: () => valueBulder.getConnectionStyleModel().setValue(LineType.SIMPLE_CURVED),
selected: () => valueBulder.getConnectionStyleModel().getValue() === LineType.SIMPLE_CURVED,
},
{
icon: <PolylineOutlined />,
tooltip: intl.formatMessage({
@ -172,21 +181,12 @@ export function buildEditorPanelConfig(model: Editor, intl: IntlShape): ActionCo
icon: <TimelineOutined />,
tooltip: intl.formatMessage({
id: 'editor-panel.tooltip-connection-style-polyline-curved',
defaultMessage: 'Polyline Curved',
defaultMessage: 'Curved Polyline',
}),
onClick: () => valueBulder.getConnectionStyleModel().setValue(LineType.POLYLINE_CURVED),
selected: () =>
valueBulder.getConnectionStyleModel().getValue() === LineType.POLYLINE_CURVED,
},
{
icon: <GestureOutlined />,
tooltip: intl.formatMessage({
id: 'editor-panel.tooltip-connection-style-curved',
defaultMessage: 'Curved',
}),
onClick: () => valueBulder.getConnectionStyleModel().setValue(LineType.SIMPLE_CURVED),
selected: () => valueBulder.getConnectionStyleModel().getValue() === LineType.SIMPLE_CURVED,
},
],
disabled: () => model.getDesignerModel().filterSelectedTopics().length === 0,
};

View File

@ -660,7 +660,7 @@ class Designer extends Events {
this._workspace.append(result);
children.forEach((child) => {
if ($defined(child)) {
if (child) {
this.nodeModelToTopic(child);
}
});
@ -690,10 +690,6 @@ class Designer extends Events {
return result;
}
/**
* @param {mindplot.model.RelationshipModel} model
* @return {mindplot.Relationship} the relationship added to the mindmap
*/
addRelationship(model: RelationshipModel): Relationship {
const mindmap = this.getMindmap();
mindmap.addRelationship(model);
@ -881,7 +877,7 @@ class Designer extends Events {
changeConnectionStyle(type: LineType): void {
const validateFunc = (topic: Topic) => !topic.isCentralTopic();
const validateError = 'Central Topic can not be changed to line figure.';
const validateError = 'Central topic connection style can not be changed for central topic.';
const topicsIds = this.getModel().filterTopicsIds(validateFunc, validateError);
if (topicsIds.length > 0) {
this._actionDispatcher.changeConnectionStyleToTopic(topicsIds, type);

View File

@ -548,10 +548,17 @@ abstract class Topic extends NodeGraph {
}
setConnectionStyle(type: LineType): void {
this.getModel().setConnectionStyle(type);
const model = this.getModel();
model.setConnectionStyle(type);
// Needs to change change all the lines types. Outgoing are part of the children.
this.getChildren().map((topic: Topic) => topic.redraw());
// If chidren nodes does not children, set the connection style too. We don't want to have cascade changes on all the branches.
model
.getChildren()
.filter((c) => c.getChildren().length === 0)
.forEach((c) => c.setConnectionStyle(type));
}
private _setBackgroundColor(color: string, updateModel: boolean) {
@ -1157,7 +1164,6 @@ abstract class Topic extends NodeGraph {
private createConnectionLine(targetTopic: Topic): ConnectionLine {
const type: LineType = targetTopic.getConnectionStyle();
console.log(`redraw ...: ${type}`);
return new ConnectionLine(this, targetTopic, type);
}