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',....
or
title: function () { return "By " + this.chartLabel();},.....
or
$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, Santi.
--------------------------------------------------------------------------------------- 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@gbif.es 28014 Madrid, Spain www.gbif.es
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.
Cheers
Dave
________________________________________ From: ala-portal-bounces@lists.gbif.org [ala-portal-bounces@lists.gbif.org] on behalf of Santiago Martinez de la Riva [sama@gbif.es] Sent: 23 September 2014 19:02 To: ala-portal@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',....
or
title: function () { return "By " + this.chartLabel();},.....
or
$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, Santi.
--------------------------------------------------------------------------------------- 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@gbif.es 28014 Madrid, Spain www.gbif.es _______________________________________________ Ala-portal mailing list Ala-portal@lists.gbif.org http://lists.gbif.org/mailman/listinfo/ala-portal
Ok, I'll wait and while I'll study a little of jquery-18n and I'm going to pay attention to this progress.
Thanks again Dave.
Cheers, Santi. --------------------------------------------------------------------------------------- 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@gbif.es 28014 Madrid, Spain www.gbif.es
________________________________________ De: David.Martin@csiro.au [David.Martin@csiro.au] Enviado el: martes, 23 de septiembre de 2014 12:50 Para: Santiago Martinez de la Riva; ala-portal@lists.gbif.org Asunto: RE: How can I include <g:message..> in javascript
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.
Cheers
Dave
________________________________________ From: ala-portal-bounces@lists.gbif.org [ala-portal-bounces@lists.gbif.org] on behalf of Santiago Martinez de la Riva [sama@gbif.es] Sent: 23 September 2014 19:02 To: ala-portal@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',....
or
title: function () { return "By " + this.chartLabel();},.....
or
$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, Santi.
--------------------------------------------------------------------------------------- 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@gbif.es 28014 Madrid, Spain www.gbif.es _______________________________________________ Ala-portal mailing list Ala-portal@lists.gbif.org http://lists.gbif.org/mailman/listinfo/ala-portal
participants (2)
-
David.Martin@csiro.au
-
Santiago Martinez de la Riva