Skip to content

Commit 5250868

Browse files
committed
Adding new and missing translations for pt-BR and en-US locales
1 parent 1fab3ad commit 5250868

File tree

5 files changed

+23
-15
lines changed

5 files changed

+23
-15
lines changed

client/modules/IDE/actions/project.js

Lines changed: 10 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,15 @@ 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+
const visibilityToastText = t('Visibility.Changed', {
447+
projectName,
448+
newVisibility:
449+
newVisibility === 'Public'
450+
? t('Visibility.Public.Label').toLowerCase()
451+
: t('Visibility.Private.Label').toLowerCase()
452+
});
453+
454+
dispatch(setToastText(visibilityToastText));
451455
dispatch(showToast(2000));
452456
}
453457
}

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 Bug",
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 bugs. 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)