# library(exploratorium)
devtools::load_all() # to be sure than the app_sys() used internaly by some function link to ./inst folder instaler of .libPaths()
#>  Loading exploratorium

The aim of this article is to show you how to update the data used by the app.

Projects data

The data used by the app is extracted from Promotion Digital Database via an ETL (Extract Load Transform) pipeline and then stored in inst/data-projects as two separated datasets:

  • projects_fr.rds
  • projects_de.rds

Those datasets are loaded at runtime by the app depending on the language selected by the user.

The ETL pipeline also uses .csv dictionary files to translate or modify the raw data.

The data preparation process must be repeated each time the raw data is modified or each time a modification is required to the data dictionaries.

Update the project data

Make sure that:

  • the following environment variables are set in order to be able to connect to the database:
DB_HOST
DB_PORT
DB_USER
DB_PASSWORD
  • You have unrestricted access the internet so that {tidygeocoder} can query the geocoding API.

Then run the etl with:

exploratorium::prepare_app_data()

Modify the translations for projects data

You must modify directly the dictionaries used for the translations.

Dictionnaries used during data preparation are .csv files located in inst/data-dic folder:

  • dic_variables.csv
  • dic_cantons.csv
  • dic_values.csv

dic_variables.csv

Contains translations of all variables names of the raw data file inst/data-projects-raw/PGV.xlsx.

dic_cantons.csv

Contains translations of cantons names.

dic_values.csv

Contains values in the columns status and other columns from the original excel file that was fed in the etl. Many of which should be removed in the future.

Update projects data

You will then need to rebuild the projects data:

exploratorium::prepare_app_data()

Translation data used in the app

Those files are used at runtime by the app. You do NOT need to run the etl after modifying them.

dic_titles_app.csv

Contains translations of all app titles.

i18n_locales.json

Contains translation of all app elements other than titles.