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
Making File fields (name, description, etc.) translatable #494
Comments
I have this mostly implemented at skirsdeda/django-filer@9745bf6 |
I'm on the fence with this one. Translatable metadata has come up before. But I'd prefer to avoid the complexity and the performance hit that supporting multiple languages brings with it. |
@stefanfoulis how about making the File model abstract, and ship an (optional) model with translated fields? |
@stefanfoulis with django-parler there's not so much complexity. The only semi-clumsy thing is working with Admin classes which don't know about translated fields at one point or another. Otherwise, it's just one table join for selects and you can still use ORM the same way only by changing field references from e.g. name to translations__name. So it's very transparent IMHO. |
Any movement here? Are these Filer fields translatable now? @skirsdeda How did you solve this for yourself? Did you implement this with Parler? |
@maltebeckmann I have done this with Parler. You can fetch my repo branch and see for yourself. It's based on filer-1.0.4 but should be easy to rebase with some effort. |
@skirsdeda Cheers! |
I have a plan to make an "official" effort on this topic. This won't require any change to filer core. I'll need two or three weeks to be able to share a working example |
@yakky any progress on this ? I might need this in the coming weeks - how can I help? |
Any progress? |
@yakky would you solve this using django-parler, or what do you mean with?
|
In my opinion, the 'description', 'alt text' and 'caption' fields should be removed completely. They make little sense without the possibility to translate. As a workaround, in any plugins that use for example the filer image field, a caption text field can be added alongside the filer image field. The only use case that cannot easily be worked around is when using the filer folder field. Where can multi-language caption texts for each item inside that folder be gotten from? |
any news on this? |
@skirsdeda Please tell me where can I get these changes for further revision? |
…meta' into feature/add-translations django-cms#494
How about a different proposal: I'm somehow reluctant to add a third-party dependency (django-parler) from which only a few power users will benefit. In my opinion, the major part of users of django-filer don't need translatable file names. Adding translatable strings using a JSONField becomes quite simple and doesn't require any table joins when querying. It also makes adding future attributes much simpler than overriding the File or Image model. A few packages which may help: We should proceed with this discussion on https://django-cmsworkspace.slack.com/archives/C01DX920K60 |
Interesting proposal. I also think that adding a new dependency is not a good idea. How about make an integration application django-filer-parler and move to it all dependencies? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This will now be closed due to inactivity, but feel free to reopen it. |
I need to have translations for File.name, File.description and for BaseImage.default_alt_text/default_caption.
I am using django-parler, which plays nice with django-polymorphic and such and is very clean and interoperable (as opposed to django-hvad for example).
My initial approach was to create a translated File model and custom image model with mentioned fields as translated fields. The problem is that django-parler is unable to redefine existing fields (due to django model metaclass limitations), so the only way is to create those fields with different names. But in that case I would have a very messy solution and I would have to fix various filer views, etc.
This is the code:
So my question is: would you consider making filer models translatable by default and pulling django-parler in as a dependency? I will do this anyway, but I don't want my solution to be fork-only. Any suggestions?
The text was updated successfully, but these errors were encountered: