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

[1812] Rename the Translation Function #2209

Merged
merged 8 commits into from May 11, 2024

Conversation

Rixxan
Copy link
Contributor

@Rixxan Rixxan commented Apr 22, 2024

Description

Currently, the translation system works by forcing itself into Python's builtins. This is against current good practice, and can cause issues with identifying where functions come from, can cause issues with interoperability with plugins, and can introduce a number of issues in development with IDEs and debugging alongside pollution of the namespace.

This implements a conversion of the translation function away from using the builtins modules and into using the explicit singleton "translations" (shorthand: tr) for the translations (tr.tl). This also adopts modern Pythonic standards of renaming the _Translations() function to Translations(), and renaming the default singleton of Translations to translations.

The current singleton (Translations) is maintained, but marked as deprecated to be removed in 6.0 or later. Additionally, the class _Translations() is maintained and similarly marked as deprecated.

Type of change

  • Feature Enhancement
  • Code Cleanup

How Has This Been Tested?

  • Tested with builds of EDMC as well as plugins in various languages.

Resolves #1812

@Rixxan Rixxan added Translations code cleanup Cleaning up code python Pull requests that update Python code New User Experience ui User Interface Ready for Review PRs ready for review and merge labels Apr 22, 2024
@Rixxan Rixxan added this to the 5.11.0 milestone Apr 22, 2024
@Rixxan Rixxan requested a review from C1701D April 22, 2024 21:52
@Rixxan Rixxan self-assigned this Apr 22, 2024
@Rixxan Rixxan added this to In Progress in Enhancement Tracker via automation Apr 22, 2024
@Rixxan Rixxan marked this pull request as draft April 22, 2024 22:31
@Rixxan Rixxan marked this pull request as ready for review April 22, 2024 23:22
@Rixxan Rixxan linked an issue May 2, 2024 that may be closed by this pull request
@C1701D C1701D merged commit 7f06e37 into EDCD:develop May 11, 2024
1 check passed
Enhancement Tracker automation moved this from In Progress to Complete May 11, 2024
@C1701D C1701D deleted the enhancement/1812/rename_translations branch May 11, 2024 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code cleanup Cleaning up code New User Experience python Pull requests that update Python code Ready for Review PRs ready for review and merge Translations ui User Interface
Projects
Development

Successfully merging this pull request may close these issues.

Rename the _() translation function
2 participants