Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 reactjs 应用程序,我在其中使用react-table。表格按钮的文本(“Next”、“Page x of y”等)是英文的,我没有看到任何本地化选项。有这方面的API吗?或者我应该挂钩元素并自己实现它?
在文档中,您可以找到可以自定义的字符串列表,并且您可以创建自定义翻译的对象:
const translations = {previousText: 'PREV', nextText: 'NEXT', loadingText: 'LOADING...'};
接下来,只需将此对象传递给您的 React Table jsx:
<ReactTable {...translations} />