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

Implemented Verbose Name Translation for TokenProxy #8713

Merged
merged 1 commit into from
Nov 27, 2022

Conversation

Giebisch
Copy link
Contributor

Added translation for verbose name of TokenProxy

Fixes Issue #8537

@@ -51,4 +51,5 @@ def pk(self):
class Meta:
proxy = 'rest_framework.authtoken' in settings.INSTALLED_APPS
abstract = 'rest_framework.authtoken' not in settings.INSTALLED_APPS
verbose_name = "token"
verbose_name = _("Token")
Copy link
Member

Choose a reason for hiding this comment

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

just to make sure, adding this two lines with modified values, is there any possible missing migrations?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As far as I understand it, no. Migrations only accept hard coded values, but since this is not one, a migration would not make sense. It must be created when the language is set.

Copy link
Member

Choose a reason for hiding this comment

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

the TokenProxy model is inheriting from https://github.com/encode/django-rest-framework/blob/master/rest_framework/authtoken/models.py#L27 but still not showing it properly, right?

Copy link
Member

Choose a reason for hiding this comment

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

from the migrations history https://github.com/encode/django-rest-framework/tree/master/rest_framework/authtoken/migrations it would be safer to check locally if new migrations are generated with this two attribute changes in meta. if not it is OK. but if so, we must have to ship it with the package :)

Copy link
Member

Choose a reason for hiding this comment

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

thanks for adding the missing auto migration

@@ -51,4 +51,5 @@ def pk(self):
class Meta:
proxy = 'rest_framework.authtoken' in settings.INSTALLED_APPS
abstract = 'rest_framework.authtoken' not in settings.INSTALLED_APPS
verbose_name = "token"
verbose_name = _("Token")
Copy link
Member

Choose a reason for hiding this comment

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

from the migrations history https://github.com/encode/django-rest-framework/tree/master/rest_framework/authtoken/migrations it would be safer to check locally if new migrations are generated with this two attribute changes in meta. if not it is OK. but if so, we must have to ship it with the package :)

@Giebisch Giebisch force-pushed the TranslationTokenProxy branch from 90e276b to be94cd6 Compare November 24, 2022 21:11
@Giebisch
Copy link
Contributor Author

@auvipy Can you help me out there for a second ? Do you know what went wrong with the Python 3.9 CI check? Can't quite figure it out

@auvipy
Copy link
Member

auvipy commented Nov 27, 2022

that is not related to this PR from what I have seen.

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.

2 participants