CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Internationalization and Localization (Moderators: Michał Mach, mathieu) »
  • How to set multi-lingual automated messages
Pages: [1]

Author Topic: How to set multi-lingual automated messages  (Read 2613 times)

moreonion

  • I’m new here
  • *
  • Posts: 16
  • Karma: 0
How to set multi-lingual automated messages
August 10, 2010, 05:06:31 am
Hello,

I've been trying to figure out how to set up automated messages in multiple languages. Generally I couldn't find much help with getting the output of CiviCRM translated - so what's the usual procedure?

Most important right now is the automated email messages, but labels, strings, etc. would be interesting as well....

Thank you in advance

Yours,
Florian

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: How to set multi-lingual automated messages
August 10, 2010, 08:44:26 am
Quote from: moreonion on August 10, 2010, 05:06:31 am
I've been trying to figure out how to set up automated messages in multiple languages.

It seems the relevant columns of the civicrm_msg_template table aren’t multilingual, so for now you might need to code some logic that will use different templates depending on the locale.

Quote
Generally I couldn't find much help with getting the output of CiviCRM translated - so what's the usual procedure?

Most important right now is the automated email messages, but labels, strings, etc. would be interesting as well....

The general approach is that in the case of database-originating content the multilingual capabilities are provided by multiplying the relevant db columns and then using the column with suffix equal to the current locale (hence it won’t work directly for message templates, as the relevant columns are not multilingual).

When editing the db contents the user edits the columns matching their current locale.
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

moreonion

  • I’m new here
  • *
  • Posts: 16
  • Karma: 0
Re: How to set multi-lingual automated messages
August 11, 2010, 02:57:09 am
alright, thank you....
that's a good info for a start ;-)

maybe we'll submit some patches to fix that, I think it should really be part of the basic installation to have a fully multi-lingual setting.
It may turn out to be a drupal module though, we'll see

thx!

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: How to set multi-lingual automated messages
August 12, 2010, 03:19:54 am
Quote from: moreonion on August 11, 2010, 02:57:09 am
maybe we'll submit some patches to fix that, I think it should really be part of the basic installation to have a fully multi-lingual setting.

That’s true – but message templates are fairly new addition to CiviCRM, and I general we try to multilingualise only things that are proven to be working fine (as multilingualisation adds a layer of complexity that sometimes makes it harder to track issues with the underlying feature).

Your patches will be most welcome; in general, you need to add <localizable>true</localizable> to the XML schema of the civicrm_msg_template table, regen the structure, test it throughly and finally make sure an upgrade from 3.2 works.
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

m4olivei

  • I post occasionally
  • **
  • Posts: 39
  • Karma: 2
  • CiviCRM version: 4.3.5
  • CMS version: Drupal 7.23
  • MySQL version: MySQL 5
  • PHP version: PHP 5.3
Re: How to set multi-lingual automated messages
October 02, 2012, 08:05:40 am
Quote
It seems the relevant columns of the civicrm_msg_template table aren’t multilingual, so for now you might need to code some logic that will use different templates depending on the locale.

Looks like this is still an issue (Drupal v4.1).  Can you give some guidance as to where we can step in and override the templates in code depending on the locale?

JoeMurray

  • Administrator
  • Ask me questions
  • *****
  • Posts: 578
  • Karma: 24
    • JMA Consulting
  • CiviCRM version: 4.4 and 4.5 (as of Nov 2014)
  • CMS version: Drupal, WordPress, Joomla
  • MySQL version: MySQL 5.5, 5.6, MariaDB 10.0 (as of Nov 2014)
Re: How to set multi-lingual automated messages
May 24, 2013, 10:46:40 am
If we change the xml schema for civicrm_msg_template to make the following fields internationalizable, and then regenerate the DAO for it, would that allow us to perhaps have the ability to edit these fields with the built-in localization tools, and have multilingual messages go out?

`msg_subject` text COLLATE utf8_unicode_ci COMMENT 'Subject for email message.',
  `msg_text` text COLLATE utf8_unicode_ci COMMENT 'Text formatted message',
  `msg_html` text COLLATE utf8_unicode_ci COMMENT 'HTML formatted message',

As we are interested in making the language of the message sent vary by language preference of the user, we would have to hook in to where the message is generated from the templates to enable this.

Any comments or feedback on this approach?
Co-author of Using CiviCRM https://www.packtpub.com/using-civicrm/book

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Internationalization and Localization (Moderators: Michał Mach, mathieu) »
  • How to set multi-lingual automated messages

This forum was archived on 2017-11-26.