Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jsGrid.locale not working #207

Closed
codingbunny opened this issue Feb 18, 2016 · 3 comments
Closed

jsGrid.locale not working #207

codingbunny opened this issue Feb 18, 2016 · 3 comments
Labels

Comments

@codingbunny
Copy link

Hi Tablinas,

Thank you for adding the i18n function. But I have 2 questions:

  1. When I tried to use the jsGrid.locale following the doc, it not working and giving the error: Uncaught TypeError: Cannot read property 'required' of undefined. I was wondering whether I use it right. Here are the fiddles: http://jsfiddle.net/p39kteqh/27/
    http://jsfiddle.net/p39kteqh/28/
  2. I want to internationalize my header as well, how can I do this? I am wondering if I should use some translate plugins or?

Thank you very much!

@codingbunny codingbunny changed the title locales not working jsGrid.locale not working Feb 18, 2016
@tabalinas tabalinas added the bug label Feb 18, 2016
@tabalinas
Copy link
Owner

The issue is that the new script jsgrid.validation.js was not included in the build.
For temporary fix, you can include it before calling localization function.
The fix will be soon released in v1.4.1.

@codingbunny
Copy link
Author

Thank you for your reply. It works well.
And what should I do if I want my header to support multi-language?

@tabalinas
Copy link
Owner

If you need to localize them just define title of the field in the target language.
If you want to support several languages, define a dictionary with the titles, and pick up the title in the grid config according to the current language, like the following:

var titles = { fr: { col1: 'Oui' }, en: { col1: 'Yes'  } };

$('#jsgrid').jsGrid({
    fields: [{ title: titles[currentLang].col1 }]
}); 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants