Skip to content

Commit 70d22bb

Browse files
authored
Merge pull request #3656 from cassiano/adding-new-and-missing-translations
Adding new and missing translations for pt-BR and en-US locales, in particular for the new project visibility feature.
2 parents af3a38c + 266974f commit 70d22bb

File tree

6 files changed

+34
-16
lines changed

6 files changed

+34
-16
lines changed

client/i18n.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export function languageKeyToLabel(lang) {
7070
it: 'Italiano',
7171
ja: '日本語',
7272
ko: '한국어',
73-
'pt-BR': 'Português',
73+
'pt-BR': 'Português do Brasil',
7474
sv: 'Svenska',
7575
'uk-UA': 'Українська',
7676
'zh-CN': '简体中文',

client/modules/IDE/actions/project.js

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ export function deleteProject(id) {
413413
});
414414
};
415415
}
416-
export function changeVisibility(projectId, projectName, visibility) {
416+
export function changeVisibility(projectId, projectName, visibility, t) {
417417
return (dispatch, getState) => {
418418
const state = getState();
419419

@@ -443,11 +443,25 @@ export function changeVisibility(projectId, projectName, visibility) {
443443
name: response.data.name
444444
});
445445

446-
dispatch(
447-
setToastText(
448-
`${projectName} is now ${newVisibility.toLowerCase()}`
449-
)
450-
);
446+
let visibilityLabel;
447+
448+
switch (newVisibility) {
449+
case 'Public':
450+
visibilityLabel = t('Visibility.Public.Label');
451+
break;
452+
case 'Private':
453+
visibilityLabel = t('Visibility.Private.Label');
454+
break;
455+
default:
456+
visibilityLabel = newVisibility;
457+
}
458+
459+
const visibilityToastText = t('Visibility.Changed', {
460+
projectName,
461+
newVisibility: visibilityLabel.toLowerCase()
462+
});
463+
464+
dispatch(setToastText(visibilityToastText));
451465
dispatch(showToast(2000));
452466
}
453467
}

client/modules/IDE/components/Header/Toolbar.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ const Toolbar = (props) => {
3333
const dispatch = useDispatch();
3434
const { t } = useTranslation();
3535
const userIsOwner = user?.username === project.owner?.username;
36-
3736
const showVisibilityDropdown = project?.owner && userIsOwner;
3837

3938
const playButtonClass = classNames({
@@ -51,7 +50,7 @@ const Toolbar = (props) => {
5150

5251
const handleVisibilityChange = useCallback(
5352
(sketchId, sketchName, newVisibility) => {
54-
dispatch(changeVisibility(sketchId, sketchName, newVisibility));
53+
dispatch(changeVisibility(sketchId, sketchName, newVisibility, t));
5554
},
5655
[changeVisibility]
5756
);

client/modules/IDE/components/SketchListRowBase.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ const SketchListRowBase = ({
9191

9292
const handleVisibilityChange = useCallback(
9393
(sketchId, sketchName, newVisibility) => {
94-
changeVisibility(sketchId, sketchName, newVisibility);
94+
changeVisibility(sketchId, sketchName, newVisibility, t);
9595
},
9696
[changeVisibility]
9797
);

translations/locales/en-US/translations.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
"Reference": "Reference",
3030
"About": "About",
3131
"ReportBug": "Report a Bug",
32-
"ChatOnDiscord":"Chat On Discord",
33-
"PostOnTheForum":"Post on the Forum"
32+
"ChatOnDiscord": "Chat On Discord",
33+
"PostOnTheForum": "Post on the Forum"
3434
},
3535
"Lang": "Language",
3636
"BackEditor": "Back to Editor",
@@ -690,6 +690,7 @@
690690
"Private": {
691691
"Description": "Only you can see this sketch.",
692692
"Label": "Private"
693-
}
693+
},
694+
"Changed": "'{{projectName}}' is now {{newVisibility}}..."
694695
}
695696
}

translations/locales/pt-BR/translations.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@
2727
"Title": "Ajuda",
2828
"KeyboardShortcuts": "Atalhos de Teclado",
2929
"Reference": "Referência",
30-
"About": "Sobre"
30+
"About": "Sobre",
31+
"ReportBug": "Reportar um Erro",
32+
"ChatOnDiscord": "Conversar no Discord",
33+
"PostOnTheForum": "Postar no Fórum"
3134
},
3235
"BackEditor": "Voltar ao Editor",
3336
"WarningUnsavedChanges": "Realmente quer sair da página? Há mudanças não salvas.",
@@ -208,7 +211,7 @@
208211
"AutocompleteHinterOnARIA": "Geração de dicas do Autocompleter ativada",
209212
"AutocompleteHinterOffARIA": "Geração de dicas do Autocompleter desativada",
210213
"LibraryVersion": "Versão do p5.js",
211-
"LibraryVersionInfo": "Há uma [nova versão 2.0](https://github.com/processing/p5.js/releases/) do p5.js disponível! Ela se tornará padrão em agosto de 2026, então aproveite este tempo para testá-la e relatar bugs. Está interessado em transitar esboços de 1.x para 2.0? Confira os [recursos de compatibilidade e transição.](https://github.com/processing/p5.js-compatibility)",
214+
"LibraryVersionInfo": "Há uma [nova versão 2.0](https://github.com/processing/p5.js/releases/) do p5.js disponível! Ela se tornará padrão em agosto de 2026, então aproveite este tempo para testá-la e relatar erros. Está interessado em migrar esboços de 1.x para 2.0? Confira os [recursos de compatibilidade e migração.](https://github.com/processing/p5.js-compatibility)",
212215
"CustomVersionTitle": "Gerenciando suas próprias bibliotecas? Legal!",
213216
"CustomVersionInfo": "A versão do p5.js está atualmente sendo gerenciada no código do index.html. Isso significa que não pode ser ajustada a partir desta aba.",
214217
"CustomVersionReset": "Se você gostaria de usar as bibliotecas padrão, pode substituir as tags de script no index.html pelo seguinte:",
@@ -621,6 +624,7 @@
621624
"Private": {
622625
"Description": "Apenas você pode ver este esboço.",
623626
"Label": "Privado"
624-
}
627+
},
628+
"Changed": "'{{projectName}}' agora é {{newVisibility}}..."
625629
}
626630
}

0 commit comments

Comments
 (0)