Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding modeltranslation languages does not work with Default values #266

Open
LePetitTim opened this issue Mar 6, 2023 · 0 comments
Open

Comments

@LePetitTim
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant