I cannot translate the text that appears below the geofield openlayers map widget:
"Use the icons to select what type of feature to draw. Each map can contain one simple feature. Pan and zoom with arrows and the zoom bar."

This text appears as follows in geofield.widgets.openlayers.inc:
'#markup' => t('<div class="description geofield-help">Use the icons to select what type of feature to draw. Each map can contain one simple feature. Pan and zoom with arrows and the zoom bar.</div>')

The problem is that the Drupal translation UI or .po import do not allow translating HTML markup.
I get this error (for a Greek translation):
The submitted string contains disallowed HTML:<div class=\"description geofield-help\">Πατήστε το εικονίδιο με το μολύβι (+) για να ορίσετε συντεταγμένες. Για να διαγράψετε τις συντεταγμένες, πατήστε το διπλανό εικονίδιο, επιλέξτε το σημείο και πατήστε Delete.</div>

So I suggest modifying the code to:
'#markup' => '<div class="description geofield-help">' . t('Use the icons to select what type of feature to draw. Each map can contain one simple feature. Pan and zoom with arrows and the zoom bar.') . '</div>'

CommentFileSizeAuthor
#1 HTML_separated_in_markup-2214039-1.patch814 bytescs_shadow
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cs_shadow’s picture

Status: Active » Needs review
FileSize
814 bytes

Here's a quick patch for the same.

yce’s picture

#1: Thanks, now I can translate nicely with this patch.

SidneyGijzen’s picture

Status: Needs review » Reviewed & tested by the community

Tested with Geofield 7.x-2.3. Works perfectly. Thanks!

sano’s picture

I have to get into a habit to look first into the Issues before embarking on a hunt to seek through a module source code when encountering problems. I spent maybe 30 minutes doing just that and fixing this issue on my server. Then I came here to submit a patch only to find that it already exists. Oh well...

joseph.olstad’s picture

I'm using this patch in the make files for media_dev

  • itamair committed 1a84143 on 7.x-2.x authored by cs_shadow
    Issue #2214039 by cs_shadow: do not run HTML markup through translation
    
itamair’s picture

This has been just committed into dev. Will be pat of the new module 7.x-2.x release

itamair’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.