Using Commons 3.3 and f.e. the "commons_notify_node_created" message:

Neue [message:field-target-nodes:0:content-type] in [message:field-target-nodes:0:og-group-ref:0:title]: [message:field-target-nodes:0:title]

The content type will always be in english.

Locale
Internationalization
Multilingual content

are installed.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

amitaibu’s picture

I believe that would be a token issue, not a Message's one

slowflyer’s picture

Project: Message » Token
Version: 7.x-1.9 » 7.x-1.5
yuseferi’s picture

I have the same problem, how can I solve it , ????

ptmkenny’s picture

Closing #2015835: [node:content-type:name] and i18n as a duplicate of this issue

ptmkenny’s picture

Title: Name of content-types are not translated » Names of content types (node types) are not translated- integrate with i18n_node
Version: 7.x-1.5 » 7.x-1.x-dev
Category: Bug report » Feature request
Issue summary: View changes
Status: Active » Needs review
FileSize
829 bytes

i18n_node is the relevant submodule of the i18n module.

I'm not sure whether this functionality belongs in i18n or token. However, I wrote a preliminary patch for token which I tested and is working on my site, so here it is.

schifazl’s picture

Works for me too, thank you! :)

caspervoogt’s picture

Thanks ptmenny, that solves it nicely. Is this just about RTBC?

Dave Reid’s picture

Why doesn't i18n use the API to alter token values? https://api.drupal.org/api/drupal/modules%21system%21system.api.php/func...

TS79’s picture

In patch #5, the language is not considered.
For the new version of token.token.inc ("7.x-1.5") you need something like that:

case 'content-type':
  if (module_exists("i18n_node")) {
    $type_name = i18n_node_translate_type($node->type, 'name', NULL, array('langcode' => $language_code));
  }
  else {
    $type_name = node_type_get_name($node);
  }
  $replacements[$original] = $sanitize ? check_plain($type_name) : $type_name;
  break;

[node:content-type] token will show the translated node type.

TS79’s picture

Status: Needs review » Needs work
gonssal’s picture

Status: Needs work » Closed (fixed)

Just in case anyone lands here looking for this feature, it has been added in i18n #535522: Using translated content type from i18ncontent as a token for pathauto, which is the place to do it.

I guess this can be closed as fixed.