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

In /admin default language is selected to english on resource pages #562

Closed

Conversation

YashAgrawal9265
Copy link
Contributor

Description

In the admin interface, on resource pages, staff can select the language of fields they want to edit. 90% of the time we want to edit the English versions, so I have added English language as selected in the drop down by default.

Before Change:

2020-11-07 (1)

After Change:

2020-11-07

Rationale

Phabricator Ticket

https://phabricator.wikimedia.org/T240170

How Has This Been Tested?

Screenshots of your changes (if appropriate):

Types of changes

What types of changes does your code introduce? Add an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

@Samwalton9
Copy link
Member

Can I just confirm that when you open, for example, /admin/resources/partner/1/change/, the language selector at the top of the page defaults to English? That's not clear from the screenshots.

@YashAgrawal9265
Copy link
Contributor Author

I have checked, it is showing English by default..

2020-11-09

and when we click on + button then also it is showing English language by default.

2020-11-09 (1)

@Samwalton9
Copy link
Member

Samwalton9 commented Nov 16, 2020

Hi Yash,

Unfortunately this isn't quite what I had in mind with this ticket. When browsing a resource, there is a language selector at the top of the page:

Screenshot 2020-11-16 at 11 08 16

It's this selector (which is ar by default) which we want to default to English.

Sorry that my description on Phabricator wasn't clear enough, I can see how it was ambiguous!

@YashAgrawal9265
Copy link
Contributor Author

Hi Sam,
I got it.
So tell me that now I have to make it default as en or en-gb ?

@Samwalton9
Copy link
Member

en :)

@YashAgrawal9265
Copy link
Contributor Author

Hi Sam,
I am unable to find the Add Partner in Partner models. Can you help me?

2020-11-16 (1)_LI

2020-11-16 (3)

@YashAgrawal9265
Copy link
Contributor Author

Hi Sam,
Can you help me that, how I can access the language field which is beside of Add Partner, which I have marked in above image

@Samwalton9
Copy link
Member

@YashAgrawal9265 This isn't a model field, rather it's a capability added by the Modeltranslation application (https://django-modeltranslation.readthedocs.io/en/latest/).

I think this is the information you need on how to change the default, but I could be wrong: https://django-modeltranslation.readthedocs.io/en/latest/installation.html?highlight=default#modeltranslation-default-language

@YashAgrawal9265
Copy link
Contributor Author

@Samwalton9

2020-11-17

In settings.py the default language is already selected to the en by default.
According to me for solving this issue, changes should be done in translation.py file. I have tried some changes, but they are giving errors.
Can You help me out that what changes should I do in translation.py to solve the issue?

@Samwalton9
Copy link
Member

Hey Yash - I'm not sure how to proceed with this, it's clearly not something we can change easily in a configuration variable. I'd suggest you work on other tasks because this is a very low priority task for us and we don't have much bandwidth to provide help :)

@suecarmol
Copy link
Contributor

Since this task is a low priority and the team is focusing on other work, I am going to close this PR. Once we have more bandwidth to take a look at this, we can re-open this PR (or even create a new one).

@suecarmol suecarmol closed this Feb 17, 2021
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

Successfully merging this pull request may close these issues.

None yet

3 participants