Skip to content

Adding modeltranslation languages does not work with Default values #266

Description

@LePetitTim

Model translation does not allow to add a new language whenever we want to add a new one.
Configuration for languages is static and should not be updated.
When we want to add a new language, we use the command sync_translation_fields which is used normally to add translations on new fields.
This command is not made for our use case.
If there is a default value (for example a boolean field), the command does not work on this field.

Solution :

Add default values management in settings (we can change the behavior for each users)
Overload the sync_translation_fields for adding default values management:
https://github.com/deschler/django-modeltranslation/blob/0735755070df9e96c2e745a463518fda7f02e3c7/modeltranslation/management/commands/sync_translation_fields.py#L145

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions