jqGrid Internationalization

2019-01-18 17:18发布

I use jqGrid grid table plugin for my HTML files. How can I internationalize my table's column, header etc? I mean I will load a property file or change a variable, my table template will be in that language?

3条回答
走好不送
2楼-- · 2019-01-18 17:27

If you're using version 4.8 and above, regional parameter can be set in grid control.

E.g $("#jqGrid").jqGrid({ ... regional : 'cn', ... });

查看更多
再贱就再见
3楼-- · 2019-01-18 17:28

I wrote my suggestion how one can implement the jqGrid internationalization in the post. See the demo for example. You can make yourself the changes which I suggestion. One needs only to modify the "i18n/grid.locale-XX.js" files without changing of the main jqGrid code.

So you will be able to implement pages which supports many languages, the default language will be choosed based on the language of the web browser. Moreover you can allow the user to change the jqGrid language dynamically from

enter image description here

to

enter image description here

for example.

P.S. Another old suggestion to use jQuery Globalization plugin could be also interesting for you.

查看更多
Juvenile、少年°
4楼-- · 2019-01-18 17:44

Simply replace:

<script src="js/lib/grid.locale-en.js"></script>

with a language of your choice, like:

<script src="js/lib/grid.locale-pl.js"></script>

Standard (English) locale, Redmond theme:

English, Redmond

Polish locale, Le Frog jQuery UI theme:

Polish, Le Frog

Source

查看更多
登录 后发表回答