Download & Extend

Title-overriden term name not translated on a taxonomy overriden views page

Project:Views
Version:7.x-3.x-dev
Component:taxonomy data
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)
Issue tags:entity translation, taxonomy, title, views

Issue Summary

I'm using Title module with Entity translation to translate my taxonomy terms.
I have overridden my term page with a view with term id as contextual filter.
In the contextual filter section, I'm overriding the title view page with the contextual filter %1.
I'm validating the contextual filter by checking if it's a term id.

Unfortunately the title page is not translated. In my case term name displayed is always the one in English.

Just to test further, if I'm adding 2 fields term name and term description to my views. The 2 fields are correctly translated, by switching languages.

Comments

#1

Overridden Title
Anyone on this ?
Maybe my issue is no related to Title module, maybe more to Entity Translation or Views ?

It is possible to do that when using regular taxonomy with Internationalization and Internationalization Views module.
http://drupal.org/node/1541924

AttachmentSizeStatusTest resultOperations
HasTaxonomyTermId.PNG6.42 KBIgnored: Check issue status.NoneNone

#2

Title:Overriden title not translated on a taxonomy overriden views page» Title-overriden term name not translated on a taxonomy overriden views page
Project:Title» Views
Version:7.x-1.0-alpha5» 7.x-3.x-dev

If I'm not mistaken this is a Views issue, the related code is probably not using the proper API to display the term name. See #1651726: Use entity_label instead of term name for term reference exposed filters for a similar issue.

#3

Component:Code» Translations

#4

@heyyo do you get any progress with this problem?
I encountered the same difficulties.

#5

Component:Translations» taxonomy data

I think the translations component refers to the UI translations.

#6

Component:taxonomy data» Translations

The only solution I found is to override the views template and override the title there with my term name.

#7

Component:Translations» taxonomy data

#8

#1651726: Use entity_label instead of term name for term reference exposed filters looks related to this, but is probably not precisely the same issue (though it's fundamentally the same concept, just a different location).

#9

For this issue, the problem is going to be in views/modules/taxonomy/views_handler_argument_taxonomy.inc on line 23. The patch should be trivial.

#10

@plach, I've seen this thread, but the solution is too complicated for me :(

@merlinofchaos, I think this is not correct place.
I've tryed to comment out "return check_plain($term->name);" string, but tem name stays on it's place:
http://cl.ly/image/2J1Q3p0r423q
Term name is displayed in original (Russian) language.

This is view which overrides "/taxonomy/term/%" path:
http://cl.ly/image/0L433L1M1216

#11

Status:active» needs review

Hi, this should fix the issue. I used this solution in several projects and it should be right.

AttachmentSizeStatusTest resultOperations
views-overridden_term_name-1914024-11.patch1.71 KBIdlePASSED: [[SimpleTest]]: [MySQL] 1,621 pass(es).View details

#12

@peximo, thank you!
Your patch solves the issue.

#13

Sorry a little change: added back the check plain.

AttachmentSizeStatusTest resultOperations
views-overridden_term_name-1914024-13.patch1.75 KBIdlePASSED: [[SimpleTest]]: [MySQL] 1,621 pass(es).View details

#14

Status:needs review» reviewed & tested by the community

I think it makes sense to add the check_plain() since entity_label() returns a raw value at least when dealing directly with an entity property. Looks good to go to me and we have a confirmation that this works.

#15

Status:reviewed & tested by the community» fixed

Entity_load here is certainly not an often called operation, so there is no reason to not commit it.

Thanks for writing the patch!

#16

There is a problem when using taxonomy_term_load and the machine name, created a follow-up issue: #1949178: Notice: Undefined property: stdClass::$machine_name in views_plugin_argument_validate_taxonomy_term->validate_argument() (line 1.

#17

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here