Problem/Motivation

Sometimes we could need to use a transliterated field in a View or in a view mode (the Token one in particular).

Proposed resolution

Create a new field formatter for text field to allow to transliterate them.

Remaining tasks

  • Create the field formatter

User interface changes

None

API changes

None

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DuaelFr’s picture

Status: Active » Needs review
FileSize
2.55 KB

Here is the patch !

This patch is part of the #1day1patch initiative.

pakmanlh’s picture

Patch works for me, I generated one for stable version.
Congratulations and thanks for the work :)

* Update! Sorry, my patch is the same :P
Anyway seems that conversion does not correct, because the blank spaces are are converted in underscores, and maybe should be hyphens.
I would use transliteration_get function instead of transliteration_clean_filename in line 139.
or maybe directly the pathauto_cleanstring function, what do you think?

amateescu’s picture

Status: Needs review » Needs work

Thanks for the patch, sounds really useful!

Yes, you should probably use transliteration_get(), but if you're interested in the other cleanup that is happening in transliteration_clean_filename(), we should probably also move that to a new helper function.

And replacing spaces with underscores or hyphens should be a formatter setting.

amateescu’s picture

Issue summary: View changes

Updated remaining tasks

circuscowboy’s picture

I have been using this patch for a couple of years now and it is working great. I extended it to included taxonomy term names. I have attached a new patch. I am going to try to find a bit of time to clean up the patch as per above so it can get committed

circuscowboy’s picture

Oops error in my patch - new version