Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 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
ca4024e
feat(i18n): refine profile translation strings
filiperochalopes Oct 6, 2026
8f45046
feat(i18n): update pt-BR translations and glossary adherence
filiperochalopes Oct 7, 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;
3 changes: 1 addition & 2 deletions src/i18n/locales/en/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,7 @@
"bio": "Short bio",
"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"
"user_has_not_created_public_repos_suffix": "has not created any public repositories"
},
"search": {
"filters": "Filters",
Expand Down
3 changes: 1 addition & 2 deletions src/i18n/locales/es/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,7 @@
"bio": "Biografía corta",
"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"
"user_has_not_created_public_repos_suffix": "no ha creado repositorios públicos"
},
"search": {
"filters": "Filtros",
Expand Down
Loading
Loading