Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(fix) Correction when passing parameters to labels #261

Merged
merged 1 commit into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions src/crosscutting-features/DeletePatientGridModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function DeletePatientGridModal({
showToast({
kind: 'success',
title: t('deletePatientGridSuccessToastTitle', 'Grid deleted successfully'),
description: t('deletePatientGridSuccessToastDescription', 'Successfully deleted the grid "{name}".', {
description: t('deletePatientGridSuccessToastDescription', 'Successfully deleted the grid "{{name}}".', {
name: patientGridToDelete?.name,
}),
});
Expand All @@ -37,7 +37,7 @@ export function DeletePatientGridModal({
showToast({
kind: 'error',
title: t('deletePatientGridErrorToastTitle', 'Grid deletion failed'),
description: t('deletePatientGridErrorToastDescription', 'Deleting the grid "{name}" failed.', {
description: t('deletePatientGridErrorToastDescription', 'Deleting the grid "{{name}}" failed.', {
name: patientGridToDelete?.name,
}),
}),
Expand Down
4 changes: 2 additions & 2 deletions src/crosscutting-features/EditPatientGridModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function EditPatientGridModal({ patientGridToEdit, setPatientGridToEdit }
showToast({
kind: 'success',
title: t('editPatientGridSuccessToastTitle', 'Grid edited successfully'),
description: t('editPatientGridSuccessToastDescription', 'Successfully edited the grid "{name}".', {
description: t('editPatientGridSuccessToastDescription', 'Successfully edited the grid "{{name}}".', {
name: patientGridToEdit?.name,
}),
});
Expand All @@ -35,7 +35,7 @@ export function EditPatientGridModal({ patientGridToEdit, setPatientGridToEdit }
showToast({
kind: 'error',
title: t('editPatientGridErrorToastTitle', 'Grid editing failed'),
description: t('editPatientGridErrorToastDescription', 'Editing the grid "{name}" failed.', {
description: t('editPatientGridErrorToastDescription', 'Editing the grid "{{name}}" failed.', {
name: patientGridToEdit?.name,
}),
}),
Expand Down
2 changes: 1 addition & 1 deletion src/patient-grid-details/DownloadModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function DownloadModal({ patientGridId, isOpen, onClose, refreshGrid, fil
columnNamesToInclude,
patientDetailsGroupHeader,
}: Omit<DownloadGridData, 'fileName'>) => {
const fileName = t('patientGridExportFileName', 'export.{extension}', { extension: fileExtension });
const fileName = t('patientGridExportFileName', 'export.{{extension}}', { extension: fileExtension });
const spreadsheetData = getPatientGridDownloadReportData(
download,
patientGrid,
Expand Down
6 changes: 3 additions & 3 deletions src/patient-grid-details/PatientGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ export function PatientGrid({
{t('patientGridDownloadButton', 'Download')}
</Button>
<Button size="sm" kind="ghost" renderIcon={OpenPanelRight} onClick={showToggleColumnsSidePanel}>
{t('patientGridColumnsButton', 'Columns ({actual}/{total})', {
{t('patientGridColumnsButton', 'Columns ({{actual}}/{{total}})', {
actual: Object.values(columnHiddenStates).filter((x) => !x).length,
total: patientGrid?.columns.length,
})}
Expand Down Expand Up @@ -359,14 +359,14 @@ export function PatientGrid({
itemsPerPageText={t('patientGridPaginationItemsPerPage', 'Items per page:')}
pageNumberText={t('patientGridPaginationPageNumber', 'Page Number')}
pageRangeText={(_current, total) =>
t(total === 1 ? 'patientGridPaginationOfOnePage' : 'patientGridPaginationOf', 'of {total} pages', {
t(total === 1 ? 'patientGridPaginationOfOnePage' : 'patientGridPaginationOf', 'of {{total}} pages', {
total: total,
})
}
itemRangeText={(min, max, total) =>
t(
total === 1 ? 'patientGridPaginationItemRangeText' : 'patientGridPaginationItemRangesText',
'{min}–{max} of {total} items',
'{{min}}–{{max}} of {{total}} items',
{
min: min,
max: max,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function FiltersPopoverContent({ patientGridId, column, columnDisplayName, close
return (
<aside className={styles.popoverContentAligner}>
<p className={styles.popoverTitle}>
{t('patientGridColumnFiltersTitle', '"{columnName}" Filter', {
{t('patientGridColumnFiltersTitle', '"{{columnName}}" Filter', {
columnName: columnDisplayName,
})}
</p>
Expand Down
2 changes: 1 addition & 1 deletion src/patient-grids-overview/PatientGridBuilderHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function PatientGridBuilderHeader({ page, pages, title, goToPrevious }: P
)}

<span className={styles.stepHeader}>
{t('patientGridBuilderHeaderCurrentStep', 'Step {page} of {pages}: {title}', {
{t('patientGridBuilderHeaderCurrentStep', 'Step {{page}} of {{pages}}: {{title}}', {
page: page + 1,
pages,
title,
Expand Down
4 changes: 2 additions & 2 deletions src/patient-grids-overview/PatientGridBuilderSidePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function PatientGridBuilderSidePanel({ onClose }: PatientGridBuilderSideP
showToast({
kind: 'success',
title: t('patientGridSidePanelSuccessToastTitle', 'Grid created successfully'),
description: t('patientGridSidePanelSuccessToastDescription', 'Successfully created the grid "{name}".', {
description: t('patientGridSidePanelSuccessToastDescription', 'Successfully created the grid "{{name}}".', {
name: state.name,
}),
});
Expand All @@ -38,7 +38,7 @@ export function PatientGridBuilderSidePanel({ onClose }: PatientGridBuilderSideP
showToast({
kind: 'error',
title: t('patientGridSidePanelErrorToastTitle', 'Grid creation failed'),
description: t('patientGridSidePanelErrorToastDescription', 'Creating the grid "{name}" failed.', {
description: t('patientGridSidePanelErrorToastDescription', 'Creating the grid "{{name}}" failed.', {
name: state.name,
}),
});
Expand Down
28 changes: 14 additions & 14 deletions translations/en.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"allGridsTabLabel": "All grids",
"deletePatientGridErrorToastDescription": "Deleting the grid {name} failed.",
"deletePatientGridErrorToastDescription": "Deleting the grid {{name}} failed.",
"deletePatientGridErrorToastTitle": "Grid deletion failed",
"deletePatientGridModalBody": "Are you sure that you want to delete the grid {name}? This action cannot be undone.",
"deletePatientGridModalBody": "Are you sure that you want to delete the grid {{name}}? This action cannot be undone.",
"deletePatientGridModalCancel": "Cancel",
"deletePatientGridModalClose": "Close",
"deletePatientGridModalDelete": "Delete",
"deletePatientGridModalTitle": "Delete grid",
"deletePatientGridSuccessToastDescription": "Successfully deleted the grid {name}.",
"deletePatientGridSuccessToastDescription": "Successfully deleted the grid {{name}}.",
"deletePatientGridSuccessToastTitle": "Grid deleted successfully",
"descriptionTableHeader": "Description",
"downloadModalChooseDownloadCsvOption": "CSV (Comma-Separated Values)",
Expand All @@ -27,15 +27,15 @@
"downloadModalInternalExternalHeading": "Shared ICRC internally?",
"downloadModalInternalExternalPrimaryButtonText": "Yes (only ICRC internal)",
"downloadModalInternalExternalSecondaryButtonText": "No (external transfer)",
"editPatientGridErrorToastDescription": "Editing the grid {name} failed.",
"editPatientGridErrorToastDescription": "Editing the grid {{name}} failed.",
"editPatientGridErrorToastTitle": "Grid editing failed",
"editPatientGridModalCancel": "Cancel",
"editPatientGridModalClose": "Close",
"editPatientGridModalDescriptionInputLabel": "Describe the purpose of this grid in a few words",
"editPatientGridModalNameInputLabel": "Grid name",
"editPatientGridModalSave": "Save changes",
"editPatientGridModalTitle": "Edit name / description",
"editPatientGridSuccessToastDescription": "Successfully edited the grid {name}.",
"editPatientGridSuccessToastDescription": "Successfully edited the grid {{name}}.",
"editPatientGridSuccessToastTitle": "Grid edited successfully",
"editSidePanelTitle": "Edit patient entry",
"filterEndDate": "End date (inclusive)",
Expand All @@ -60,16 +60,16 @@
"myGridsTabLabel": "My grids",
"newGrid": "New grid",
"newPatientGridSidePanelTitle": "New patient grid",
"patientGridBuilderHeaderCurrentStep": "Step {page} of {pages}: {title}",
"patientGridBuilderHeaderCurrentStep": "Step {{page}} of {{pages}}: {{title}}",
"patientGridBuilderHeaderGoBack": "Go back",
"patientGridColumnFiltersApply": "Apply",
"patientGridColumnFiltersCancel": "Cancel",
"patientGridColumnFiltersDescription": "Filter",
"patientGridColumnFiltersNoFiltersAvailable": "No filters available for the current grid report.",
"patientGridColumnFiltersResetToDefault": "Reset to default",
"patientGridColumnFiltersTitle": "{columnName} Filter",
"patientGridColumnFiltersTitle": "{{columnName}} Filter",
"patientGridColumnHeaderPatientDetails": "Healthcare user",
"patientGridColumnsButton": "Columns ({actual}/{total})",
"patientGridColumnsButton": "Columns ({{actual}}/{{total}})",
"patientGridDeleteRowMenuItem": "Delete",
"patientGridDetails": "Grid details",
"patientGridDetailsAgeCategoryLabel": "Age category",
Expand Down Expand Up @@ -100,7 +100,7 @@
"patientGridEditRowMenuItem": "Edit",
"patientGridErrorToastDescription": "There was an error while loading the patient grid.",
"patientGridErrorToastTitle": "Patient grid loading failed",
"patientGridExportFileName": "export.{extension}",
"patientGridExportFileName": "export.{{extension}}",
"patientGridFilters": "Grid filters",
"patientGridFiltersHeaderFilterCaption": "Filters:",
"patientGridFiltersHeaderNoFiltersFallback": "--",
Expand All @@ -124,9 +124,9 @@
"patientGridSidePanelCancel": "Cancel",
"patientGridSidePanelClose": "Close",
"patientGridSidePanelCreate": "Create grid",
"patientGridSidePanelErrorToastDescription": "Creating the grid {name} failed.",
"patientGridSidePanelErrorToastDescription": "Creating the grid {{name}} failed.",
"patientGridSidePanelErrorToastTitle": "Grid creation failed",
"patientGridSidePanelSuccessToastDescription": "Successfully created the grid {name}.",
"patientGridSidePanelSuccessToastDescription": "Successfully created the grid {{name}}.",
"patientGridSidePanelSuccessToastTitle": "Grid created successfully",
"patientGridsNotShared": "No",
"patientGridSortColumnDescription": "Sort",
Expand Down Expand Up @@ -157,10 +157,10 @@
"patientDetailsDownloadGroupHeader": "Healthcare user",
"patientGridPaginationItemsPerPage": "Items per page:",
"patientGridPaginationPageNumber": "Page Number",
"patientGridPaginationOf": "of {total} pages",
"patientGridPaginationOf": "of {{total}} pages",
"patientGridPaginationOfOnePage": "of 1 page",
"patientGridPaginationItemRangeText": "{min}–{max} of {total} item",
"patientGridPaginationItemRangesText": "{min}–{max} of {total} items",
"patientGridPaginationItemRangeText": "{{min}}–{{max}} of {{total}} item",
"patientGridPaginationItemRangesText": "{{min}}–{{max}} of {{total}} items",
"patientGridMandatoryFieldMessage": "Please select either country or structure in order to create a grid",
"patientGridFiltersHeaderModalHeading": "Save Grid",
"patientGridFiltersHeaderPrimaryButton": "Save",
Expand Down
28 changes: 14 additions & 14 deletions translations/es.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"allGridsTabLabel": "Todas las cuadrículas",
"deletePatientGridErrorToastDescription": "Error al eliminar la cuadrícula {name}.",
"deletePatientGridErrorToastDescription": "Error al eliminar la cuadrícula {{name}}.",
"deletePatientGridErrorToastTitle": "Error al eliminar la cuadrícula",
"deletePatientGridModalBody": "¿Está seguro de que desea eliminar la cuadrícula {name}? Esta acción no se puede deshacer.",
"deletePatientGridModalBody": "¿Está seguro de que desea eliminar la cuadrícula {{name}}? Esta acción no se puede deshacer.",
"deletePatientGridModalCancel": "Cancelar",
"deletePatientGridModalClose": "Cerrar",
"deletePatientGridModalDelete": "Eliminar",
"deletePatientGridModalTitle": "Eliminar cuadrícula",
"deletePatientGridSuccessToastDescription": "Se eliminó la cuadrícula {name} correctamente.",
"deletePatientGridSuccessToastDescription": "Se eliminó la cuadrícula {{name}} correctamente.",
"deletePatientGridSuccessToastTitle": "Cuadrícula eliminada correctamente",
"descriptionTableHeader": "Descripción",
"downloadModalChooseDownloadCsvOption": "CSV (Valores separados por comas)",
Expand All @@ -27,15 +27,15 @@
"downloadModalInternalExternalHeading": "¿Compartido internamente en el CICR?",
"downloadModalInternalExternalPrimaryButtonText": "Sí (solo interno del CICR)",
"downloadModalInternalExternalSecondaryButtonText": "No (transferencia externa)",
"editPatientGridErrorToastDescription": "Error al editar la cuadrícula {name}.",
"editPatientGridErrorToastDescription": "Error al editar la cuadrícula {{name}}.",
"editPatientGridErrorToastTitle": "Error al editar la cuadrícula",
"editPatientGridModalCancel": "Cancelar",
"editPatientGridModalClose": "Cerrar",
"editPatientGridModalDescriptionInputLabel": "Describa el propósito de esta cuadrícula en pocas palabras",
"editPatientGridModalNameInputLabel": "Nombre de la cuadrícula",
"editPatientGridModalSave": "Guardar cambios",
"editPatientGridModalTitle": "Editar nombre / descripción",
"editPatientGridSuccessToastDescription": "La cuadrícula {name} se editó correctamente.",
"editPatientGridSuccessToastDescription": "La cuadrícula {{name}} se editó correctamente.",
"editPatientGridSuccessToastTitle": "Cuadrícula editada correctamente",
"editSidePanelTitle": "Editar entrada del paciente",
"filterEndDate": "Fecha de finalización (inclusive)",
Expand All @@ -60,16 +60,16 @@
"myGridsTabLabel": "Mis cuadrículas",
"newGrid": "Nueva cuadrícula",
"newPatientGridSidePanelTitle": "Nueva cuadrícula de pacientes",
"patientGridBuilderHeaderCurrentStep": "Paso {page} de {pages}: {title}",
"patientGridBuilderHeaderCurrentStep": "Paso {{page}} de {{pages}}: {{title}}",
"patientGridBuilderHeaderGoBack": "Atrás",
"patientGridColumnFiltersApply": "Aplicar",
"patientGridColumnFiltersCancel": "Cancelar",
"patientGridColumnFiltersDescription": "Filtrar",
"patientGridColumnFiltersNoFiltersAvailable": "No hay filtros disponibles para el informe de la cuadrícula actual.",
"patientGridColumnFiltersResetToDefault": "Restablecer a valores predeterminados",
"patientGridColumnFiltersTitle": "Filtro de {columnName}",
"patientGridColumnFiltersTitle": "Filtro de {{columnName}}",
"patientGridColumnHeaderPatientDetails": "Usuario de atención médica",
"patientGridColumnsButton": "Columnas ({actual}/{total})",
"patientGridColumnsButton": "Columnas ({{actual}}/{{total}})",
"patientGridDeleteRowMenuItem": "Eliminar",
"patientGridDetails": "Detalles de la cuadrícula",
"patientGridDetailsAgeCategoryLabel": "Categoría de edad",
Expand Down Expand Up @@ -100,7 +100,7 @@
"patientGridEditRowMenuItem": "Editar",
"patientGridErrorToastDescription": "Hubo un error al cargar la cuadrícula de pacientes.",
"patientGridErrorToastTitle": "Error al cargar la cuadrícula de pacientes",
"patientGridExportFileName": "exportar.{extension}",
"patientGridExportFileName": "exportar.{{extension}}",
"patientGridFilters": "Filtros de cuadrícula",
"patientGridFiltersHeaderFilterCaption": "Filtros:",
"patientGridFiltersHeaderNoFiltersFallback": "--",
Expand All @@ -124,9 +124,9 @@
"patientGridSidePanelCancel": "Cancelar",
"patientGridSidePanelClose": "Cerrar",
"patientGridSidePanelCreate": "Crear cuadrícula",
"patientGridSidePanelErrorToastDescription": "Error al crear la cuadrícula {name}.",
"patientGridSidePanelErrorToastDescription": "Error al crear la cuadrícula {{name}}.",
"patientGridSidePanelErrorToastTitle": "Error al crear la cuadrícula",
"patientGridSidePanelSuccessToastDescription": "La cuadrícula {name} se creó correctamente.",
"patientGridSidePanelSuccessToastDescription": "La cuadrícula {{name}} se creó correctamente.",
"patientGridSidePanelSuccessToastTitle": "Cuadrícula creada correctamente",
"patientGridsNotShared": "No",
"patientGridSortColumnDescription": "Ordenar",
Expand Down Expand Up @@ -157,10 +157,10 @@
"patientDetailsDownloadGroupHeader": "Usuario de atención médica",
"patientGridPaginationItemsPerPage": "Elementos por página:",
"patientGridPaginationPageNumber": "Número de página",
"patientGridPaginationOf": "de {total} páginas",
"patientGridPaginationOf": "de {{total}} páginas",
"patientGridPaginationOfOnePage": "de 1 página",
"patientGridPaginationItemRangeText": "{min}–{max} de {total} elemento",
"patientGridPaginationItemRangesText": "{min}–{max} de {total} elementos",
"patientGridPaginationItemRangeText": "{{min}}–{{max}} de {{total}} elemento",
"patientGridPaginationItemRangesText": "{{min}}–{{max}} de {{total}} elementos",
"patientGridMandatoryFieldMessage": "Por favor, seleccione país o estructura para crear una cuadrícula",
"patientGridFiltersHeaderModalHeading": "Guardar cuadrícula",
"patientGridFiltersHeaderPrimaryButton": "Guardar",
Expand Down
Loading