Skip to content

Commit

Permalink
Translate the error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
r-ash committed Nov 21, 2024
1 parent 879bbaa commit 050d795
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# naomi 2.10.2

* Improve warning generated when user fits model at admin level where no population data exists.
* Improve error generated when user fits model at admin level where no population data exists.

# naomi 2.10.1

Expand Down
6 changes: 2 additions & 4 deletions R/model.R
Original file line number Diff line number Diff line change
Expand Up @@ -329,10 +329,8 @@ naomi_model_frame <- function(area_merged,
## of a Spectrum file and then calibrated. Currently no way to know if areas
## comparise only part of a Spectrum file, so can't address.

if(any( mf_areas[["area_id"]] %in% unique(population_agesex$area_id) == FALSE)){
stop(
"Population data not available for admin level selected for model projections.
Please review model options selection to ensure that area level selection is correct.")
if (!all(mf_areas[["area_id"]] %in% unique(population_agesex$area_id))) {
stop(t_("MISSING_POPULATION_LEVEL"))
}

pop_subset <- dplyr::filter(population_agesex, area_id %in% mf_areas[["area_id"]])
Expand Down
3 changes: 2 additions & 1 deletion inst/traduire/en-translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -275,5 +275,6 @@
"DOWNLOAD_COMPARISON_DESCRIPTION": "Naomi comparison report uploaded from Naomi web app",
"DOWNLOAD_AGYW_DESCRIPTION": "Naomi AGYW tool uploaded from Naomi web app",
"NUMBER_ON_ART": "Number on ART",
"NUMBER_ON_ART_DESC": "Number on ART description"
"NUMBER_ON_ART_DESC": "Number on ART description",
"MISSING_POPULATION_LEVEL": "Population data not available for admin level selected for model projections. Please review model options selection to ensure that area level selection is correct."
}
3 changes: 2 additions & 1 deletion inst/traduire/fr-translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -274,5 +274,6 @@
"DOWNLOAD_SUMMARY_DESCRIPTION": "Rapport de synthèse Naomi téléchargé depuis l'application web Naomi",
"DOWNLOAD_COMPARISON_DESCRIPTION": "Rapport de comparaison Naomi téléchargé à partir de l'application web Naomi",
"NUMBER_ON_ART": "Nombre de personnes sous TARV",
"NUMBER_ON_ART_DESC": "Number on ART description"
"NUMBER_ON_ART_DESC": "Number on ART description",
"MISSING_POPULATION_LEVEL": "Les données de population ne sont pas disponibles pour le niveau admin sélectionné pour les projections du modèle. Veuillez revoir la sélection des options du modèle pour vous assurer que la sélection du niveau de la zone est correcte."
}
3 changes: 2 additions & 1 deletion inst/traduire/pt-translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -274,5 +274,6 @@
"DOWNLOAD_SUMMARY_DESCRIPTION": "Relatório de síntese da Naomi carregado da aplicação web Naomi",
"DOWNLOAD_COMPARISON_DESCRIPTION": "Relatório de comparação Naomi carregado a partir da aplicação web Naomi",
"NUMBER_ON_ART": "Nombre de personnes sous TARV",
"NUMBER_ON_ART_DESC": "Number on ART description"
"NUMBER_ON_ART_DESC": "Number on ART description",
"MISSING_POPULATION_LEVEL": "Os dados da população não estão disponíveis para o nível administrativo selecionado para as projecções do modelo. Rever a seleção das opções do modelo para garantir que a seleção do nível de área está correta."
}

0 comments on commit 050d795

Please sign in to comment.