onkami
onkami

Reputation: 9421

Add automatic translation to angular-ui-grid headers

I have an angular-ui-grid where currently I assign to row headers already $translated lines. This means that when user changes language, I have to take care of retranslation. E.g.:

// part of columnDefs
Project: { // Shows Project(s)
                field: 'Project',
                displayNameKey: tr.projects, // already translated line
                enableHiding: false, ...
               // ans do on
            },

Can I somehow specify a filter for headers that allow me to translate content automatically, without taking care of retranslation myself?

Additionally, I would like to add same translation filter that acts on data cells of specific column, where I could then store translation keys. (I do not need every column as it will be a waste of resources.)

Upvotes: 0

Views: 1267

Answers (1)

YOU
YOU

Reputation: 123881

Add

headerCellFilter: "translate"

in columnDefs

Upvotes: 3

Related Questions