Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
870b4a1
feat: Add Portuguese (Brazil) translation for OCL Mapper
filiperochalopes Oct 1, 2026
e5d4d5d
feat(i18n): add Portuguese (Brazil) translation support
filiperochalopes Oct 2, 2026
b05133c
feat(i18n): support recent activity translations
filiperochalopes Oct 3, 2026
8bced0b
fix(i18n): change Excluir to Desconsiderar for mapping decision exclude
filiperochalopes Oct 5, 2026
8ba9f5b
fix(i18n): change matching_algorithm to Algoritmo de correspondência
filiperochalopes Oct 5, 2026
d2bfac4
fix(i18n): fix concurrent_requests spelling (Concurrentes → Simultâneas)
filiperochalopes Oct 5, 2026
c3835e6
fix(i18n): change source_code to Código de Origem
filiperochalopes Oct 5, 2026
a00efd4
fix(i18n): remove duplicate proposed_successfully key
filiperochalopes Oct 5, 2026
84c4530
fix(i18n): change delete to exclua in preview_limit_body_projects
filiperochalopes Oct 5, 2026
d24e959
fix(i18n): change algorithm_es_label to use Elasticsearch product name
filiperochalopes Oct 5, 2026
3358a2a
fix(i18n): fix preview_limit_notify_me grammar
filiperochalopes Oct 5, 2026
4c2dbee
fix(i18n): fix algo_canonical_url_description preposition
filiperochalopes Oct 5, 2026
be4a6fa
fix(i18n): add missing scispacy preview limit keys
filiperochalopes Oct 5, 2026
de80cd9
fix(i18n): fix bulk_confirm_body assembled text
filiperochalopes Oct 5, 2026
9d08aac
fix(i18n): change common.at from às to em
filiperochalopes Oct 5, 2026
00fb2b6
fix(i18n): remove 'em' from last_saved
filiperochalopes Oct 5, 2026
2871616
fix(i18n): fix error page assembled text fragments
filiperochalopes Oct 5, 2026
62960c6
fix(i18n): fix common.for and common.please for error pages
filiperochalopes Oct 5, 2026
11c9ec3
fix(i18n): fix org_have_not_created_public_repos_suffix verb agreement
filiperochalopes Oct 5, 2026
23f63a1
fix(i18n): fix resolve_success_with_entry placeholder order
filiperochalopes Oct 5, 2026
134fec2
fix(i18n): fix resolve_failed placeholder order
filiperochalopes Oct 5, 2026
26d14c3
fix(i18n): change first_name/last_name to Nome/Sobrenome
filiperochalopes Oct 5, 2026
ca575ee
fix(i18n): change preview_quota_tooltip_title permissao to cota
filiperochalopes Oct 5, 2026
9554b19
fix(i18n): change preview_limit_body_rows_not_entitled_no_count permi…
filiperochalopes Oct 5, 2026
1ac5cab
fix(i18n): change stopping_gracefully to Encerrando com segurança
filiperochalopes Oct 5, 2026
25e2f8a
fix(i18n): rewrite preview_limit_hardship_note for grant funding context
filiperochalopes Oct 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
584 changes: 288 additions & 296 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/common/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ export const OCL_CLIENT = `oclmap/${packageJson.version}`;
export const LANGUAGES = [
{locale: 'en', name: 'English'},
{locale: 'es', name: "Español"},
{locale: 'zh', name: "中文"}
{locale: 'zh', name: "中文"},
{locale: 'pt-BR', name: "Português (Brasil)"}
]


Expand Down
32 changes: 30 additions & 2 deletions src/i18n/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,34 @@ import { initReactI18next } from 'react-i18next';
import en from './locales/en/translations.json'
import es from './locales/es/translations.json'
import zh from './locales/zh/translations.json'
import ptBR from './locales/pt-BR/translations.json'

const LANGUAGE_STORAGE_KEY = 'ocl.language'
const SUPPORTED_LANGUAGES = ['en', 'es', 'zh', 'pt-BR']

const getInitialLanguage = () => {
if(typeof window === 'undefined')
return 'en'

try {
const storedLanguage = window.localStorage.getItem(LANGUAGE_STORAGE_KEY)
return SUPPORTED_LANGUAGES.includes(storedLanguage) ? storedLanguage : 'en'
} catch(_) {
return 'en'
}
}

const persistLanguage = language => {
try {
window.localStorage.setItem(LANGUAGE_STORAGE_KEY, language)
} catch(_) {
// Keep i18n usable when browser storage is unavailable.
}
}

i18n.use(initReactI18next).init({
fallbackLng: 'en',
lng: 'en',
lng: getInitialLanguage(),
resources: {
en: {
translations: en
Expand All @@ -16,13 +40,17 @@ i18n.use(initReactI18next).init({
},
zh: {
translations: zh
},
'pt-BR': {
translations: ptBR
}
},
ns: ['translations'],
defaultNS: 'translations',
interpolation: { escapeValue: false }
});

i18n.languages = ['en', 'es', 'zh'];
i18n.languages = SUPPORTED_LANGUAGES;
i18n.on('languageChanged', persistLanguage)

export default i18n;
4 changes: 3 additions & 1 deletion src/i18n/locales/en/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,9 @@
"about_me": "About me",
"about_me_description": "Create an introduction for visiting your profile (200 characters).",
"user_has_not_created_public_repos_suffix": "has not created any public repositories",
"recent_activity": "recent activity"
"recent_activity": "recent activity",
"own_recent_activity": "Your recent activity",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

these two translation keys are not used anywhere in this project

@filiperochalopes filiperochalopes Oct 5, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Complete analysis of unused i18n keys (228 of 752 = 30.3%)

These keys exist in src/i18n/locales/en/translations.json but are not referenced anywhere in the codebase (neither via t(), nor template strings, nor i18nKey in the Trans component).

They appear to have been copied from oclweb3 (just like I did with some recent keys).

By namespace/scope:

common (50) - single words and rarely used variants

common.a, common.an, common.for, common.from, common.with
common.action, common.about, common.access_level, common.attribute
common.clear, common.content_summary, common.create, common.created
common.created_on, common.custom_attributes, common.draft
common.group, common.highlights, common.history, common.import
common.json, common.languages, common.last_updated_on, common.less
common.manage, common.metadata, common.navigate, common.ok
common.open, common.overview, common.preferred_language, common.private
common.public, common.read_less, common.read_more, common.resolve
common.result, common.select, common.short_code, common.sort
common.statistics, common.subscribed, common.summary, common.target
common.updated_on, common.upload, common.value, common.versions
common.view_all_attributes

repo (44) - advanced repository configuration (auto-ID, metadata, comparison)

repo.add_concept, repo.autoid_concept_description_external_id
repo.autoid_concept_external_id, repo.autoid_concept_mnemonic
repo.autoid_concept_name_external_id, repo.autoid_mapping_external_id
repo.autoid_mapping_mnemonic, repo.case_sensitive, repo.collection_type
repo.compare, repo.compare_destination_version_disabled_tooltip
repo.compare_origin_version_disabled_tooltip, repo.compare_versions
repo.compositional, repo.contact, repo.content_type, repo.copyright
repo.custom_validation_schema, repo.experimental, repo.hierarchy_meaning
repo.identifier, repo.jurisdiction, repo.locale, repo.locales
repo.manage, repo.no_overview, repo.property, repo.publisher
repo.purpose, repo.refresh_summary, repo.release_status, repo.repo_id
repo.repo_summary_is_calculating, repo.repo_type, repo.repo_version_summary
repo.revision_date, repo.source_type, repo.summary_active_concepts_from_total
repo.summary_active_mappings_from_total, repo.summary_concepts_references
repo.summary_mappings_references, repo.summary_released_versions_from_total
repo.version_needed, repo.visibility

map_project (34) - premium algorithms, preview settings, limit UI

map_project.ai_assistant_limit_reached
map_project.algorithm_custom_description, map_project.algorithm_custom_label
map_project.algorithm_es_label, map_project.algorithm_llm_label
map_project.auto_match_note_no_counts, map_project.auto_matched
map_project.bridge_terminology_search, map_project.bridge_terminology_search_description
map_project.bulk_clear_selection, map_project.ciel_bridge_terminology_candidates
map_project.custom_match_api, map_project.custom_match_api_description
map_project.delete_this_project, map_project.enable_reranker
map_project.include_retired, map_project.lookup_required, map_project.map_target
map_project.match_api_token, map_project.match_api_token_placeholder
map_project.match_api_url, map_project.match_api_url_placeholder
map_project.ocl_ciel_bridge_algorithm, map_project.ocl_custom_algorithm
map_project.ocl_scispacy_loinc_algorithm
map_project.preview_quota_ai_calls, map_project.preview_quota_match_operations
map_project.preview_quota_projects, map_project.rows_per_match_api
map_project.save_this_project_to_collection, map_project.scispacy_loinc_search
map_project.select_an_algorithm, map_project.show_more
map_project.target_repo_required_on_load

user (33) - profile, avatar, bio, account settings

user.about_me, user.about_me_description, user.avatar, user.bio
user.company, user.company_name, user.copy_api_token, user.copy_token_success
user.edit_my_profile, user.email, user.email_address, user.first_name
user.joined_on, user.last_login, user.last_name, user.location
user.login_and_security, user.my_bookmarks, user.my_organizations
user.name_and_description, user.own_recent_activity, user.password
user.profile_update_failure, user.profile_update_success
user.recent_activity, user.recent_activity_of, user.update_avatar
user.user, user.user_has_not_created_public_repos_suffix, user.username
user.users, user.website, user.your

url_registry (14) - canonical URL registry

search (12) - display variants (card/table, placeholders)

mapping (11) - mapping types and sources

dashboard (8) - homepage/dashboard

org (6) - organizations

concept (8) - classes, namespaces, bridge tabs

auth (4) - auth flows (verified email, expired session)

bookmarks (3) - bookmarks functionality

custom_attributes (1)

Important notes

  • common.go_back_or_to_your_dashboard - IS used via i18nKey in Error403.jsx
  • 6 map_project.* keys - ARE used via i18nKey:
    • map_project.matching_algorithm_description (ConfigurationForm)
    • map_project.delete_map_project_confirm + delete_map_project_type_to_confirm (DeleteConfirmDialog)
    • map_project.created_by_log (ProjectLogs)
    • map_project.transform_to_extensional_tooltip_2 + concepts_will_be_added_to_this_collection (ImportToCollection)
  • Dynamic keys captured: t(search.${resource}), t(map_project.preview_limit_title_${kind}), t('map_project.' + qualityBucket), ternary t(isCap ? 'quota.title_cap' : 'quota.title_quota')

Suggestion

Removing these 228 keys from translations.json (and corresponding PT-BR files) would reduce the translation bundle by ~30% and avoid unnecessary translation work. Many appear to be legacy from oclweb3 that were never integrated into the mapper.

Regarding the keys at lines 341-343 (user.recent_activity, user.own_recent_activity, user.recent_activity_of): confirmed as unused - the code uses user.recent_activity only as a static label in some places, but these 3 specific keys are not called via t().

@filiperochalopes filiperochalopes Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed, but pending the others OpenConceptLab/ocl_issues#2880

"recent_activity_of": "{{name}}'s recent activity"
},
"search": {
"filters": "Filters",
Expand Down
4 changes: 3 additions & 1 deletion src/i18n/locales/es/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,9 @@
"about_me": "Acerca de mí",
"about_me_description": "Crea una introducción para quienes visitan tu perfil (200 caracteres).",
"user_has_not_created_public_repos_suffix": "no ha creado repositorios públicos",
"recent_activity": "actividad reciente"
"recent_activity": "actividad reciente",
"own_recent_activity": "Tu actividad reciente",
"recent_activity_of": "Actividad reciente de {{name}}"
},
"search": {
"filters": "Filtros",
Expand Down
Loading
Loading