L10n.load for a single component

Hi,

I have a GridComponent on multiple pages and want different labels depending on the page. To my knowledge when I use L10n.load the labels are used in every component so how can I do what I want to do?


6 Replies 1 reply marked as answer

RS Rajapandiyan Settu Syncfusion Team June 22, 2022 05:34 PM UTC

Hi Ismail, 


Thanks for contacting Syncfusion support.


Before proceeding with your query, kindly share the below details to provide a better solution.


  1. Are you want to change the specific default text in a particular Grid component? What are the default text (different labels) you want to change in the Grid?
  2. Or, Are you want to change whole default texts in that Grid?
  3. Share the complete Grid code you have used.


Regards, 

Rajapandiyan S



IS ismail June 22, 2022 08:15 PM UTC

I found the solution but maybe there's a better solution you can suggest.I want to change the specific default text I have two grid components but I want each one to have different translated labels.

My solution was to call the load function only once in my App.js and update only the content of the parameter to pass to the function depending on the route I'm in.



RS Rajapandiyan Settu Syncfusion Team June 23, 2022 03:16 PM UTC

Hi Ismail, 


kindly share the below details to provide a better solution.


  1. What are the default text (different labels) you want to change in the Grid? Share that specific default text details. (highly recommended)
  2. Are you want to change the default text of Grid’s Toolbar, Filter Dialog, Edit Dialog, Pager, etc.,?
  3. Share the complete Grid code you have used.
  4. Share the screenshot or video demo of your requirement.


Regards, 

Rajapandiyan S



IS ismail June 23, 2022 03:38 PM UTC

I'm trying to change the default text of Grid's pager. One grid should have in the pager "users" instead of "items", the second grid pager should have  "mentors" instead of "items"


Attachment: code_d9822841.zip


RS Rajapandiyan Settu Syncfusion Team June 24, 2022 03:02 PM UTC

Hi Ismail,


Currently, we are validating the attached files to achieve your requirement (I'm trying to change the default text of Grid's pager. One grid should have in the pager "users" instead of "items", the second grid pager should have  "mentors" instead of "items") at our end. We will provide further details on or before June 28th, 2022.


We appreciate your patience until then.


Regards,

Rajapandiyan S



RS Rajapandiyan Settu Syncfusion Team June 28, 2022 01:23 PM UTC

Hi Ismail,


Thanks for your patience.


We have prepared a simple sample with your code example. You can get it from the below link,


Sample: https://stackblitz.com/edit/react-router-starter-ladvgz?file=components%2FAbout.js


If you want to dynamically change the culture in the same Grid, we suggest you to use setCulture method to achieve this.


https://ej2.syncfusion.com/react/documentation/grid/global-local/#internationalization



  function changeCulture(args) {

    culture = culture == 'fr-FR' ? 'en-US' : 'fr-FR';

    setCulture(culture);  // change the culture for all the Syncfusion components

  }

 


Please let us know if you have any concerns.


Regards,

Rajapandiyan S


Marked as answer
Loader.
Up arrow icon