django-modeltranslation
django-modeltranslation copied to clipboard
Translates Django models using a registration approach.
``` In [10]: with translation.override('fr'): ...: print Facility.objects.values('facilitysetup__question')[4] ...: {'facilitysetup__question': u'Do you provide a fridge?'} In [11]: with translation.override('fr'): ...: print Facility.objects.values('facilitysetup__question_fr')[4] ...: ...: {'facilitysetup__question_fr': u'Fournissez-vous un r\xe9frig\xe9rateur ?'} In...
So I have the model "News", with the field "text" translatable into "en" and "es", but when I enter the django admin on the News list, I can only see...
I found that fields from related models are not translating correctly when referenced via __ notation (don't know how to call it otherwise). Example: # a.py class A(models.Model): text =...
When I try to keep translated string from foreign object by a queryset.values(), the query don’t fallback on translated field. Use case: ``` class Foo(models.Model): id = models.AutoField(primary_key=True) term_name =...
I registered model translations using appconfig' s ready method , documentation dictates to create translations.py. Is it really necessary, ready method seems to work just fine.
The **modeltranslation.utils.build_localized_fieldname** method is not considering the capital letters from the language code definitions. For instance "**es-es**" will be localized to "**es_es**" while the field name on the database will...
I am having problems with simple inheritance. Here is my models.py: ``` class BaseSegment(models.Model): name = models.CharField(max_length=256, verbose_name=_("Name"), unique=True) class Segment(BaseSegment): label = models.CharField(max_length=256, verbose_name=_("Label"), default='') description = models.TextField(verbose_name=_("Description"), default='')...
When using update_fields from documentation, when indicating it's a translatable name, it does not hook into the list adding proper fields: On models.py: ``` python class SomeModel(models.Model): name = models.TextField()...
Hello, I'm having issues with some values that are translated (specifically boolean types), so I decided to remove fallback on settings, but then I realized that I only needed for...
When using order_by on a translated model field, the fallback language is not used if the current language's field is empty. e.g: I have a class with a `name` field...