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

Translated object should inherit from some of original content #40

Open
sveetch opened this issue Jan 14, 2023 · 5 comments
Open

Translated object should inherit from some of original content #40

sveetch opened this issue Jan 14, 2023 · 5 comments
Labels
Idea A feature or behavior idea

Comments

@sveetch
Copy link
Member

sveetch commented Jan 14, 2023

Is your feature request related to a problem? Please describe.
When creating a translation object from an original one, the create form is almost blank except the "orginal" relation.

Describe the solution you'd like
Category has nothing valuable to share with translation.

Article translation should inherit from states and publication dates because we can assume it should be identical on its visibility behaviors and the user should be aware enough to change these value for specific case.

Describe alternatives you've considered
Let this as it work currently, this is not a breaking issue but this is not really useful for users to apply again all the original value.

@sveetch sveetch added the Enhancement Feature enhancement label Jan 14, 2023
@sveetch
Copy link
Member Author

sveetch commented Jan 16, 2023

I would say that a new setting could define what model field have to be copied during translation, so each project could choose to copy or not some fields.

Something like this:

{
    "Article": [
        "cover",
        "publish_date",
        "publish_time",
    ],
}

@sveetch
Copy link
Member Author

sveetch commented Jan 16, 2023

By the way, actually from translation form we give the original id as an URL argument automatically set on input from Django admin form view.

But this won't work to copy original field values, date won't be formatted well and images cannot be given like this.

So we will need to customize the admin form to get values and set them on new non created (yet) form for the translation.

@sveetch
Copy link
Member Author

sveetch commented Jun 11, 2023

We may have a proper way using a form in AdminTranslateView which sends POST request to pass data to copy into new translation object admin creation view which could fill initial form values with getting data into ModelAdmin.get_changeform_initial_data. The form from AdminTranslateView should have the "language target" field and then a list of checkbox for available fields to copy from original.

@sveetch
Copy link
Member Author

sveetch commented Jun 11, 2023

Also there is a bug with "Translate" button from detail page, it shows even if there is not any available language for the object to translate.

@sveetch
Copy link
Member Author

sveetch commented Jun 11, 2023

The POST technique won't work since it is catched as submitting create form, not as "go to creation form and fill this". The GET could work but not for images since they need to be duplicated (each article needs its own file since it can be removed).

We may change of the way to perform a translation. Instead of sending to creation form, it could be some sort of resumed form with choosing data to copy and then directly create object ? (It seems impossible since there is many required fields)

@sveetch sveetch added Idea A feature or behavior idea and removed Enhancement Feature enhancement labels Jun 11, 2023
@sveetch sveetch added the Enhancement Feature enhancement label Aug 7, 2023
@sveetch sveetch removed the Enhancement Feature enhancement label Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Idea A feature or behavior idea
Projects
None yet
Development

No branches or pull requests

1 participant