Using a callable to populate initial translations

12 views
Skip to first unread message

Chris Spencer

unread,
Dec 19, 2013, 10:21:49 AM12/19/13
to django-mode...@googlegroups.com
After converting an existing app to django-modeltranslation, what would be the easiest way to dynamically populate translations for all fields?

The docs don't really mention any good way of doing this. I had hoped the
update_translation_fields command
(https://django-modeltranslation.readthedocs.org/en/latest/commands.html#the-update-translation-fields-command)
might do this, but the docs say it just copies the original field text into the translated field...which doesn't make sense to me, since the original field value will likely not be a valid translated value.

Is there a way to configure django-modeltranslation to call a custom method (e.g. translate(text, src_lang_code, dst_lang_code)) to dynamically look up a translation, using a translation API or your own local PO translation catalog?
Reply all
Reply to author
Forward
0 new messages