Hey there,

Not sure if this is a Views or i18n or i18n_views issue.. But I'm having something ridiculous happening - I've a "custom text" field in my view, with a "rewrite results" - "output this field as a link" setting set to the local URL "resources"..

Now I have that string popping up in some places so I translated it.. well.. what do you know, the link path translated itself as well accordingly.. not very nice :)

I solved it for me by adding the a href.. stuff inside the "text" itself, but this is really not nice :)

CommentFileSizeAuthor
#5 1529936-link-path.patch775 bytesdawehner
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

Status: Active » Fixed

You know that's a problem, there are people which want to have it translatable, and there are people which don't want it to be translatable.

If you use i18nviews and the translation method of i18n (you set this up under the views settings) you will only translate certain fields of the view, so you don't just translate the string, so you probably didn't setup . You can find this under admin/structure/views/settings/advanced if you have installed i18n.

arski’s picture

Really, who would want a link path translatable.. I mean rewriteable to redirect to an appropriate language node sure, but translatable as a string - that's just weird :x

Anyway, thanks for the note.

Status: Fixed » Closed (fixed)

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

arski’s picture

Status: Closed (fixed) » Active

hmm, I just encountered this again, and having located this issue, I see that the solution that you suggested doesn't really help, as I can only see very broad settings, i.e. setting a translation method to all empty text, header, footer, elements.. that's not really helpful.

There must be either a better way of configuring this, or I don't know. At the end of the day, links are not strings - they are not translated, they're usually rewritten.. So even if some people want this, it doesn't seem right at all.

dawehner’s picture

Status: Active » Needs review
FileSize
775 bytes

I'm just afraid of changing existing functionality because people maybe rely on that,
but i totally see your point, links in drupal aren't really translatable.

Changing anything in views can potentially cause many sites to break.

Here is a patch so someone can try this out.

arski’s picture

Well, as you said, this will surely break things if someone decided to use this oversight for their purpose. I suppose the only other thing you could do is add a checkbox to a view's settings somewhere (or to the general views settings) that controls if the link is "translatable" or not.

dawehner’s picture

This isn't really possible due to the technical architecture of this, or at least it would make it quite ugly.
Maybe we could just accept this.

arski’s picture

I'd be obviously happy to, but it will quite surely "break" the link translation for the people who were (wrongly) using it..

webflo’s picture

A path is not a translatable string. A path can be localized through the path alias system (a different alias for each language) or translated with i18n Path translation. t() definitely the wrong system. Views core does not support i18n string or path translation therefore the path should not be translatable (string translation). The localization happens in views_handler_field::render_as_link.

dawehner’s picture

Status: Needs review » Fixed

Thanks for the feedback! Committed to 8.x-3.x and 7.x-3.x

Status: Fixed » Closed (fixed)

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