WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Missing verbose_name in model Meta classes - Django Admin shows untranslated model names #4193

@nichicom-yasutake

Description

@nichicom-yasutake

HINT: try to reproduce bugs and errors at https://public.tenant.kiwitcms.org!
This is always running the latest version and will automatically submit
traceback and debugging information to us!

Description of problem

Several models are missing verbose_name and verbose_name_plural in their Meta classes.
This causes model names to appear in English in Django Admin, even when the language is set to non-English (e.g., Japanese).

Version or commit hash (if applicable)

Latest version (tested on recent docker image)

Steps to Reproduce

  1. Set KIWI_LANGUAGE_CODE=ja (or any non-English
    language)
  2. Login as admin and go to /admin/
  3. Observe model names like "Components",
    "Classifications", "Products" are displayed in English

Actual results

Model names appear in English in Django Admin regardless
of language setting.

Example: "Components" instead of "コンポーネント"
(Japanese)

Expected results

Model names should be translated according to the language setting.

Additional info (Python traceback, logs, etc.)

The Priority model already has verbose_name_plural = _("Priorities") set correctly (line 73 in
tcms/management/models.py), so this pattern exists but is
not applied consistently.

Affected models (at minimum):

  • Component - tcms/management/models.py
  • Classification - tcms/management/models.py
  • Product - tcms/management/models.py
  • Version - tcms/management/models.py
  • Build - tcms/management/models.py

Suggested fix:
Add verbose_name and verbose_name_plural to each
model's Meta class:

class Meta:
    verbose_name = _("Component")
    verbose_name_plural = _("Components")

The translation strings already exist in the .po files
(e.g., "Components""コンポーネント" in ja_JP).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions