I use the "Show a message on the site" action, after a webform has been submitted, to create a link to the next page in the Message Value. Unfortunately it doesn't know or understand entity translation, so I want to construct it with patterns.
A "language the page is in" option would be enough, but it does not exist.

[site:current-page] allows: language (Interface language), language_content (Content language), but they both return the full language name "Dutch" or "Spanish" instead of "NL" or "ES"

[node:language] gives the 2 letter code of the original language of the (entity translated) node, not the language we are in.

No replacement pattern for the two-letter code of language we are in? :(

Nor have I been able to get the value of the message translated through string translation, or is that simply not possible?

Comments

suffering drupal created an issue. See original summary.

suffering drupal’s picture

Issue summary: View changes
suffering drupal’s picture

Issue summary: View changes
suffering drupal’s picture

HA, SOLVED!

In the message value I just used:
"Thank you :) [a href="../../165"]and next question ->[/a]"
(going back up to domain.com/language/ )

YAY for plain old HTML!!! :)

Not the real solution of course, but who cares?
In Drupal even the most elementary workaround is a major achievement!

TR’s picture

Status: Active » Closed (duplicate)

Rules can use the tokens provided by core Drupal and other modules. Core Drupal is the place where the node language name token is missing, and core Drupal (or the Token module, which enhances core Drupal's token support) is where this needs to be fixed. Rules should not be trying to fix the shortcomings of core - those should be fixed in core so that everyone gets the benefit and not just Rules.

There is a long-open issue in the Token queue which adds exactly this feature. See #975116: Create a 'language' token type (D7). If this feature is important to you, please download that patch, apply it, then test it out on your site. THEN you need to post in that issue saying why you need the feature, what you tested, and whether that fixed your problem or not. Participation in that queue is the way to get this feature finally implemented.