[Ala-portal] How can I include <g:message..> in javascript

David.Martin at csiro.au David.Martin at csiro.au
Tue Sep 23 12:50:55 CEST 2014

Thanks Santiago.

Alan (ALA) was looking into i18n for the javascript in the collectory. He's currently on leave for a week.
The solution that we use in the biocache-hubs is to use jquery-i18n and I think we've started with this but nothing is committed.
This is a pure javascript solution - so no <g:message> tags are used.
We'll send an update to list soon.



From: ala-portal-bounces at lists.gbif.org [ala-portal-bounces at lists.gbif.org] on behalf of Santiago Martinez de la Riva [sama at gbif.es]
Sent: 23 September 2014 19:02
To: ala-portal at lists.gbif.org
Subject: [Ala-portal] How can I include <g:message..> in javascript

Hi all,

I'm trying to modify some javascript files to do the right internationation through the message.properties file, but I don't know how can I write this code <g:message.../> into the javascript code. For example:

If we have this javascript code:

    chartLabels: {
        institution_uid: 'institution',....


title: function () { return "By " + this.chartLabel();},.....


$container.append($('<h4>Explore records by Taxonomy</h4>'));

Is it possible include <g:message..> into this code, something like this:

$container.append($('<h4><g:message code='public.charts.taxomony.title'/></h4>'));

I've tried to do this but I obtain a javascript error.

Could someone teach me how can I do this?

Thanks in advance,

Santiago Martínez de la Riva
GBIF.ES, Unidad de Coordinación         Tel. +34 91 4203017 x 273
Real Jardín Botánico - CSIC                     Fax +34 91 429 2405
Plaza de Murillo, 2                                     sama at gbif.es
28014 Madrid, Spain                                 www.gbif.es
Ala-portal mailing list
Ala-portal at lists.gbif.org

More information about the Ala-portal mailing list