Localization
28 Jun 2017 / 2 minutes to read
- Localization is the process of providing controls in different cultures to help you set your own culture easily. Diagram provides localization support for Context Menu items.
- The Diagram model’s
locale
property is used to define the culture code.
The following code illustrates how to provide localization support for Context Menu items.
<div ng-controller="diagramCtrl">
<div>
<ej-diagram id="DiagramContent" e-width="100%" e-height="700px" e-nodes="nodes" e-locale="locale">
</ej-diagram>
</div>
</div>
// Defines the context menu items with spanish language
ej.datavisualization.Diagram.Locale["es-ES"] = {
cut: "Corte",
copy: "Copia",
paste: "Pasta",
undo: "Deshacer",
redo: "Rehacer",
selectAll: "Seleccionar todo",
grouping: "Agrupación",
group: "Grupo",
ungroup: "Desagrupar",
order: "Fin",
bringToFront: "Traer a delante",
moveForward: "Movimiento adelante",
sendToBack: "Enviar a espalda",
sendBackward: "Enviar hacia atrás"
};
var nodes = [{
name: "rectangle1",
offsetY: 100,
labels: [{
"text": "Rectangle1"
}]
}];
//Initializes the Diagram.
syncApp.controller('diagramCtrl', function($scope) {
$scope.nodes = nodes;
$scope.locale = "es-ES";
$scope.localeText = ["es-ES"];
});
NOTE
You have to define the textual descriptions of the context menu items for your custom cultures.
Was this page helpful?
Yes
No
Thank you for your feedback!
Thank you for your feedback and comments. We will rectify this as soon as possible!
An unknown error has occurred. Please try again.
Help us improve this page