DataTables 设置界面语言

Datatable version: 1.10.12

先创建配置对象:

app.config.datatable = {}
app.config.datatable.language = {
    EN: {
        emptyTable: "No data available in table",
        info: "",
        infoEmpty: "",
        infoFiltered: "",
        lengthMenu: "Show _MENU_ entries",
        loadingRecords: "Loading...",
        processing: "Processing...",
        zeroRecords: "No matching records found",
        paginate: {
            "first": "First",
            "last": "Last",
            "next": "Next",
            "previous": "Previous"
        },
    },
    TC: {
        emptyTable: "表中沒有可用的數據",
        info: '',
        infoEmpty: '',
        infoFiltered: "",
        lengthMenu: "顯示 _MENU_ 條",
        loadingRecords: "加載中...",
        processing: "正在處理...",
        zeroRecords: "沒有找到匹配的記錄",
        paginate: {
            next: "下一頁",
            previous: "上一頁"
        },
    },
    SC: {
        emptyTable: "表中没有可用的数据",
        info: '',
        infoEmpty: '',
        infoFiltered: "",
        lengthMenu: "显示 _MENU_ 条",
        loadingRecords: "加载中...",
        processing: "正在处理...",
        zeroRecords: "没有找到匹配的记录",
        paginate: {
            next: "下一页",
            previous: "上一页"
        },
    }
}

然后在初始化DataTable的时候选择语言:

var language = 'EN';//这里可以通过其他code来动态改变
$('#usertable').DataTable({
        "data": result.Data.AccountList,
        "serverSide": false,
        "language": app.config.datatable.language[language],
        "columns": [
            { title: "English Name", data: "EName" },
            { title: "Email", data: "Email" },
            { title: "Phone", data: "Phone" },
        ]
    });

测试测试

测试测定啊师傅啊

阿三地方asdfsadf asdfasdff

fsfaas地方

 

using (AppLogDAO dao = new AppLogDAO())
{
var q = dao.getAllAppLog().Where(table => table.CDate.Year == year && printMonthArray.Contains(table.CDate.Month));
appLogList = q.ToList();
}

 

这里写你的代码
这里写你的代码
这里写你的代码

var q = from t in db.Table.Where(table=>table).ToList();

int i=0;