Requirements: jQuery Datatables is a very good front-end table plug-in, through which the back-end API interface is configured, the interface returns JSON data, and the plug-in helps us automatically render tables with content, and the plug-in also supports server-side sorting, pagination, search and other functions. Localization is important for any package, how can I use the plugin to achieve internationalization?
Address:The hyperlink login is visible.
Note: The official website has 90 Chinese language packs, but some translations are not complete, as shown in the figure below:
jQuery Datatables can support loading language information from remote files by configuring language.url, seeing:The hyperlink login is visible.
Of course, we can also directly configure the language information through variables, referring:The hyperlink login is visible.
I willSimplified Chinese, English, Hindi, German, Russian, JapanesePackaged into a JS file as follows:
datatables-i18n.js
(33.24 KB, Number of downloads: 1, 售价: 3 粒MB)
Let's switch the language display separately, the rendering is as follows:
The js code is as follows:
PassConfigure the value of languageto achieve international functions.
(End)
|