Skip to content

Adds Portuguese (Brazil) translations and add translation persistence feature + code couple more terms to i18n - #60

Open
filiperochalopes wants to merge 6 commits into
OpenConceptLab:mainfrom
filiperochalopes:feature/translation-pt-br-i18n
Open

filiperochalopes wants to merge 6 commits into
OpenConceptLab:mainfrom
filiperochalopes:feature/translation-pt-br-i18n

Conversation

@filiperochalopes

Copy link
Copy Markdown
Contributor

TL;DR: Adds Portuguese (Brazil) locale + i18n for event feed types & object types (refs ocl_issues#2866). Activity feed items like "Created Source Version", "Updated Collection" are now translatable instead of hardcoded EN.


Changes

Area Files Description
PT-BR locale src/i18n/locales/pt-BR/translations.json (new, 1159 lines) Full UI translation: common, dashboard, auth, concept, mapping, repository, org, user, search, import, clone, quota, etc.
Locale registration src/common/constants.js, src/i18n/config.js Added pt-BR to LANGUAGES and i18n resources
Event/Object type i18n src/i18n/locales/en/translations.json (+18), src/i18n/locales/pt-BR/translations.json Added common.event_types & common.object_types keys
Feed components src/components/common/Events.jsx, src/components/dashboard/DashboardEvents.jsx Now use t() for event types & object types with defaultValue fallback

Key Translation Decisions

EN Key PT-BR Note
Source Source Kept as-is (domain term for collection/repo type)
Source Version Versão do Source "do Source" not "da Fonte" per domain convention
Collection Coleção
Collection Version Versão da Coleção
Organization Organização
Concept Conceito
Mapping Mapeamento
Repository Repositório
Event types (created/updated/released/deleted/joined/source) Criado/Atualizado/Publicado/Excluído/Entrou/Fonte

Verification

npm run build && npm run lint
  • Language switcher → Português (Brasil) renders full UI in PT-BR
  • Dashboard → Activity Feed shows translated event types & object types
  • Events component (repo pages) same behavior
  • Unknown keys fall back to EN key (no crash)
  • EN locale unchanged (keys added to en/translations.json)

- Add pt-BR translation catalog with all English keys translated
- Register pt-BR in i18n config
- Add pt-BR to LANGUAGES in constants.js
- Add event_types and object_types to common translations (en and pt-BR)
- Update Events.jsx and DashboardEvents.jsx to translate event_type and referenced_object.type from API
* Implement the PT-BR locale configuration and language persistence logic

* Add translations for event and object types to both en and pt-BR locales

* Update event and object display components to utilize translated types
* Refactor event component to use targeted internationalization strings based on user ownership

* Added necessary translations for activity states in English, Spanish, Portuguese (Brazil), and Chinese locales
* Update Portuguese (Brazil) translations for user state changes, including followed and unfollowed states
* Updated Portuguese (Brazil) translations for event types in the i18n localization files

* Ensured that the translated terms accurately reflect the action (e.g., "Criou" instead of "Criado" for event creation)

This branch has not been deployed

No deployments
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.

1 participant