Component Sample
Last updated
Last updated
Class sample
You need to add a translation key via the property nameKey
to each column definition, for example: nameKey: 'TITLE'
Translation Files
If you want to manually re-create the translation in your own files, the list of translations that you will need are displayed in the translation folder (from that file, you need all translations shown before the translation 'BILLING', the next few ones are for the demo page only). If you need more information on how to import translations, please review the other page.
Note
For the Select
Filter, you will use labelKey
instead of label
. Anytime a translation key will come in play, we will add the word key
to the end (hence nameKey
, labelKey
, more to come...)
Custom Formatter (cell values)
You can define your own custom Formatter by providing the i18n
Service into the Formatter and using the .tr()
function to translate the cell value.
Filtering with Translated cell value (translateFormatter
)
Using Angular-Slickgrid Formatters.Translate
Instead of defining a custom formatter over and over, you could also use the built-in Angular-Slickgrid Formatters.translate
. However for the formatter to work, you need to provide the ngx-translate
Service instance, to the Grid Options property i18n
, as shown below.
Since the cell value is to be translated, the regular filtering might behave differently than excepted (it will filter against a translation key instead of filtering against the formatted output which is what we want). If you want to filter against the formatted output (translateFormatter
or even a custom formatter), you need to fill in the i18n
property in the Grid Options and set useFormatterOuputToFilter
to True, for more info please see