AIFDR / riab

Risk in a Box - main project
Other
17 stars 6 forks source link

Internationalisation #43

Open uniomni opened 13 years ago

uniomni commented 13 years ago

The Risiko application is written in Bahasa Indonesia. However, as it is applicable more widely it should make use of a proper internationalisation mapping.

uniomni commented 13 years ago

See also http://dev.geonode.org/trac/ticket/936

ted-dunstone commented 13 years ago

as per http://docs.djangoproject.com/en/dev/topics/i18n/internationalization/#the-set-language-redirect-view

Rather than serving the Risiko.js as a static file, I will serve it through a view. I will then add the relevant internationalization codes to the Risiko.js template

.... {% load i18n %} ... {% trans "Calculate" %} ...


Alternative/Supplementary Answer

Indeed, there is translation going on both in the Django templates and in the GeoExplorer Javascript. What might not be >obvious is that we actually use Django's templating system to provide the translation strings to the GeoExplorer components.

If you take a look at this template: https://github.com/GeoNode/geonode/blob/master/src/GeoNodePy/geonode/maps/templates/lang.js

That's a javascript file that gets loaded into all of our rich client pages that sets the value of the literals on the GeoExplorer >component prototypes. The gettext() function is provided by Django's javascript i18n support.

So, on our demo site, see: http://demo.geonode.org/jsi18n/ http://demo.geonode.org/lang.js

If you view the source code for our map viewer:

view-source:http://demo.geonode.org/maps/11/view

you can see where these two scripts get loaded.

For custom applications on top of GeoNode, you probably should have a similar template set up.

For more information on internationalization and localization of these sorts of applications, I'd suggest the Django >documentation if you haven't already read it, especially these sections:

(Sebastian)

uniomni commented 13 years ago

Ariel did this around June 2011

uniomni commented 12 years ago

Need two things

1: There new tables in plugins that have not yet been processed to achieve internationalisation (i.e. padang building damage) 2: Need to document how this works, so that new plugins can be easily internationalised

This is a high priority for showcasing Risiko at the 17th November GFDRR CG meeting