I have a Django-based API layer that internally uses Django i18n objects (ugettext, etc.) to provide translation to some outputs. The API passes a one-page Javascript application that uses jQuery Globalize and its own messaging tools through CLDN / messages files, etc.
At the moment, I have my own generated language file for the user interface as a JSON file for the Globalize message module.
Ideally, I want to manage all translatable text from one place. I was hoping to use Django as the only source of truth in the translated language (since I can use Rosetta to facilitate translation). However, this is not as trivial as getting both to work together, and I try not to invent my own conventions where they may already exist to prevent future confusion with other developers.
First , some text blocks are more than a few words. Using the Django ugettext, I have to provide the text to be translated or shown as an argument - is this a good convention to provide only the key and require that the translation exist (or else, just show the key)?
Second , is there an established agreement for this kind of use?
I do not want to reinvent the wheel or deviate from the norm, if the norm makes sense for this scenario.
And the third - should I choose between them? Or can translations live in the world of Django / API, and then be displayed in the Globalize / messages format at the request of the user interface? Or should I use Django to implement gettext for Javascript?
thank