Core Features

Advanced Features

Vue Data GridLocalisation

Version 36.3.0

The grid's displayed text can be customised for localisation. You can achieve this by providing locale information in the required language. Use the localeText property to apply one of the provided locales, create a custom locale, or use the getLocaleText callback to integrate the grid with your application's localisation system.

localeTextCopy Link
LocaleText
A map of key->value pairs for localising text within the grid.
getLocaleTextCopy Link
GetLocaleText
A callback for localising text within the grid.

Provided Locales Copy Link

The default language of the grid is American English, however, we provide a number of translations that can be used as a starting point for commonly requested languages:

LanguageBCP47 TagLocale Module
Arabic (Egyptian)ar-EGAG_GRID_LOCALE_AR_EG
Bengali (Bangladesh)bn-BDAG_GRID_LOCALE_BN_BD
Bengali (India)bn-INAG_GRID_LOCALE_BN_IN
Bosnianbs-BAAG_GRID_LOCALE_BS_BA
Bulgarianbg-BGAG_GRID_LOCALE_BG_BG
Chinese (Traditional)zh-HKAG_GRID_LOCALE_ZH_HK
Chinese (Simplified)zh-CNAG_GRID_LOCALE_ZH_CN
Chinese (Taiwan)zh-TWAG_GRID_LOCALE_ZH_TW
Croatianhr-HRAG_GRID_LOCALE_HR_HR
Czechcs-CZAG_GRID_LOCALE_CS_CZ
Danishda-DKAG_GRID_LOCALE_DA_DK
Dutchnl-NLAG_GRID_LOCALE_NL_NL
Estonianet-EEAG_GRID_LOCALE_ET_EE
Filipinofil-PHAG_GRID_LOCALE_FIL_PH
Finnishfi-FIAG_GRID_LOCALE_FI_FI
Frenchfr-FRAG_GRID_LOCALE_FR_FR
Germande-DEAG_GRID_LOCALE_DE_DE
Greekel-GRAG_GRID_LOCALE_EL_GR
Hebrewhe-ILAG_GRID_LOCALE_HE_IL
Hindihi-INAG_GRID_LOCALE_HI_IN
Hungarianhu-HUAG_GRID_LOCALE_HU_HU
Indonesianid-IDAG_GRID_LOCALE_ID_ID
Italianit-ITAG_GRID_LOCALE_IT_IT
Japaneseja-JPAG_GRID_LOCALE_JA_JP
Koreanko-KRAG_GRID_LOCALE_KO_KR
Latvianlv-LVAG_GRID_LOCALE_LV_LV
Lithuanianlt-LTAG_GRID_LOCALE_LT_LT
Malayms-MYAG_GRID_LOCALE_MS_MY
Norwegian (Bokmål)nb-NOAG_GRID_LOCALE_NB_NO
Persianfa-IRAG_GRID_LOCALE_FA_IR
Polishpl-PLAG_GRID_LOCALE_PL_PL
Portuguesept-PTAG_GRID_LOCALE_PT_PT
Portuguese (Brazil)pt-BRAG_GRID_LOCALE_PT_BR
Romanianro-ROAG_GRID_LOCALE_RO_RO
Russianru-RUAG_GRID_LOCALE_RU_RU
Serbian (Cyrillic)sr-RSAG_GRID_LOCALE_SR_RS
Serbian (Latin)sr-Latn-RSAG_GRID_LOCALE_SR_LATN_RS
Slovaksk-SKAG_GRID_LOCALE_SK_SK
Sloveniansl-SIAG_GRID_LOCALE_SL_SI
Spanishes-ESAG_GRID_LOCALE_ES_ES
Swedishsv-SEAG_GRID_LOCALE_SV_SE
Thaith-THAG_GRID_LOCALE_TH_TH
Turkishtr-TRAG_GRID_LOCALE_TR_TR
Ukrainianuk-UAAG_GRID_LOCALE_UK_UA
Urdu (Pakistan)ur-PKAG_GRID_LOCALE_UR_PK
Vietnamesevi-VNAG_GRID_LOCALE_VI_VN

Translations are provided as an illustration only and are not guaranteed to be accurate or error free. They are designed to show developers where to store their chosen phrase or spelling variant in the target language.

Each locale module is named after its full BCP47 tag, e.g. AG_GRID_LOCALE_DA_DK for da-DK. Locales that shipped before v36.3 are also still exported under their older region-only name, e.g. AG_GRID_LOCALE_DK. Those older names are deprecated and will be removed in a future major version — prefer the full-tag name.

Using a Provided Locale Module Copy Link

All of the provided locales listed above are available in the @ag-grid-community/locale package. To use any of the provided locales in your application, follow these steps:

First, import the desired locale module from the @ag-grid-community/locale package. For example, to use the German locale, import AG_GRID_LOCALE_DE_DE:

import { AG_GRID_LOCALE_DE_DE } from '@ag-grid-community/locale';

Next, assign the imported locale object to the localeText property in your Grid Options:

<ag-grid-vue
    :localeText="localeText"
    /* other grid options ... */>
</ag-grid-vue>

this.localeText = AG_GRID_LOCALE_DE_DE;

Finally, ensure the @ag-grid-community/locale module is listed as a dependency in your application's package configuration:

"dependencies": {
    "@ag-grid-community/locale": "36.3.0-beta.20261103.1437",
    ...
}

The following example demonstrates applying the AG_GRID_LOCALE_DE_DE locale to the grid:

Some localisation variables have ${variable} in them. When this occurs, it means that part of the string will be replaced by a variable value.

Customising a Provided Locale Copy Link

If you want to customise a provided locale, you can do so by creating a new object and merging the provided locale with your customisations.

import { AG_GRID_LOCALE_DE_DE } from '@ag-grid-community/locale';

const customGermanLocale = {
    ...AG_GRID_LOCALE_DE_DE,
    // customise the locale here
};

const gridOptions = {
    localeText: customGermanLocale,
};

The example below shows this in action by adding a "zzz" prefix to each Locale key to create a new zzzLocale object, and then applying this customised locale to the grid:

Changing Locale Copy Link

The grid uses the locale as it is needed. It does not refresh as the locale changes. If your application allows changing the locale for the application, you must destroy and recreate the grid for it to use the new locale.

Creating a Locale Copy Link

By default, the grid does not require a locale. If no locale is provided, the grid will default to English. If a locale is provided but is missing values, the default English will be used for the missing values.

All locales provided are listed above, and are also available in the @ag-grid-community/locale package.

To support other languages, the first step is to import the @ag-grid-community/locale package and reference the locale you're interested in.

There is a single locale file which covers all modules across all of AG Grid Enterprise and AG Grid Community. This was done on purpose as having a separate localisation file for each module would be harder to manage.

Locale Callback Copy Link

Providing a locale for the grid does not fit in with localisation libraries or localisation for a broader application. If you want the grid to take from an application wide locale, then implement the getLocaleText to act as a bridge between the grid and the applications localisation.

The example below shows providing a callback for the grid's localisation. The example for simplicity just returns the default value in upper case. In a real world application, the callback would use the applications localisation.

In a real world application, the callback would look something like this:

const getLocaleText = (params) => {
    // to avoid key clash with external keys, we add 'grid' to the start of each key.
    const gridKey = 'grid.' + params.key;

    // look the value up using an application wide service
    return applicationLocaleService(gridKey);
}