数据表更改界面语言 [英] Datatables change interface language
问题描述
我目前正在使用angular-datatables.
I am currently using angular-datatables.
如何查看其他语言的表格界面?
How can I see the interface of the table in other languages?
例如,西班牙语中的意思是显示条目",搜索:",显示20个条目中的1到10个".
I mean the "Show entries", "Search:", "Showing 1 to 10 of 20 entries" literals fore example in Spanish.
推荐答案
您需要定义一个这样的语言结构(丹麦实现,我在angular-datatables应用中使用的语言):
You need to define a language struct like this (danish implementation, what I am using in my angular-datatables apps) :
var language = {
"sEmptyTable": "Ingen tilgængelige data (prøv en anden søgning)",
"sInfo": "Viser _START_ til _END_ af _TOTAL_ rækker",
"sInfoEmpty": "Viser 0 til 0 af 0 rækker",
"sInfoFiltered": "(filtreret ud af _MAX_ rækker ialt)",
"sInfoPostFix": "",
"sInfoThousands": ",",
"sLengthMenu": "Vis _MENU_ rækker",
"sLoadingRecords": "Henter data...",
"sProcessing": "Processing...",
"sSearch": "Filter:",
"sZeroRecords": "Ingen rækker matchede filter",
"oPaginate": {
"sFirst": "Første",
"sLast": "Sidste",
"sNext": "Næste",
"sPrevious": "Forrige"
},
"oAria": {
"sSortAscending": ": activate to sort column ascending",
"sSortDescending": ": activate to sort column descending"
}
}
这里有很多语言-> https://www.datatables .net/plug-ins/i18n/
There is a bunch of languages here -> https://www.datatables.net/plug-ins/i18n/
然后使用withLanguage()
选项方法
.withLanguage(language)
演示-> http://plnkr.co/edit/RCrqM3z7qwsUfFwy8HE6?p=预览
demo -> http://plnkr.co/edit/RCrqM3z7qwsUfFwy8HE6?p=preview
这篇关于数据表更改界面语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!