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

Update model field definitions to use gettext_lazy #13132

Closed
arthanson opened this issue Jul 10, 2023 · 0 comments
Closed

Update model field definitions to use gettext_lazy #13132

arthanson opened this issue Jul 10, 2023 · 0 comments
Assignees
Labels
topic: Internationalization type: housekeeping Changes to the application which do not directly impact the end user
Milestone

Comments

@arthanson
Copy link
Collaborator

Proposed Changes

In order to correctly support internationalization, models need to be audited and add in the name as gettext_lazy string and update verbose_name where applicable to use gettext_lazy. See Django's use at https://github.com/django/django/blob/main/django/contrib/auth/models.py#L356

    slug = models.SlugField(
        _("slug"), <- add this
        max_length=100
    )

Justification

Model fields need their name (and where appropriate their verbose_name) as translatable strings.

@arthanson arthanson added type: housekeeping Changes to the application which do not directly impact the end user topic: Internationalization labels Jul 10, 2023
@arthanson arthanson added this to the v4.0 milestone Jul 10, 2023
@arthanson arthanson self-assigned this Jul 10, 2023
jeremystretch added a commit that referenced this issue Jul 31, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 30, 2023
@jeremystretch jeremystretch modified the milestones: v4.0, v3.6 Jan 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
topic: Internationalization type: housekeeping Changes to the application which do not directly impact the end user
Projects
None yet
Development

No branches or pull requests

2 participants