[GeoNode-devel] GeoNode Translation

Paolo Corti pcorti at gmail.com
Thu Jun 16 07:00:45 PDT 2016


Unfortunately trans filter work only in Django templates, and in this
case it is html loaded from javascript.

You have two options here:
* create your new version of static/geonode/js/templates/cart.html in
your deployment project and translate to your language the string.
Unfortunately this will work only for one language
* use jQuery to dynamically replace the string in the div according to
the selected language in the language select list. In the long run we
should consider using something like jquery.i18n

p

On Thu, Jun 16, 2016 at 3:43 AM, Antoine ROLLAND
<antoine.rolland at cirad.fr> wrote:
> Hi everyone,
>
> I experience a difficultiy to transle some Geonode text.
> Actually, I already translated most parts of my website, thanks django.po files, and when my translations are only useful for my website and not every Geonode users, I use
> Django tags to display some text according the language selected by the user.
> However, what I want to translate now is the new "Cart" part : ("Cart" and "Add resources via the 'Add to Cart' button." (v. 2.4), but the file is located in var/[...], and it seems that Django tags don't work there...
>
> Is it possible to make Django tags work there ? (for example :
> {% if LANGUAGE_CODE == "fr" %} Some french text
> {% else %} Some english text
> {% endif %} (--> this works in geonode main directory thank to {% load i18n %} but not in var/ )
> Otherwise, is it possible to make my translations in djangojs.po effective on this file (cart.html) ?
>
> Thank you very much
>
> Antoine Rolland, Cirad - Reunion Island
> _______________________________________________
> geonode-devel mailing list
> geonode-devel at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/geonode-devel



-- 
Paolo Corti
Geospatial software developer
web: http://www.paolocorti.net
twitter: @capooti
skype: capooti


More information about the geonode-devel mailing list