Code Monkey home page Code Monkey logo

ej2-locale's Introduction

ej2-locale

Locale translations for Essential JS 2 components in multiple languages.

Currently supported localization languages

Culture-Code Language
ar-AE Arabic - United Arab Emirates
ar Arabic - Arabia
cs Czech - Czech Republic
da Danish - Denmark
de German - Germany
en-GB English - United Kingdom
en-US English - United States
es Spanish - Spain
fa Farsi - Iran
fi Finnish - Finland
fr French - France
he Hebrew - Israel
hr Croatian - Croatia
hu Hungarian - Hungary
id Indonesian
is Icelandic - Iceland
it Italian - Italy
ja Japanese - Japan
ko Korean - Korea
ms Malay - Malaysia
nb Norwegian (Bokmål) - Norway
ne-NP Nepali - Nepal
nl Dutch - The Netherlands
pl Polish - Poland
pt Portuguese - Portugal
ro Romanian - Romania
ru Russian - Russia
sk Slovak - Slovakia
sv Swedish - Sweden
th Thai - Thailand
tr Turkish - Turkey
vi Vietnamese - Vietnam
zh Chinese - China

How to load locale text for Essential JS 2 components

To load translation object in Essential JS 2 components, you can load locale object in L10.load function from ej.base. For example, In the below code snippet we have loaded the locale file for Arabic culture.

ej.base.setCulture('ar-AE');
var ajax = new ej.base.Ajax('/src/ar-AE.json', 'GET', true);
ajax.onSuccess = function (value) {
        //Assigning locale text value for Essential JS 2 components
        ej.base.L10n.load(value);
    };
ajax.send();

How to load locale globally in typescript

Importing from json files with typescript you first need to enable the resolveJsonModule flag. Either by adding it to your tsconfig.json or directly as argument to the compiler.
It is important to use a plain object! Passing EJ2_LOCALE directly will not work for the L10n.load() method.

import * as EJ2_LOCALE from "../../node_modules/@syncfusion/ej2-locale/src/de.json";
L10n.load({ de: EJ2_LOCALE.de });
setCulture("de");

ej2-locale's People

Contributors

aishwarya-sf3446 avatar ajithr avatar angelinfaithsheeba avatar balajisf3690 avatar deepika5698 avatar gokulrajdevarajan avatar gsumankumar avatar hemanthkumars1998 avatar jagufar avatar jmfarook7 avatar kameshrajendran avatar karavinth avatar manikandan-lakshmanan avatar mohamed7imran avatar mohamedzubairs avatar mydeen-sn avatar mydeensn avatar piramanayagamsyncfusion avatar saranya13 avatar sathishkumarrajendran avatar selva462 avatar selvakumar-3626 avatar sridurgha avatar streetrock avatar suriya-murugan avatar syedsulaimans avatar syncsiva avatar vairamuthur avatar vinoth2562000 avatar vinothyesuraj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ej2-locale's Issues

Polish translations

Translations into Polish are not accurate enough to be used in production.

Set localization globally

Hey,
I have a question, where to put this code in case of ASP.NET Core application? In _Layout.cshtml? I would like to set the localization globally for the entire application.

var L10n = new ej.base.L10(); var setCulture = new ej.base.setCulture(); L10n.load({ var ajax = new ej.base.Ajax('/src/ar-AE.json', 'GET', true); ajax.send() }); setCulture(‘ar-AE’);

Alphabetically Sorting

When comparing between two languages is easier when the Keys and their nodes are alpha sorted, by doing this I was able to determine wich keys were missing in my language file.

Also I think could be useful for some people to have an empty version of the dictionary

problem loading value

Hello,

To make it work I had deserialize the value loaded in ajax :
ajax.onSuccess = function (value) {
ej.base.L10n.load(JSON.parse(value));
};
ajax.send();

Is it normal?

PDF Viewer not fully transated

The PDF Viewer component is not fully translated, e.g. the placeholder of the comment input field is in English but should be in German:

image

It looks like the translation files use two different namespaces for the pdf viewer translations, PdfViewer (which is correct) and pdfviewer (which is wrong). It's not just for German but for other languages as well.

"pdfviewer": {

"PdfViewer": {

Request for tagging release versions

Would it be possible to tag each syncfusion realease to allow better comparison about what changed. Until now I have to look into commit history in oder to find the diffs between each version. It would be far more convinient to have tags in oder to use the compare feature of github.

Pull request pending

Hello,

I have made a pull request for updating french translation (#51).

Please, can you accept my pull request?

Add and Edit button doesnt work

Hi, I'm trying to translate gantt to spanish in Angular.

Translation works fine, but when I click on add and edit button the console show this error:

ERROR TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at DatePicker.getCultureValues (ej2-calendars.es2015.js:272:34)
    at DatePicker.createContentHeader (ej2-calendars.es2015.js:307:51)
    at DatePicker.createContent (ej2-calendars.es2015.js:256:14)
    at DatePicker.createContent (ej2-calendars.es2015.js:2181:15)
    at DatePicker.render (ej2-calendars.es2015.js:124:14)
    at DatePicker.render (ej2-calendars.es2015.js:2038:15)
    at DatePicker.disabledDates (ej2-calendars.es2015.js:4655:15)
    at DatePicker.updateInput (ej2-calendars.es2015.js:3235:18)
    at DatePicker.initialize (ej2-calendars.es2015.js:3172:14)

Here is my code example:


import {L10n, setCulture} from '@syncfusion/ej2-base';
import { Component, OnInit, ViewChild} from '@angular/core';
import { extend } from '@syncfusion/ej2-base';
import { GanttComponent } from '@syncfusion/ej2-angular-gantt';
import { SelectEventArgs, RemoveEventArgs  } from '@syncfusion/ej2-dropdowns';
import { MultiSelectComponent } from '@syncfusion/ej2-angular-dropdowns';
import { ToolbarItem, EditSettingsModel } from '@syncfusion/ej2-angular-gantt';

L10n.load({
  "es": {
      "gantt": {
          "emptyRecord": "No hay registros que mostrar",
          "id": "CARNÉ DE IDENTIDAD",
          "name": "Nombre",
          "startDate": "Fecha de inicio",
          "endDate": "Fecha final",
          "duration": "Duración",
          "progress": "Progreso",
          "dependency": "Dependencia",
          "notes": "Notas",
          "baselineStartDate": "Fecha de inicio de línea de base",
          "baselineEndDate": "Fecha de finalización de línea de base",
          "taskMode": "Modo de Tarea",
          "changeScheduleMode": "Cambiar modo de programación",
          "subTasksStartDate": "Fecha de inicio de subtareas",
          "subTasksEndDate": "Fecha de finalización de subtareas",
          "scheduleStartDate": "Fecha de inicio del horario",
          "scheduleEndDate": "Fecha de finalización del horario",
          "auto": "Auto",
          "manual": "Manual",
          "type": "Tipo",
          "offset": "Compensar",
          "resourceName": "Recursos",
          "resourceID": "ID de recurso",
          "day": "día",
          "hour": "hora",
          "minute": "minuto",
          "days": "dias",
          "hours": "horas",
          "minutes": "minutos",
          "generalTab": "General",
          "customTab": "Columnas personalizadas",
          "writeNotes": "Escribe notas",
          "addDialogTitle": "Nueva tarea",
          "editDialogTitle": "Información de tarea",
          "saveButton": "Salvar",
          "add": "Añadir",
          "edit": "Editar",
          "update": "Actualizar",
          "delete": "Eliminar",
          "cancel": "Cancelar",
          "search": "Buscar",
          "task": " tarea",
          "tasks": " Tareas",
          "zoomIn": "Acercarse",
          "zoomOut": "Disminuir el zoom",
          "zoomToFit": "Zoom para ajustar",
          "excelExport": "Exportación Excel",
          "csvExport": "Exportación CSV",
          "expandAll": "Expandir todo",
          "collapseAll": "Desplegar todo",
          "nextTimeSpan": "Próximo intervalo de tiempo",
          "prevTimeSpan": "Periodo de tiempo anterior",
          "okText": "Okay",
          "confirmDelete": "¿Estás seguro de que deseas eliminar el registro?",
          "from": "Desde",
          "to": "A",
          "taskLink": "Enlace de tareas",
          "lag": "Retraso",
          "start": "comienzo",
          "finish": "Terminar",
          "enterValue": "Ingrese el valor",
          "taskBeforePredecessor_FS": "Movió '{0}' para comenzar antes de que '{1}' finalice y las dos tareas estén vinculadas. Como resultado, los enlaces no pueden ser respetados. Seleccione una acción a continuación para realizar",
          "taskAfterPredecessor_FS": "Se movió '{0}' lejos de '{1}' y las dos tareas están vinculadas. Como resultado, los enlaces no pueden ser respetados. Seleccione una acción a continuación para realizar",
          "taskBeforePredecessor_SS": "Movió '{0}' para comenzar antes de que comience '{1}' y las dos tareas estén vinculadas. Como resultado, los enlaces no pueden ser respetados. Seleccione una acción a continuación para realizar",
          "taskAfterPredecessor_SS": "Movió '{0}' para comenzar después de que '{1}' comience y las dos tareas estén vinculadas. Como resultado, los enlaces no pueden ser respetados. Seleccione una acción a continuación para realizar",
          "taskBeforePredecessor_FF": "Movió '{0}' para finalizar antes de que '{1}' finalice y las dos tareas estén vinculadas. Como resultado, los enlaces no pueden ser respetados. Seleccione una acción a continuación para realizar",
          "taskAfterPredecessor_FF": "Movió '{0}' para finalizar después de que '{1}' finalice y las dos tareas estén vinculadas. Como resultado, los enlaces no pueden ser respetados. Seleccione una acción a continuación para realizar",
          "taskBeforePredecessor_SF": "Se movió '{0}' lejos de '{1}' para comenzar y las dos tareas están vinculadas. Como resultado, los enlaces no pueden ser respetados. Seleccione una acción a continuación para realizar",
          "taskAfterPredecessor_SF": "Movió '{0}' para finalizar después de que '{1}' comience y las dos tareas estén vinculadas. Como resultado, los enlaces no pueden ser respetados. Seleccione una acción a continuación para realizar",
          "taskInformation": "Información de tarea",
          "deleteTask": "Eliminar tarea",
          "deleteDependency": "Eliminar dependencia",
          "convert": "Convertir",
          "save": "Salvar",
          "above": "Encima",
          "below": "Abajo",
          "child": "Niño",
          "milestone": "Hito",
          "toTask": "A la tarea",
          "toMilestone": "Al hito",
          "eventMarkers": "Marcadores de eventos",
          "leftTaskLabel": "Etiqueta de tarea izquierda",
          "rightTaskLabel": "Etiqueta de tarea correcta",
          "timelineCell": "Celda de línea de tiempo",
          "confirmPredecessorDelete": "¿Seguro que quieres eliminar el enlace de dependencia?",
          "unit": "Unidad",
          "work": "Trabajo",
          "taskType": "Tipo de tarea",
          "unassignedTask": "Tarea no asignada",
          "group": "Grupo",
          "indent": "Sangrar",
          "outdent": "Outdent",
          "segments": "Segmentos",
          "splitTask": "Tarea dividida",
          "mergeTask": "Combinar tarea",
          "left": "Izquierda",
          "right": "Correcto"
      },
  }
});


@Component({
  selector: 'app-pt-tareas-gantt',
  templateUrl: './pt-tareas-gantt.component.html',
  styleUrls: ['./pt-tareas-gantt.component.css']
})
export class PtTareasGanttComponent implements OnInit {

// Data for Gantt
public data: object[];
public taskSettings: object;
public timelineSettings: object;
public editSettings: EditSettingsModel;
public toolbar: ToolbarItem[];
public columns: object[];
public labelSettings: object;
public resources: object[];
public resourceFields: object;

public workWeek: string[];
public dropDownData: Object;
public dropDownFields: Object;
public mode: string;
 workingDays:any = [];
@ViewChild('ganttObj')
public ganttObj: GanttComponent;
@ViewChild('WorkingDaysObj')
public WorkingDaysObj: MultiSelectComponent;
  constructor() { }

  ngOnInit(): void {

    this.mode = 'CheckBox';
    this.dropDownFields = { text: 'day', value: 'id'};
    this.dropDownData= [   { id: 'Sunday', day: 'Sunday'},
    { id: 'Monday', day: 'Monday' },
    { id: 'Tuesday', day: 'Tuesday' },
    { id: 'Wednesday', day: 'Wednesday' },
    { id: 'Thursday', day: 'Thursday' },
    { id: 'Friday', day: 'Friday' },
    { id: 'Saturday', day: 'Saturday' }];
    this.workWeek = ['Monday','Tuesday','Wednesday','Thursday','Friday'];


    this.data =  [
      {
          TaskID: 1,
          TaskName: 'Project Initiation',
          StartDate: new Date('04/02/2019'),
          EndDate: new Date('04/21/2019'),
          subtasks: [
              {  TaskID: 2, TaskName: 'Identify Site location', StartDate: new Date('04/02/2019'), Duration: 4, Progress: 50, resources: [1] },
              { TaskID: 3, TaskName: 'Perform Soil test', StartDate: new Date('04/02/2019'), Duration: 4, Progress: 50,  resources: [2, 3, 5]  },
              { TaskID: 4, TaskName: 'Soil test approval', StartDate: new Date('04/02/2019'), Duration: 4, Progress: 50 },
          ]
      },
      {
        TaskID: 1,
        TaskName: 'Project Initiation',
        StartDate: new Date('04/02/2019'),
        EndDate: new Date('04/21/2019'),
        subtasks: [
            {  TaskID: 2, TaskName: 'Identify Site location', StartDate: new Date('04/02/2019'), Duration: 4, Progress: 50, resources: [1] },
            { TaskID: 3, TaskName: 'Perform Soil test', StartDate: new Date('04/02/2019'), Duration: 4, Progress: 50,  resources: [2, 3, 5]  },
            { TaskID: 4, TaskName: 'Soil test approval', StartDate: new Date('04/02/2019'), Duration: 4, Progress: 50 },
        ]
      },
      {
        TaskID: 1,
        TaskName: 'Project Initiation',
        StartDate: new Date('04/02/2019'),
        EndDate: new Date('04/21/2019'),
        subtasks: [
            {  TaskID: 2, TaskName: 'Identify Site location', StartDate: new Date('04/02/2019'), Duration: 4, Progress: 50, resources: [1] },
            { TaskID: 3, TaskName: 'Perform Soil test', StartDate: new Date('04/02/2019'), Duration: 4, Progress: 50,  resources: [2, 3, 5]  },
            { TaskID: 4, TaskName: 'Soil test approval', StartDate: new Date('04/02/2019'), Duration: 4, Progress: 50 },
        ]
      },
      {
        TaskID: 1,
        TaskName: 'Project Initiation',
        StartDate: new Date('04/02/2019'),
        EndDate: new Date('04/21/2019'),
        subtasks: [
            {  TaskID: 2, TaskName: 'Identify Site location', StartDate: new Date('04/02/2019'), Duration: 4, Progress: 50, resources: [1] },
            { TaskID: 3, TaskName: 'Perform Soil test', StartDate: new Date('04/02/2019'), Duration: 4, Progress: 50,  resources: [2, 3, 5]  },
            { TaskID: 4, TaskName: 'Soil test approval', StartDate: new Date('04/02/2019'), Duration: 4, Progress: 50 },
        ]
      },
      {
        TaskID: 1,
        TaskName: 'Project Initiation',
        StartDate: new Date('04/02/2019'),
        EndDate: new Date('04/21/2019'),
        subtasks: [
            {  TaskID: 2, TaskName: 'Identify Site location', StartDate: new Date('04/02/2019'), Duration: 4, Progress: 50, resources: [1] },
            { TaskID: 3, TaskName: 'Perform Soil test', StartDate: new Date('04/02/2019'), Duration: 4, Progress: 50,  resources: [2, 3, 5]  },
            { TaskID: 4, TaskName: 'Soil test approval', StartDate: new Date('04/02/2019'), Duration: 4, Progress: 50 },
        ]
      },
      {
          TaskID: 5,
          TaskName: 'Project Estimation',
          StartDate: new Date('04/02/2019'),
          EndDate: new Date('04/21/2019'),
          subtasks: [
              { TaskID: 6, TaskName: 'Develop floor plan for estimation', StartDate: new Date('04/04/2019'), Duration: 3, Progress: 50 },
              { TaskID: 7, TaskName: 'List materials', StartDate: new Date('04/04/2019'), Duration: 3, Progress: 50 },
              { TaskID: 8, TaskName: 'Estimation approval', StartDate: new Date('04/04/2019'), Duration: 3, Progress: 50 }
          ]
      },
  ];

  this.taskSettings = {
      id: 'TaskID',
      name: 'TaskName',
      startDate: 'StartDate',
      endDate: 'EndDate',
      duration: 'Duration',
      progress: 'Progress',
      dependency: 'Predecessor',
      resourceInfo: 'resources',
      child: 'subtasks',
  };
  
  this.timelineSettings = {
    topTier: {
        format: 'MMM dd, yyyy',
        unit: 'Week',
    },
    bottomTier: {
        unit: 'Day',
    },
  };

  this.columns = [
    { field: 'TaskID',  headerText: 'ID', width: 80 },
    { field: 'TaskName', headerText: 'Actividad', width: '250', clipMode: 'EllipsisWithTooltip' },
    { field: 'StartDate', headerText: 'Fecha Inicio' },
    { field: 'Duration', headerText: 'Duración' },
    { field: 'EndDate', headerText: 'Fecha Compromiso' },
    { field: 'resources', headerText: 'Responsables' }
  ];

  this.labelSettings = {
    rightLabel: 'resources',
    taskLabel: '${Progress}%'
  };

  this.editSettings = {
    allowAdding: true,
    allowEditing: true,
    allowDeleting: true,
    allowTaskbarEditing: true,
    showDeleteConfirmDialog: true
  };

  this.toolbar = ['Add', 'Edit', 'Update', 'Delete', 'Cancel', 'ExpandAll', 'CollapseAll', 'Search',];

  this.resources = [
      { resourceId: 1, resourceName: 'Abigail Salazar' },
      { resourceId: 2, resourceName: 'Rose Fuller' },
      { resourceId: 3, resourceName: 'Margaret Buchanan' },
      { resourceId: 4, resourceName: 'Fuller King' },
      { resourceId: 5, resourceName: 'Davolio Fuller' },
      { resourceId: 6, resourceName: 'Van Jack' },
      { resourceId: 7, resourceName: 'Fuller Buchanan' },
      { resourceId: 8, resourceName: 'Jack Davolio' },
      { resourceId: 9, resourceName: 'Tamer Vinet' },
      { resourceId: 10, resourceName: 'Vinet Fuller' },
      { resourceId: 11, resourceName: 'Bergs Anton' },
      { resourceId: 12, resourceName: 'Construction Supervisor' }
    ];
    
    this.resourceFields = {
      id: 'resourceId',
      name: 'resourceName'
    };

    setCulture('es');
}


  select (args: SelectEventArgs) : void {
    this.workingDays = 7;
    this.workingDays = extend([], this.WorkingDaysObj.value, [], true);
    this.workingDays.push(args.item.innerText);
    this.ganttObj.workWeek = this.workingDays;      
  }
  remove (args: RemoveEventArgs) : void {
    var index = this.ganttObj.workWeek.indexOf(args.item.innerText);
      this.workingDays = 7;
      if (index !== -1) {
          this.workingDays = this.WorkingDaysObj.value;
          this.ganttObj.workWeek = this.workingDays;
      }     
  }   
}

image

image

Without translation
image

Could you help me, please.
Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.