We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Grid Globalizaiton not working on production build

I'm trying to change the default text content of the Grid to Spanish. Everything works well on development `ng serve` but when I try to compile for production `ng build --prod` I get the following errors:

users.component.html(7,5): Property 'es' does not exist on type 'UsersComponent'.
users.component.html(7,5): Property 'GT' does not exist on type 'UsersComponent'.

My html:
<ejs-grid #users [dataSource]='dataSource'
[allowPaging]='true'
[allowFiltering]='true'
[editSettings]="editSettings"
[toolbar]="toolbar"
[locale]='es-GT'
(actionBegin)="actionBegin($event)"
(actionComplete)="actionComplete($event)"
>

and my ts:
import { L10n, setCulture } from '@syncfusion/ej2-base';

setCulture('es-GT');

L10n.load({
'es-GT': {
grid: {
EmptyRecord: 'Sin registros por mostrar',
Item: 'Registro',
Items: 'Registros',
Edit: 'Editar',
Add: 'Agregar',
Delete: 'Borrar',
EditOperationAlert: 'Debe seleccionar un registro primero',
DeleteOperationAlert: 'Debe seleccionar un registro primero',
SaveButton: 'Grabar',
CancelButton: 'Cancelar',
ConfirmDelete: 'Seguro que desea borrar el registro?'
},
pager: {
currentPageInfo: '{0} de {1} paginas',
totalItemsInfo: '({0} registros)',
firstPageTooltip: 'Ir a la primera pagina',
lastPageTooltip: 'Ir a la ultima pagina',
nextPageTooltip: 'Ir a la siguiente pagina',
previousPageTooltip: 'Ir a la pagina anterior',
}
}
});

@Component({
selector: 'app-users',
templateUrl: './users.component.html',
styleUrls: ['./users.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class UsersComponent implements OnInit {

Thanks for the help

1 Reply

PS Pavithra Subramaniyam Syncfusion Team September 25, 2019 12:16 PM UTC

Hi Adrian, 

Greetings from Syncfusion support. 

You can overcome the reported issue by correcting the locale property binding. Please refer the below code blocks 

[app.component.html

<ejs-grid #grid [dataSource]='data' [editSettings]='editSettings'  locale='es-GT'  [allowPaging]='true'> 

. . . . . . . . 

</ejs-grid>  
  
If you still have the problem, kindly get back to us with more details like Syncfusion package version. 

Regards, 
Pavithra S. 


Loader.
Live Chat Icon For mobile
Up arrow icon