Hi,

I am using an exposed filter to select rows that are of a type only. I have translated the node type names, using the Translation Interface, and I can see these translations working elsewhere.

Though, the content type names in the exposed filter are not translated.

Comments

jmix’s picture

different issue but it can be related: content-type names are only translated in the admin pages, impossible to print it in a view or a node...

bart.hanssens’s picture

Seems to work (using latest git version + views 3.x-dev + i18n 1.x-dev + variable 2.x-dev)

Frando’s picture

Status:Active» Needs review
StatusFileSize
new3.72 KB

This is indeed not possible at the moment: In views, the node type labels in exposed forms and as a field are translated with t(). This is bad, because node type labels are user defined strings and therefore need special handling and not just t().

The attached patch fixes this.

It copies the node type field and filter handlers over to i18nview and properly translates the node type label there. The new handlers are registered in place of the default handlers, so it works without changing the concerned views (caches have to cleared, of course).

dawehner’s picture

Status:Needs review» Reviewed & tested by the community

This is really looking fine in terms of views code!

Even I haven't tried the code, but that is RTBC, when you don't consider the 100% strict core documentation/code style requirements.

Nicolas Bouteille’s picture

Issue summary:View changes
Status:Reviewed & tested by the community» Needs work

Hi,

I just carefully applied the patch manually and it did not work. The filter by content type said its handler was broken. Since this code dates from Feb 2013 and it is now May 2014 this might be due to changes in Views making this code break now. Which also means this patch is not suited for the long run...

By the way, how come this RTBC patch never got committed?

cs_shadow’s picture

Issue tags:+Needs reroll

Since it was never committed, this patch needs a reroll against latest HEAD.

ptmkenny’s picture

StatusFileSize
new3.63 KB

Re-rolled against HEAD. All credit should go to original submitter.

ptmkenny’s picture

Status:Needs work» Needs review
webflo’s picture

Status:Needs review» Needs work
Issue tags:-Needs reroll

i18nviews provides additional views handlers. We do not overwrite existing views handler to avoid conflicts with contrib. Please follow this pattern. Check out i18nviews_views_data_alter_i18n_taxonomy for examples.

pfournier’s picture

StatusFileSize
new4.78 KB

Adding the handlers, instead of overwriting them.
Added a node type argument handler.

pfournier’s picture

Status:Needs work» Needs review