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

MODELTRANSLATION_AUTO_POPULATE = True has no effect with non-default language #557

Open
A4TIF opened this issue Jun 8, 2020 · 2 comments

Comments

@A4TIF
Copy link

A4TIF commented Jun 8, 2020

Django==2.2.13
django-modeltranslation==0.15

MODELTRANSLATION_AUTO_POPULATE = True

If my current language is different from default language, and I create an object, it doesn't populate the default field value.

For example, I have below in my settings:

LANGUAGES = (
('en', gettext_noop('English')),
('ar', gettext_noop('Arabic')),
)

If I go the create page, and select "ar" as my current language. Create the model object. I then change my language to default language "en". The en field doesn't get populated. Whereas, if its the other way round, and I create an object with "en" selected, then it populates "ar" field properly. Is this how it is designed? Or am I missing something with auto-populate function?

@last-partizan
Copy link
Collaborator

Looks like this is how it designed.

Take a look at modeltranslation/translator.py and try to find a bug.

@last-partizan last-partizan changed the title MODELTRANSLATION_AUTO_POPULATE = True has no effect MODELTRANSLATION_AUTO_POPULATE = True has no effect with non-default language Jun 9, 2020
@dieudv
Copy link

dieudv commented Nov 21, 2020

In my case, I'm not set MODELTRANSLATION_AUTO_POPULATE but it still auto copy all translated field to default field although I have provided value for default fields.

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

3 participants