Hi all,
Sorry if I didn't explain myself clearly, I will try to do it better. It will be nice to contribute something to Django.
What I a propose is to provide a view to retrieve the i18n translations catalog as JSON, this is something that was requested in the ticket:
https://code.djangoproject.com/ticket/22404 It could be useful for third party applications and client libraries.
The JSON response of the view will have the form:
{
//translations catalog
catalog:{
//a simple translation entry
'translate this':'traduce esto',
//translation with plural form
'one plural sample': [
'un ejemplo de plural',
'muchos ejemplos de plural'
]
},
//expression for the plural index
//when null -> 'n>1?1:0'
plural: null,
//formats used by the locale
formats: {
"DATETIME_FORMAT": "N j, Y, P",
"DATE_FORMAT": "N j, Y",
"DECIMAL_SEPARATOR": ".",
...
}
}
These are basically the 3 elements used by the javascript functions of the i18n view javascript_catalog to perform the translations.
Please, let me know what do you think.
Regards,
Manolo Ramirez T.