Problems
After I register models and fields in translation.py, I ran sync_translation_fields. It created field_en, field_ko in the corresponding models.
When I run makemigrations to apply other changes in model, I see field_en, field_ko fields, which already were added by sync_translation_fields, appear in migration files.
$ python manage.py makemigrations --dry-run
Migrations for 'common':
common/migrations/0037_departport_name_en_departport_name_ko.py
- Add field name_en to departport
- Add field name_ko to departport
Migrations for 'company':
company/migrations/0088_department_name_en_department_name_ko.py
- Add field name_en to department
- Add field name_ko to department
This is somewhat confusing. The doc says I should run sync_translation_fields command to apply translatable fields to which language suffix is put.
you should use the sync_translation_fields command. Although it’s possible to introduce new fields in a migration, it’s nasty and involves copying migration files, using MIGRATION_MODULES setting, so we don’t recommend it. Invoking sync_translation_fields is plain easier.
Translation changes are already reflected by the command, so in my understanding there shouldn't be new migration files, which happen.
Environments django 4.2 python 3.11 django-modeltranslation 0.18.11
Problems After I register models and fields in translation.py, I ran sync_translation_fields. It created
field_en
,field_ko
in the corresponding models. When I run makemigrations to apply other changes in model, I seefield_en
,field_ko
fields, which already were added bysync_translation_fields
, appear in migration files.This is somewhat confusing. The doc says I should run sync_translation_fields command to apply translatable fields to which language suffix is put.
Translation changes are already reflected by the command, so in my understanding there shouldn't be new migration files, which happen.
Am I missing something?