Change text

I want to change these to my language. Can you help me?


3 Replies 1 reply marked as answer

TS Thiyagu Subramani Syncfusion Team May 21, 2021 05:22 AM UTC

Hi Toan, 
  
Thanks for contacting Syncfusion support. 
  
By default, in EJ2 grid when you apply the localization the content will be changed based on the values applied to the default translation properties. You can change this translation text as per your needs using L10n and we have already explained related this in below documentation link. Please refer it.  
  
  
Here we have changed toolbar and alert massages. Likewise you can change its text values as per your languages. 
  
L10n.load({ 
    'en-US': { 
        grid: { 
            "Add": "AddRow", 
            "Edit": "EditRow", 
            "Cancel": "CancelChanges", 
            "Update": "UpdateRow", 
            "Delete": "DeleteRow", 
            "Print": "Print", 
. . . . . . . .  
            "EditOperationAlert": "No records selected to perform edit operation", 
            "DeleteOperationAlert": "No records selected to perform Delete operation", 
. . . . . . . . 
        }, 
        pager: { 
. . . . . . . . . .  
        } 
    } 
}); 
  
  
List of locale texts for different cultures which can be loaded for the EJ2 controls can be checked in the below link, 
  
  
Screenshots:  
  
 
  
 
  
 
  
  
We can also change current locale translation text using below code. 
  
load(){ 
      (this.gridInstance.localeObj as any).currentLocale.Add = "Add user"     // change text as per your needs 
    } 
  
Please get back to us, if you need any further assistance. 
  
Regards, 
Thiyagu S. 



TB Toan Bui May 21, 2021 10:58 AM UTC

I tried L10n with datagrid but it doesn't work. It only works with treegrid. Do you have any other way to help me?


TS Thiyagu Subramani Syncfusion Team May 24, 2021 06:13 AM UTC

Hi Toan, 
  
Thanks for your update. 
  
We have prepared sample in Grid with “vi” culture using L10n but in our sample the localization is properly applied to the Grid.  
  
Please refer to the below code and sample link for more reference. 
  
import { L10n, setCulture } from '@syncfusion/ej2-base'; 
import { orderDetails } from './data'; 
setCulture('vi'); 
L10n.load({ 
    'vi': { 
        "grid": { 
             "Add": "Thêm vào", 
            "Edit": "Biên tập", 
            "Cancel": "Hủy bỏ", 
            "Update": "Cập nhật", 
            "Delete": "Xóa bỏ", 
            "EditOperationAlert": "Không có bản ghi nào được chọn cho thao tác chỉnh sửa", 
            "DeleteOperationAlert": "Không có hồ sơ được chọn cho hoạt động xóa", 
             . . . . . . . . . .  
        }, 
    } 
}); 
  
Screenshot:  
  
 
  
 
  
  
If still facing the issue, please share below details which will help us to provide the solution as soon as possible 
  
1. If possible, share the issue reproducing sample to us or reproduce the issue in above sample 
  
2. Video demonstration of your issue. 
  
Please get back to us, if you need any further assistance. 
  
Regards, 
Thiyagu S 


Marked as answer
Loader.
Up arrow icon