angular - 我应该如何使用 transloco i18n(internationalization) 库更改 Material Table 标题以进行分页和页面范围、下一个、上一个按钮?
问题描述
想要使用 i18n 显示标题 上面是显示标题“每页项目”的图像
解决方案
您需要使用MatPaginatorIntl接口并对其进行扩展。这是塞尔维亚标签的示例
export function getSerbianPaginatorIntl() {
const paginatorIntl = new MatPaginatorIntl();
paginatorIntl.itemsPerPageLabel = 'Stavki po strani:';
paginatorIntl.nextPageLabel = 'Sledeca strana';
paginatorIntl.previousPageLabel = 'Prethodna strana';
paginatorIntl.getRangeLabel = serbianRangeLabel;
return paginatorIntl;
}
此处的完整示例https://stackblitz.com/edit/angular-5mgfxh-cwgmym?file=app%2Fdutch-paginator-intl.ts
推荐阅读
- python - Tkinter:我不明白网格是如何工作的(试图创建同样大小的列)
- reporting-services - SSRS 图表轴标签问题
- android - React Native 编译发布 apk 错误程序类型已存在:com.facebook.react.modules.intent.IntentModule
- data-processing - 在 Knime 中,如何拆分一个单元格中具有多行值的行,复制其余单元格?
- c - 进程内存检查
- html - 使用另一个“多值”属性 XML/XSL 从节点获取属性
- python - 如何将文本添加到 python 列表中的每个其他项目?
- symfony - Symfony Messenger / RabbitMQ 中的消费者错误处理
- filter - 根据计数和存储值的组合计算百分比 - Power BI
- multithreading - 如何构建在球拍 lisp 引擎中使用的程序?