Skip to content

Commit

Permalink
ui: Update translations
Browse files Browse the repository at this point in the history
Add translations for notification pagination
Created one language entry for succeed snackbar messages
Changed wording from projected budget to total budget on project level
Adapt e2e-tests
  • Loading branch information
Stezido committed Nov 11, 2020
1 parent ccfd1c7 commit 8a0e089
Show file tree
Hide file tree
Showing 14 changed files with 198 additions and 137 deletions.
4 changes: 2 additions & 2 deletions e2e-test/cypress/integration/documents_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ describe("Attaching a document to a workflowitem.", function() {
// make sure the validation was successful:
cy.wait("@validate")
.get(`button[label="Validated!"] > span`)
.should("contain", "OK");
.should("contain", "Identical");
});

it("Validation of wrong document fails.", function() {
Expand Down Expand Up @@ -134,6 +134,6 @@ describe("Attaching a document to a workflowitem.", function() {
// make sure the validation was not successful:
cy.wait("@validate")
.get(`button[label="Changed!"] > span`)
.should("contain", "Not OK");
.should("contain", "Different");
});
});
15 changes: 13 additions & 2 deletions frontend/src/languages/english.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ const en = {
subproject_currency: "Subproject currency",
subproject_edit_title: "Edit subproject",
subproject_permissions_title: "Set permissions for subproject",
subproject_permissions_warning: "No permissions allocated for the subproject {0}",
subproject_preview: "Subproject preview",
subproject_select_button: "Select",
subproject_title_description: "Name of the subproject",
Expand Down Expand Up @@ -271,7 +270,6 @@ const en = {
workflow_no_documents: "No documents",
workflow_none: "None",
workflow_permissions_title: "Set permissions for workflowitem",
workflow_permissions_warning: "No permissions allocated for the workflowitem {0}",
workflow_redacted: "Redacted",
workflow_selection: "{0} workflowitems are selected",
workflow_submit_for_review: "Submit for Review",
Expand All @@ -292,6 +290,16 @@ const en = {
"When assigning a restricted workflowitem permissions are automatically granted and revoked. The assigner will only keep the view permissions."
},

snackbar: {
update_succeed_message: "Successfully modified {0}",
creation_succeed_message: "Successfully created {0}",
permissions_warning: "No permissions allocated for {0}"
},

searchBar: {
quick_search: "Quick search"
},

preview: {
actions_done: "{0} from {1} actions done",
assign_action_text: "assign {0}",
Expand Down Expand Up @@ -399,6 +407,7 @@ const en = {
edit_transaction: "Transaction {0} got adapted",
edit_workflow: "Workflowitem {0} got adapted",
email_saved: "Email {0} saved",
next_page: "Next page",
no_permissions: "(No permissions to see further details)",
notification_card_text:
"Please find your current notifications below. These display action items or information items to be dealt with.",
Expand All @@ -411,6 +420,7 @@ const en = {
notification_table_subproject: "Subproject",
notification_table_view: "View",
notification_title: "Notifications",
previous_page: "Previous page",
project_archive: "Project {0} was archived",
project_assign: "Project {0} was assigned to you",
project_assigned: "Project {0} was assigned to you",
Expand All @@ -426,6 +436,7 @@ const en = {
read_all: "Read All",
review_transaction: "You are assigned to review the transaction {0}",
review_workflow: "You are assigned to review the workflowitem {0}",
rows_per_page: "Rows per page",
save_email_error: "Couldn't save email",
subproject_archive: "Subproject {0} was archived",
subproject_assign: "Subproject {0} was assigned to you",
Expand Down
229 changes: 120 additions & 109 deletions frontend/src/languages/french.js

Large diffs are not rendered by default.

15 changes: 13 additions & 2 deletions frontend/src/languages/georgian.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ const ka = {
subproject_currency: "ქვეპროექტის ვალუტა",
subproject_edit_title: "ქვეპროექტის რედაქტირება",
subproject_permissions_title: "ქვეპროექტის უფლებამოსილებების განსაზღვრა",
subproject_permissions_warning: "ქვეპროექტისთვის არ არის გამოყოფილი ნებართვა {0}",
subproject_preview: "Subproject preview",
subproject_select_button: "არჩევა",
subproject_title_description: "ქვეპროექტის სახელწოდება",
Expand Down Expand Up @@ -273,7 +272,6 @@ const ka = {
workflow_no_documents: "არ შეიცავს დოკუმენტებს",
workflow_none: "None",
workflow_permissions_title: "Workflowitem-თან დაკავშირებით უფლებამოსილების მინიჭება",
workflow_permissions_warning: "არ არის გამოყოფილი ნებართვა სამუშაო ნაკადის ნივთზე {0}",
workflow_redacted: "Redacted",
workflow_selection: "{0} Workflowitem-ები არჩეულია",
workflow_submit_for_review: "განსახილველად გადაგზავნა",
Expand All @@ -294,6 +292,16 @@ const ka = {
"შეზღუდული სამუშაო ნაკადის გადაცემისას ნებართვები ავტომატურად გაიცემა და გაუქმებულია. დავალება მხოლოდ შეინარჩუნებს ხედის ნებართვას."
},

snackbar: {
update_succeed_message: "წარმატებით შეცვლილია {0}",
creation_succeed_message: "წარმატებით შეიქმნა {0}",
permissions_warning: "{0} - სთვის გამოყოფილი არ არის უფლებები"
},

searchBar: {
quick_search: "სწრაფი ძებნა"
},

preview: {
actions_done: "{0} from {1} actions done",
assign_action_text: "assign {0}",
Expand Down Expand Up @@ -394,6 +402,9 @@ const ka = {
},

notification: {
next_page: "შემდეგი გვერდი",
previous_page: "წინა გვერდი",
rows_per_page: "სტრიქონები თითო გვერდზე",
create_transaction: "ტრანზაქცია {0} შექმნილია ",
create_workflow: "Workflowitem-ი {0} შექმნილია",
done_transaction: " ტრანზაქციის {0} სტატუსი შეიცვალა და დასრულებულია",
Expand Down
15 changes: 13 additions & 2 deletions frontend/src/languages/german.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ const de = {
subproject_completion_string: "{0} von {1} erledigt",
subproject_currency: "German: Sub-project Currency",
subproject_permissions_title: "German: Set permissions for subproject",
subproject_permissions_warning: "Dem Teilprojekt {0} wurden noch keine Berechtigungen zugewiesen",
subproject_preview: "German: Subproject Preview",
subproject_close_info: "German: At least one workflowitem has not been closed yet.",
subproject_close_not_allowed: "Sie haben keine Berechtigung das Projekt zu schließen",
Expand Down Expand Up @@ -211,7 +210,6 @@ const de = {
workflow_no_documents: "No documents",
workflow_none: "None",
workflow_permissions_title: "German: Set permissions for workflowitem",
workflow_permissions_warning: "Dem Workflow-Item {0} wurden noch keine Berechtigungen zugewiesen",
workflow_redacted: "German: Redacted",
workflow_selection: "German: You have selected {0} workflows",
workflow_submit_for_review: "Submit for Review",
Expand All @@ -232,6 +230,16 @@ const de = {
"Bei Zuweisung eines eingeschränkten Workflow-Items an einen anderen User werden Berechtigungen automatisch erteilt und entzogen. Der Zuweisende behält nur die Anzeigerechte."
},

snackbar: {
update_succeed_message: "{0} erfolgreich geändert",
creation_succeed_message: "{0} erfolgreich erstellt",
permissions_warning: "Noch keine Berechtigungen für {0} gesetzt"
},

searchBar: {
quick_search: "Schnellsuche"
},

users: {
account_name: "Accountname",
new_user: "German: New User",
Expand Down Expand Up @@ -395,6 +403,9 @@ const de = {
},

notification: {
next_page: "Nächste Seite",
previous_page: "Vorherige Seite",
rows_per_page: "Einträge pro Seite",
create_transaction: "German: Transaction {0} created ",
create_workflow: "German: Workflow {0} created ",
done_transaction: "German: Status of transaction {0} set to Done",
Expand Down
15 changes: 13 additions & 2 deletions frontend/src/languages/portuguese.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ const pt = {
subproject_currency: "Moeda do subprojeto",
subproject_edit_title: "Editar subprojeto",
subproject_permissions_title: "Configurar permissões para subprojeto",
subproject_permissions_warning: "Sem permissões atribuídas para o subprojecto {0}",
subproject_preview: "Pré-visualização de subprojeto",
subproject_select_button: "Selecionar",
subproject_title_description: "Descrição do subprojeto",
Expand Down Expand Up @@ -274,7 +273,6 @@ const pt = {
workflow_no_documents: "Não há documentos",
workflow_none: "Nenhum",
workflow_permissions_title: "Configurar permissões para item de workflow",
workflow_permissions_warning: "Sem permissões alocadas para o item de workflow {0}",
workflow_redacted: "Editado por privacidade",
workflow_selection: "Você selecionaou {0} itens de workflows",
workflow_submit_for_review: "Enviar para revisão",
Expand All @@ -295,6 +293,16 @@ const pt = {
"Ao atribuir um fluxo de trabalho restrito, as permissões são automaticamente concedidas e revogadas. O cedente manterá apenas as permissões de visualização."
},

snackbar: {
update_succeed_message: "Modificado com sucesso {0}",
creation_succeed_message: "{0} criado com sucesso",
permissions_warning: "Nenhuma permissão alocada para {0}"
},

searchBar: {
quick_search: "Pesquisa rápida"
},

preview: {
actions_done: "{0} de {1} ações realizadas",
assign_action_text: "Atribuir {0}",
Expand Down Expand Up @@ -396,6 +404,9 @@ const pt = {
},

notification: {
next_page: "Próximo site",
previous_page: "Site anterior",
rows_per_page: "Linhas por página",
create_transaction: "Transação {0} criada ",
create_workflow: "Item de workflow {0} criado ",
done_transaction: "Status da transação {0} alterado para Finalizado",
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/pages/Common/Budget.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const renderProjectedBudgetAmount = ({
<TableCell align="right" data-test="saved-projected-budget-amount">
{isEditing && editIndex === currIndex ? (
<TextField
label={strings.common.projected_budget}
label={strings.common.total_budget}
value={budgetAmountEdit}
onChange={e => {
if (numberSignsRegex.test(e.target.value)) {
Expand Down Expand Up @@ -205,7 +205,7 @@ const renderAddProjectedBudget = ({
{getCurrencyMenuItems(currencies)}
</DropDown>
<TextField
label={strings.common.projected_budget}
label={strings.common.total_budget}
data-test="projected-budget"
disabled={isEditing}
value={budgetAmountAdd}
Expand Down Expand Up @@ -278,7 +278,7 @@ const Budget = props => {
<TableHead>
<TableRow>
<TableCell>{strings.common.organization}</TableCell>
<TableCell align="right">{strings.common.projected_budget}</TableCell>
<TableCell align="right">{strings.common.total_budget}</TableCell>
<TableCell align="right">{strings.common.actions}</TableCell>
</TableRow>
</TableHead>
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/pages/Common/History/HistorySearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const HistorySearch = ({ classes, fetchFirstHistoryEvents, users, eventTypes })
<DatePicker
id="filter-startat"
className={classes.datepicker}
label={strings.history.startDate}
label={strings.history.start_date}
name="startAt"
datetime={startAt}
onChange={onChange}
Expand All @@ -70,7 +70,7 @@ const HistorySearch = ({ classes, fetchFirstHistoryEvents, users, eventTypes })
<DatePicker
id="filter-endat"
className={classes.datepicker}
label={strings.history.endDate}
label={strings.history.end_date}
name="endAt"
datetime={endAt}
onChange={onChange}
Expand All @@ -91,7 +91,7 @@ const HistorySearch = ({ classes, fetchFirstHistoryEvents, users, eventTypes })
<Dropdown
style={styles.dropdown}
value={eventType}
floatingLabel={strings.history.eventType}
floatingLabel={strings.history.event_type}
onChange={value => mergeState({ eventType: value })}
id="filter-eventtype"
disabled={false}
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/pages/Common/Searchbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import React from "react";
import { withStyles } from "@material-ui/core";
import Input from "@material-ui/core/Input";
import InputAdornment from "@material-ui/core/InputAdornment";
import strings from "../../localizeStrings";

const styles = {
searchBar: {
Expand Down Expand Up @@ -87,7 +88,7 @@ const Searchbar = ({
{!isSearchBarDisplayedByDefault ? (
// Lupe button to toggle searchbar
<Tooltip
title="Quick search"
title={strings.searchBar.quick_search}
disableHoverListener={searchDisabled}
disableFocusListener={searchDisabled}
disableTouchListener={searchDisabled}
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/pages/Notifications/NotificationList.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ const NotificationList = props => {
count={notificationCount}
page={currentPage}
onChangePage={(_, nextPage) => fetchNotifications(nextPage)}
backIconButtonText={strings.notification.previous_page}
nextIconButtonText={strings.notification.next_page}
labelRowsPerPage={strings.notification.rows_per_page}
/>
</div>
</Card>
Expand Down
7 changes: 5 additions & 2 deletions frontend/src/pages/Overview/ProjectDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ const handleCreate = props => {
tags
);
onDialogCancel();
storeSnackbarMessage(strings.common.added + " " + strings.common.project + " " + shortenedDisplayName(displayName));
storeSnackbarMessage(
strings.formatString(strings.snackbar.creation_succeed_message, shortenedDisplayName(displayName))
);
};

const handleEdit = props => {
Expand All @@ -39,8 +41,9 @@ const handleEdit = props => {
},
changes.deletedProjectedBudgets
);
console.log();
storeSnackbarMessage(
strings.common.edited + " " + strings.common.project + " " + shortenedDisplayName(projectToAdd.displayName)
strings.formatString(strings.snackbar.update_succeed_message, shortenedDisplayName(projectToAdd.displayName))
);
}
onDialogCancel();
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/SubProjects/ProjectDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ const ProjectDetails = props => {
) : null}
</List>
<div style={styles.projectedBudget} data-test="project-projected-budget">
<Typography variant="body1">{strings.common.projected_budget}</Typography>
<Typography variant="body1">{strings.common.total_budget}</Typography>
{isDataLoading ? (
<div />
) : projectProjectedBudgets.length > 0 ? (
Expand Down
6 changes: 2 additions & 4 deletions frontend/src/pages/SubProjects/SubprojectDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ const handleCreate = props => {
);
onDialogCancel();

storeSnackbarMessage(
strings.formatString(strings.subproject.subproject_permissions_warning, shortenedDisplayName(displayName))
);
storeSnackbarMessage(strings.formatString(strings.snackbar.permissions_warning, shortenedDisplayName(displayName)));
};

const handleEdit = props => {
Expand All @@ -41,7 +39,7 @@ const handleEdit = props => {
changes.deletedProjectedBudgets
);
storeSnackbarMessage(
strings.common.edited + " " + strings.common.subproject + " " + shortenedDisplayName(subprojectToAdd.displayName)
strings.formatString(strings.snackbar.update_succeed_message, shortenedDisplayName(subprojectToAdd.displayName))
);
}

Expand Down
9 changes: 5 additions & 4 deletions frontend/src/pages/Workflows/WorkflowDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ const handleCreate = props => {
dueDate,
workflowitemType
);
storeSnackbarMessage(
strings.formatString(strings.workflow.workflow_permissions_warning, shortenedDisplayName(displayName))
);
storeSnackbarMessage(strings.formatString(strings.snackbar.permissions_warning, shortenedDisplayName(displayName)));
onDialogCancel();
};

Expand Down Expand Up @@ -94,7 +92,10 @@ const handleEdit = props => {
editWorkflowItem(projectId, subprojectId, workflowToAdd.id, changes);
}
storeSnackbarMessage(
strings.common.edited + " " + strings.common.workflowitem + " " + shortenedDisplayName(workflowToAdd.displayName)
strings.formatString(
strings.snackbar.update_succeed_message,
shortenedDisplayName(originalWorkflowItem.displayName)
)
);
onDialogCancel();
};
Expand Down

0 comments on commit 8a0e089

Please sign in to comment.