简体   繁体   中英

How to change FilterRow language in devextreme-react/data-grid

How can i change devextreme FilterRow ui language. For examle: I want to change "Starts with" text to "New starts with" text.

在此处输入图像描述

I wonder if overriding the operationDescriptions config accomplishes what you're trying to achieve?

Check out the docs: https://js.devexpress.com/Documentation/ApiReference/UI_Components/dxDataGrid/Configuration/filterRow/operationDescriptions/

<DataGrid ... >
            <FilterRow ... >
                <OperationDescriptions
                    startsWith="New starts with"
                />
            </FilterRow>
</DataGrid>

For changing the ui language for all DevExtreme components, check out the localization part of the offical documentation.

Here is an example on how to load a specific language:

// ...
// Dictionaries for German language
import deMessages from "devextreme/localization/messages/de.json";
import { locale, loadMessages } from "devextreme/localization";
  
// ===== React ======
class App extends React.Component {
    constructor(props) {
        super(props);
        loadMessages(deMessages);
        locale(navigator.language);
    }
}

Here is a list of all available languages on GitHub .

If you only want to change a specific operation text inside the data grid component, Cătălin Andrei Preda's answer is the correct one.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM