Hi,

I am wondering how you can translate configurable messages and emails sent to users from Rules. Can someone please let me know if this is currently possible?

Thanks!!

BB

CommentFileSizeAuthor
#14 rules_translate_message.patch1.45 KBschnitzel

Comments

mitchell’s picture

Component: Features integration » Miscellaneous
Category: task » support
Status: Active » Postponed (maintainer needs more info)

AFAIK, only the node system has translation support. If you use node bodies from translated nodes, that would seem like a manageable way to do this with existing functionality.

I'm not sure how/if rules would integrate translation support.

mairav’s picture

I was needed to translate de configurable messages, and in the Message field I wrote the following:

<?php
echo t("Message to translate.")
?>

Once that message is shown once to the user, it will appear in the translate interface.

blueblade’s picture

Thanks! Where do you add that 3 lines, mairav? I hope this will be included in Rules Module soon.

joostvdl’s picture

Category: support » feature
Status: Postponed (maintainer needs more info) » Active

There are several modules that hacve translation support for e-mails that need to bee send. The module: http://drupal.org/project/mail_edit supports editing mails and also supports translation. It should be nice to have rules support this module.

pasqualle’s picture

pasqualle’s picture

Version: 6.x-1.2 » 6.x-1.4
Category: feature » support
lotyrin’s picture

Sub

artbussy’s picture

I downloaded the modules by Pasqualle. Some directions to get started would be very welcome (or documentation in a Readme file). Especially how to translate screen messages produced by triggered rules. I have some but they don't show in the translation table.

pasqualle’s picture

I added a step by step example to the custom_message module page.

Step by step example:

1. requirements: Drupal 6; +modules: Rules, Token, Internationalization, Translation table, Custom message
2. install Drupal 6
3. enable modules: Rules Administraion UI, Token, Custom message, Translation table (+ all dependencies)
4. add language admin/settings/language/add [ languge: German ]
5. set language negotiation admin/settings/language/configure [ negotiation: Path prefix only (save settigns) ]
6. add custom message admin/build/custom-message/add [ message key: thank_you; description: Thank you message (save) ]
7. add rule admin/rules/trigger/add [ Label: Show message after node is created; Event: After saving new content (save changes) ]
8. add action to rule admin/rules/rules/rules_show_message_after_node_is_created [ Action: Custom message: Dislay a translatable custom message (next) message type: normal (save) ]
9. refresh the strings admin/build/translate/refresh [ Select text groups: Custom messages (Refresh strings) ]
10. edit message admin/build/translate/table/custom_message [ English: Thank you [node:author-name]; German: Danke [node:author-name] (save) ]
11. add $conf['i18nstrings_translate_langcode_en'] = TRUE; to setting php

result:
node/add/page: custom message is displayed in English after saving the node.
de/node/add/page: custom message is displayed in German after saving the node.

@artbussy: you probably need point 9 to refresh the custom message strings

artbussy’s picture

Thanks a ton, these guidelines were a great help!

Thomas_Zahreddin’s picture

uuh #9 looks hard to me,

i'd like much more a clean way with i18n/i18nstings as shown in http://drupal.org/node/789286.

pasqualle’s picture

It is using i18nstring.
The custom_message module is quite general, you can use it without rules, that is why it may seem a little bit complicated than if it would solve it for rules messages only.
The mail translation is also a general solution, as the module existed already, I've just added rules support to it.

mitchell’s picture

Status: Active » Fixed
schnitzel’s picture

Version: 6.x-1.4 » 7.x-2.x-dev
Status: Fixed » Needs review
StatusFileSize
new1.45 KB

Opening for Drupal 7.

Why not just give the admin a setting where he can set if the entered message should be translated?

Attached a Patch which adds a new setting to the message action and translates the message if selected

fago’s picture

Status: Needs review » Closed (duplicate)

Because t() may not be used for user-inputted values. We've to integrate with i18n - I've opened #1356982: Add i18n support for that.

mitchell’s picture

Component: Miscellaneous » Rules Core

Updated component.

drupalfan81’s picture

Issue summary: View changes

Has there been any further interest/development on getting rules to support both translated messages for on-screen messages and emails sent out by rules?

I would love to have this ability (actually need it).

michielkenis’s picture

Patch at #14 is not working for messages with a replacement token as they will be hard printed in the string to be translated...