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

Multilingual label and description fields #14

Open
majdal opened this issue Apr 27, 2021 · 2 comments
Open

Multilingual label and description fields #14

majdal opened this issue Apr 27, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@majdal
Copy link

majdal commented Apr 27, 2021

Thanks for the great work on this package!

I am working on a multilingual application that needs multilingual controlled vocabulary. django-controlled-vocabulary does exactly what I need, except that I want the label and description fields of the terms to be in both Arabic and English.

A possible solution is to use django-modeltranslation to translates the fields. Is that advisable?

@geoffroy-noel-ddh
Copy link
Member

Hi @majdal , thanks for your interest in the package!

I just had a quick look at django-modeltranslation as I wasn't aware of it and it looks relatively straightforward to support: essentially adding a translation.py in the app then (hopefully) the admin and the rest for work automatically.

I'm busy with other projects at the moment so it might take me some time to implement & test the changes. But feel free to discuss here, fork and submit a pull request if you need this soon.

@geoffroy-noel-ddh geoffroy-noel-ddh self-assigned this Apr 28, 2021
@geoffroy-noel-ddh geoffroy-noel-ddh added the enhancement New feature or request label Apr 28, 2021
@majdal
Copy link
Author

majdal commented Feb 6, 2022

Hello hello - I tried to implement the solution, but ran into the following problem: deschler/django-modeltranslation#628

The write_vocabulary_records_from_managers() function in ControlledVocabularyConfig class is where the problem lies.

Thinking of solutions: The only place when this problem would be encountered is at the beginning, when adding new languages to be translated. So maybe there should be a check if new languages were added, and act accordingly to that? Alternatively the whole write_vocabulary_records_from_managers function could be run more selectively, instead of being called every time on ready?

Once we think of a good solution, I'll update the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants