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) »
  • Event description field not translatable
Pages: [1]

Author Topic: Event description field not translatable  (Read 867 times)

spidersilk

  • I’m new here
  • *
  • Posts: 10
  • Karma: 0
    • Freeform Solutions
  • CiviCRM version: Several, on different sites
  • CMS version: Drupal (6 and 7)
  • MySQL version: Varies
  • PHP version: Varies
Event description field not translatable
September 15, 2014, 09:22:05 am
I'm working on a bilingual site (English/French), and I've noticed that the description field for events does not appear to be translatable. The event title and summary fields both have the little icon next to them that allows you to enter a French translation, but the description does not.

I was going to add a custom field for the French description, but when I checked the database to see what length to set the field to (to match the English one), I was surprised to see that the civicrm_event table does in fact contain a field called description_fr_CA. In fact, all text and varchar fields seemed to have both en_US and fr_CA equivalents - but not all have any means of translating them in the UI!

I'm not sure if this has something to do with the description field using the WYSIWYG editor, when the other two don't, or what, but it's a problem, because the client needs to be able to enter both French and English descriptions for events.

Is there some setting that can fix this, or some change to a template? Or is it a bug that should be reported? (Although even if it, we'll need a way to work around it in the meantime, because this site is supposed to launch very soon.)
Web developer at Freeform Solutions - your not-for-profit technology support

mathieu

  • Administrator
  • Ask me questions
  • *****
  • Posts: 620
  • Karma: 36
    • Work
  • CiviCRM version: 4.7
  • CMS version: Drupal
  • MySQL version: MariaDB 10
  • PHP version: 7
Re: Event description field not translatable
September 15, 2014, 09:49:07 am
As a quick workaround, you can switch the page language (using the language switcher) to enter the description in the other language. Although, of course, that's a gigantic annoyance for the user.

The WYSIWYG does cause issue, but we could probably work them out:

In CRM/Event/Form/ManageEvent/EventInfo.tpl, find the 'description' field and change as follows:

Code: [Select]
    <tr class="crm-event-manage-eventinfo-form-block-description">
      <td class="label">{$form.description.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='description' id=$eventID}{/if}</td>
      <td>{$form.description.html}</td>
    </tr>

However, the bug is that 1- the popup itself does not have the WYSIWYG, 2- the value of the current language is not shown in the WYSIWYG field once you close the popup. The popup does save to the DB immediately, so you could just refresh the page though.

I don't think there is an open issue on this topic. Can you create one?
Would you be interested to work on a patch for this issue? Would be much appreciated :)
CiviCamp Montréal, 29 septembre 2017 | Co-founder / consultant / turn-key CiviCRM hosting for Quebec/Canada @ SymbioTIC.coop

spidersilk

  • I’m new here
  • *
  • Posts: 10
  • Karma: 0
    • Freeform Solutions
  • CiviCRM version: Several, on different sites
  • CMS version: Drupal (6 and 7)
  • MySQL version: Varies
  • PHP version: Varies
Re: Event description field not translatable
September 15, 2014, 10:36:31 am
Thanks, Mathieu. Entering a description by changing the whole page into French does seem to work, although it's a bit of a nuisance, particularly since the site's design at present uses the Drupal language switcher, not the CiviCRM one, and the Drupal one doesn't work for Civi pages, as it chops off the arguments such as event ID.

I've posted an issue on Jira: https://issues.civicrm.org/jira/browse/CRM-15310

And I'll talk to the Freeform team about whether we can come up with a patch for this.
Web developer at Freeform Solutions - your not-for-profit technology support

Dan C

  • I post frequently
  • ***
  • Posts: 179
  • Karma: 17
  • CiviCRM version: All
  • CMS version: Joomla 2.5 and 3.X, Drupal 7, Wordpress 3.7 and up
  • MySQL version: 5.1.7 and up
  • PHP version: 5.3.5 and up
Re: Event description field not translatable
September 15, 2014, 11:17:08 am
I have a client that needs something similar.  They actually had a previous programmer implement a hack that displays the icon to enter multilingual, but doesn't work properly because of the WYSIWYG editor (like mathieu mentioned).  If you are going to work on this drop me a line and I would be willing to help.  I have been meaning to but haven't gotten a chance to sit down and do so.
CrusonWeb - Web Development, Implementation, and Support.  Specializing in CiviCRM and Joomla (although also knowledgable in Wordpress and Drupal as well).

mathieu

  • Administrator
  • Ask me questions
  • *****
  • Posts: 620
  • Karma: 36
    • Work
  • CiviCRM version: 4.7
  • CMS version: Drupal
  • MySQL version: MariaDB 10
  • PHP version: 7
Re: Event description field not translatable
September 15, 2014, 11:28:39 am
For the Drupal language switcher, can you test the patch in this thread?
http://forum.civicrm.org/index.php/topic,30649.0.html

The thread got kind of side-tracked by memcached issues, but I that seems mostly like a different issue. You can also implement it in a custom module, but it would be nice to have this in core, since everyone seems to be working around the issue.
CiviCamp Montréal, 29 septembre 2017 | Co-founder / consultant / turn-key CiviCRM hosting for Quebec/Canada @ SymbioTIC.coop

spidersilk

  • I’m new here
  • *
  • Posts: 10
  • Karma: 0
    • Freeform Solutions
  • CiviCRM version: Several, on different sites
  • CMS version: Drupal (6 and 7)
  • MySQL version: Varies
  • PHP version: Varies
Re: Event description field not translatable
September 15, 2014, 06:38:27 pm
My project manager is going to check with the client we're doing this site for to see if they're OK with just going to the French version of the form to enter the French content (from the main Manage Events page, presumably, given the language switcher issues), or if they would like us to come up with a better solution, so that will probably dictate whether we'll have the resources to work on a patch or not.

I've also left her a message letting her know about the possible patch for the language switcher issue, since that would undoubtedly make things easier for the client also. So once she has a chance to meet with them, I should have a better idea of what we can do on this issue.
Web developer at Freeform Solutions - your not-for-profit technology support

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Internationalization and Localization (Moderators: Michał Mach, mathieu) »
  • Event description field not translatable

This forum was archived on 2017-11-26.