import * as cagregorian from "./ca-gregorian.json";
import * as currencies from "./currencies.json";
import * as numbers from "./numbers.json";
import * as timeZoneNames from "./timeZoneNames.json";
loadCldr(cagregorian, currencies, numbers, timeZoneNames); // load json files
setCulture('es'); // Change the Grid culture
setCurrencyCode('EUR'); // Change the currency code
|
<div class="control-section">
<ejs-grid #grid [dataSource]='data' allowPaging='true' [allowResizing]="true" allowFiltering="true">
<e-columns>
<e-column field='OrderID' headerText='Order ID' width='120' textAlign='Right'></e-column>
<e-column field='Freight' headerText='Freight' type='number' width='120' format='C'></e-column>
<e-column field='OrderDate' headerText='OrderDate' width='120' type='date' format='yMd'></e-column>
</e-columns>
</ejs-grid>
</div>
|
|
declare module "*.json" {
const value: any;
export default value;
} |
declare var require: any
import { Component, OnInit } from '@angular/core';
import { data } from './datasource';
import { loadCldr, setCulture, setCurrencyCode, Internationalization, L10n } from '@syncfusion/ej2-base';
L10n.load({
'es': {
'grid': {
'EmptyRecord': 'No hay registros para mostrar', // for loading text translations
'GroupDropArea': 'Arrastre una columna aquí para agrupar',
...
},
'pager': {
'currentPageInfo': '{0} de {1} Page(s)',
...
}
}
});
@Component({
selector: 'app-root',
template: `<ejs-grid [dataSource]='data' [allowGrouping]='true' [allowPaging]='true'>
...
</ejs-grid>`
})
export class AppComponent implements OnInit {
title = 'LocaleSamplenew';
public data: Object[];
ngOnInit(): void {
setCulture('es');
setCurrencyCode('EUR');
loadCldr(require('cldr-data/main/es/currencies.json'), //loading culture files for number formats.
require('cldr-data/main/es/numbers.json'),
require('cldr-data/main/es/ca-gregorian.json'),
require('cldr-data/main/es/timeZoneNames.json'),
require('cldr-data/supplemental/numberingSystems.json'));
this.data = data;
}
}
|
Hi, i'm facing same issue but in tree grid. In grid this solution works but not for the tree grid. Any tips? Thanks
Grid and Tree grid are 19.3.57 version
Hi Fabio,
For TreeGrid related queries, kindly followup the below forum.
Forum: https://www.syncfusion.com/forums/178476/problem-with-internationalization
If you have any queries related to EJ2 Grid, kindly get back to us.
Regards,
Joseph I.