Internationalization 如何使用resources files.resx在mvcgrid.net中获取已翻译的列标题文本
如何使用resources files.resx获取中的翻译列标题文本?有一个本地化示例: 但我们是通过_Grid.cshtml视图实现的,该视图的配置如下:Internationalization 如何使用resources files.resx在mvcgrid.net中获取已翻译的列标题文本,internationalization,mvcgrid.net,Internationalization,Mvcgrid.net,如何使用resources files.resx获取中的翻译列标题文本?有一个本地化示例: 但我们是通过_Grid.cshtml视图实现的,该视图的配置如下: GridDefaults gridDefaults = new GridDefaults() { RenderingMode = RenderingMode.Controller, ViewPath = "~/Views/MVCGrid/_Grid.cshtml", NoResultsMessage =
GridDefaults gridDefaults = new GridDefaults()
{
RenderingMode = RenderingMode.Controller,
ViewPath = "~/Views/MVCGrid/_Grid.cshtml",
NoResultsMessage = "Sorry, no results were found"
};
在_Grid.cshtml中,关于循环通过列:
<tr>
@foreach (var col in Model.Columns)
{
var thStyleAttr = !String.IsNullOrWhiteSpace(ColumnStyle(col)) ? String.Format(" style='{0}'", ColumnStyle(col)) : "";
<th onclick='@Html.Raw(ColumnOnClick(col))' @(Html.Raw(thStyleAttr))>@DbRes.T(col.HeaderText, "Grids") @(SortImage(col))</th>
}
</tr>
@foreach(模型列中的变量列)
{
var thStyleAttr=!String.IsNullOrWhiteSpace(ColumnStyle(col))?String.Format(“style='{0}',ColumnStyle(col)):”;
@DbRes.T(col.HeaderText,“Grids”)@(SortImage(col))
}
请注意,我们这里没有使用资源,但我们使用的是这个库:但我认为应该是相同的想法。这仍然是一个问题。