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

PR: Fix interface language auto-configuration #21451

Merged
merged 2 commits into from Oct 26, 2023

Conversation

sthibaul
Copy link
Contributor

@sthibaul sthibaul commented Oct 24, 2023

Description of Changes

  • [N/A] Wrote at least one-line docstrings (for any new functions)
  • [N/A] Added unit test(s) covering the changes (if testable)
  • [N/A] Included a screenshot or animation (if affecting the UI, see Licecap)

The autoconfiguration of the language is currently completely broken: when starting spyder on a e.g. french-installed OS, spyder still displays english by default.

This is because spyder/config/base.py's get_available_translations() currently always return ['en'], because LANGUAGE_CODES is currently missing a few cases of spyder/locale/. One can of course just add the missing cases, but better just at least support autoconfiguring the cases which are in LANGUAGE_CODES rather than breaking them all (Except for developers, which do need to take notice of this).

Affirmation

By submitting this Pull Request or typing my (user)name below,
I affirm the Developer Certificate of Origin
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.

I certify the above statement is true and correct:

Samuel Thibault

@sthibaul sthibaul force-pushed the master branch 2 times, most recently from 644b0c3 to 32f72bd Compare October 24, 2023 11:14
@sthibaul
Copy link
Contributor Author

(I'd argue that this is a very problematic bug, when we are trying to convince our thousands of students that yes, spyder is a good IDE for programming in python)

Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @sthibaul, thanks a lot for your contribution! We were not aware of it this problem (we always test Spyder in English) and it's even better that you've provided a fix for it too!

I left a small comment below, the rest looks good to me. And we'll include your fix in our next version (5.5.0), to be released next week.

spyder/config/base.py Show resolved Hide resolved
@ccordoba12
Copy link
Member

Note: I'm marking this for Spyder 6 because you did your pull request against our master branch. But we'll backport it to our 5.x one to include it in 5.5.

@ccordoba12 ccordoba12 changed the title Fix language autoconfiguration PR: Fix language auto-configuration Oct 26, 2023
When LANGUAGE_CODES is missing a case, get_available_translations() would be
returning just ['en'], which breaks language autoconfiguration for all the
cases that are indeed in LANGUAGE_CODES. Better annoy only developers about
this and return the languages which are indeed in LANGUAGE_CODES, so
that language autoconfiguration does work for those.
Addition to LANGUAGE_CODES and DISABLED_LANGUAGES was missed.
Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again @sthibaul for your contribution!

@ccordoba12 ccordoba12 changed the title PR: Fix language auto-configuration PR: Fix interface language auto-configuration Oct 26, 2023
@ccordoba12 ccordoba12 merged commit 22ac3e5 into spyder-ide:master Oct 26, 2023
14 checks passed
ccordoba12 added a commit to ccordoba12/spyder that referenced this pull request Oct 26, 2023
ccordoba12 added a commit to ccordoba12/spyder that referenced this pull request Oct 28, 2023
ccordoba12 added a commit that referenced this pull request Oct 28, 2023
PR: Backport PR #21451 (Fix interface language auto-configuration)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants