Skip to content

Ensure texts are marked for translation/internationalization#1394

Merged
robertatakenaka merged 9 commits intomainfrom
copilot/add-internationalization-tags
Mar 11, 2026
Merged

Ensure texts are marked for translation/internationalization#1394
robertatakenaka merged 9 commits intomainfrom
copilot/add-internationalization-tags

Conversation

Copy link
Contributor

Copilot AI commented Mar 10, 2026

O que esse PR faz?

Marca textos que estavam hardcoded para tradução/internacionalização usando _() em Python e {% trans %} em templates, e adiciona traduções para pt_BR, es e en.

Python (_()):

  • wagtail_hooks.py — 7 menu_label sem _() em 4 apps (journal, core, institution, location)
  • models.py — ~20 strings (verbose_name, help_text, field labels) em 9 apps
  • choices.pyOA_STATUS, COINS (journal), regions (location)

Templates ({% trans %}):

  • Error pages: 403.html, 404.html, 500.html
  • search/search.html, users/user_form.html, users/user_detail.html
  • home/about_scielo_org_page.html, home/scieloorg/tabs.html

Locale:

  • makemessages --all para atualizar .po com novos termos
  • Traduções completas para pt_BR, es e en
  • .mo compilados

Onde a revisão poderia começar?

journal/wagtail_hooks.py e journal/choices.py — exemplificam o padrão aplicado nos demais arquivos.

Como este poderia ser testado manualmente?

  1. Iniciar o servidor com LANGUAGE_CODE = "en" e verificar que os menus do Wagtail admin exibem os labels em inglês (ex: "List of codes", "Indexed At Upload")
  2. Acessar /404 e confirmar que o texto aparece traduzido conforme o idioma ativo
  3. Alternar idioma para es ou pt-br e verificar que as páginas de erro, busca e formulários de usuário exibem textos traduzidos

Algum cenário de contexto que queira dar?

Exemplo de antes/depois:

# Antes
menu_label = "AM Journal"
help_text = "Dia de publicação no site."

# Depois
menu_label = _("AM Journal")
help_text = _("Dia de publicação no site.")
<!-- Antes -->
<h1>Page not found</h1>

<!-- Depois -->
{% load i18n %}
<h1>{% trans "Page not found" %}</h1>

Screenshots

N/A — mudanças apenas em marcação i18n, sem alteração visual no idioma padrão (pt-br).

Quais são tickets relevantes?

N/A

Referências

Original prompt

This section details on the original issue you should resolve

<issue_title>Garanta que o textos estejam marcados para tradução / internacionalização</issue_title>
<issue_description>### Descrição da tarefa
Garanta que o textos estejam marcados para tradução / internacionalização, seja com _() ou {%trans}.

Subtarefas

  • Adicione as marcas de tradução no código python
  • Adicione as marcas de tradução nos templates html
  • Adicione novos termos nos arquivos locale//.po
  • Complete as traduções</issue_description>

<agent_instructions>realize commits atômicos</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 6 commits March 10, 2026 11:57
Co-authored-by: robertatakenaka <505143+robertatakenaka@users.noreply.github.com>
…models.py files

Co-authored-by: robertatakenaka <505143+robertatakenaka@users.noreply.github.com>
Co-authored-by: robertatakenaka <505143+robertatakenaka@users.noreply.github.com>
…mplates)

Co-authored-by: robertatakenaka <505143+robertatakenaka@users.noreply.github.com>
Co-authored-by: robertatakenaka <505143+robertatakenaka@users.noreply.github.com>
Co-authored-by: robertatakenaka <505143+robertatakenaka@users.noreply.github.com>
Copilot AI changed the title [WIP] Ensure texts are marked for translation and internationalization Ensure texts are marked for translation/internationalization Mar 10, 2026
@robertatakenaka robertatakenaka requested a review from Copilot March 10, 2026 19:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR standardizes internationalization across the Django/Wagtail project by marking previously hardcoded UI strings for translation (Python _() and Django templates {% trans %}) and updating compiled locale catalogs for pt_BR, es, and en.

Changes:

  • Wrapped Wagtail admin menu labels, model verbose_name/help_text, and choice labels with gettext_lazy (_()).
  • Added {% load i18n %} / {% trans %} in user-facing templates (error pages, search, user pages, SciELO.org pages).
  • Updated compiled translation catalogs (django.mo) for en and es.

Reviewed changes

Copilot reviewed 23 out of 29 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
location/wagtail_hooks.py Marks Wagtail snippet menu label for translation.
location/choices.py Adds gettext_lazy and marks region labels for translation.
locale/es/LC_MESSAGES/django.mo Updates compiled Spanish translations.
locale/en/LC_MESSAGES/django.mo Updates compiled English translations.
journal/wagtail_hooks.py Marks snippet menu labels for translation in the Journal admin area.
journal/models.py Marks model verbose_name/verbose_name_plural for translation.
journal/choices.py Marks OA status and currency choice labels for translation.
issue/models.py Marks field help_text for translation.
institution/wagtail_hooks.py Marks Wagtail ModelAdmin menu label for translation.
institution/models.py Marks URL field label for translation.
doi/models.py Marks M2M field verbose_name for translation.
core/wagtail_hooks.py Marks Wagtail SnippetViewSetGroup menu label for translation.
core/users/models.py Marks user name field verbose names for translation.
core/templates/users/user_form.html Adds i18n tag library and translates submit button label.
core/templates/users/user_detail.html Adds i18n tag library and translates page labels/buttons.
core/templates/search/search.html Adds i18n tag library and translates search UI strings/pagination.
core/templates/home/scieloorg/tabs.html Translates search input placeholder/aria-label.
core/templates/home/about_scielo_org_page.html Translates search results and redirect UI strings.
core/templates/500.html Translates 500 error page strings.
core/templates/404.html Translates 404 error page strings.
core/templates/403.html Translates 403 error page strings.
core/models.py Marks VisualIdentityMixin URL label for translation.
core/home/models.py Marks page verbose names/help_text/messages for translation.
book/models.py Marks ISBN/DOI field labels for translation.
article/models.py Marks publication date help_text strings for translation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

robertatakenaka and others added 2 commits March 10, 2026 20:42
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@robertatakenaka robertatakenaka marked this pull request as ready for review March 10, 2026 23:43
@robertatakenaka robertatakenaka merged commit 1aa0cc4 into main Mar 11, 2026
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Garanta que o textos estejam marcados para tradução / internacionalização

3 participants