wagtail-localize
wagtail-localize copied to clipboard
Translation of models with ParentalManyToManyField
My try to fix #563
I basically duplicated the code from django-modelcluster copy_cluster: https://github.com/wagtail/django-modelcluster/blob/8666f16eaf23ca98afc160b0a4729864411c0563/modelcluster/models.py#L386-L392
@zerolab thanks for taking a look
Can you rebase on latest
mainand re-generate the migration? we reduced the test app migrations to just0001_initial
i've now rebased. I'm not sure about the migrations.. i've deleted the old once and recreated a new one.. Was this what you meant, or should it also be part of the 0001_initial migration? 🤔
This works well to sync the values, but they are not exposed in the edit translation UI which could potentially cause additional confusion
Are SynchronizedFields actually exposed in the translation UI? 🤔 Should this simply list the selected IDs or str() of the objects?
Would it be possible to make this as part of a separate PR? This error blocks me from translating some content in my project.. hopefully the last problem 😬
btw. do you know of some easy way to use a forked version as a dependency? The problem is including wagtail-localize as a git dependency doesn't work because it would require manual npm build to generate the static files.. 🤔 I guess I could just commit the generated files into my forked git repo, but that would make merging pretty cumbersome..
On using a fork.. you cannot really do it because of the FE assets.. best to build it locally and host the built package somewhere you can install from a URL
Will revisit the synchedfield question tomorrow.
Hey @hpoul,
SynchronisedField, or "overridable segment", does show in the UI. By default it syncs the value from the source, but the value can be overridden. See https://www.wagtail-localize.org/concept/segments/#overridable-segment
Did this make it into v1.2? I'm having the exact same problem.
@zemogle this PR is still open, so it did not, I'm afraid
@hpoul I am having the same problem and your fix would be very useful. It has been a while, but what is the state of this PR? Is there a way to help you getting this PR merged? Thanks!
@lvonlanthen see https://github.com/wagtail/wagtail-localize/pull/564#pullrequestreview-964839332
This works well to sync the values, but they are not exposed in the edit translation UI which could potentially cause additional confusion
I don't have enough time it understanding in the inner workings of the wagtail admin to fix this.. feel free to take over this PR.. 🤷♂️
I've rebased on main and squashed commits.. is there any chance to get this merged without the UI when it's not synchronized? @zerolab At least it fixes the exception when creating the translation.. I don't see how it would make anything worse..
Codecov Report
Attention: 2 lines in your changes are missing coverage. Please review.
Comparison is base (
e2de395) 93.27% compared to head (123f06d) 93.23%.
Additional details and impacted files
@@ Coverage Diff @@
## main #564 +/- ##
==========================================
- Coverage 93.27% 93.23% -0.04%
==========================================
Files 47 47
Lines 3908 3918 +10
Branches 579 583 +4
==========================================
+ Hits 3645 3653 +8
Misses 154 154
- Partials 109 111 +2
| Files | Coverage Δ | |
|---|---|---|
| wagtail_localize/test/models.py | 98.80% <100.00%> (+0.01%) |
:arrow_up: |
| wagtail_localize/fields.py | 91.22% <71.42%> (-1.37%) |
:arrow_down: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@hpoul now in https://github.com/wagtail/wagtail-localize/releases/tag/v1.6 sorry for the delay!