From b45e7043ec00113c90d3db57ea74b87ef7346527 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vihri=C3=A4l=C3=A4=20Erkki?= Date: Tue, 3 Mar 2026 12:10:48 +0200 Subject: [PATCH] Fix custom system-messages not applied to auto-generated nav buttons Two bugs in R/config.R: 1. extract_html_pages() read settings_yaml$system_messages (underscore) but the YAML key is system-messages (hyphen), so custom nav button labels were silently ignored. Fixed by using backtick-quoted `system-messages`. 2. survey_files_need_updating() did not check whether settings.yml is newer than pages.rds, so changes to system-messages required manually deleting pages.rds. Added settings.yml to the staleness check. Co-Authored-By: Claude Opus 4.6 --- R/config.R | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/R/config.R b/R/config.R index 6a4acdbe..91b8c601 100644 --- a/R/config.R +++ b/R/config.R @@ -352,12 +352,15 @@ survey_files_need_updating <- function(paths) { return(TRUE) } - # Re-parse if the target pages file is out of date with 'survey.qmd', 'app.R' + # Re-parse if the target pages file is out of date with 'survey.qmd', 'app.R', + # or 'settings.yml' (which contains system-messages used for nav button labels) time_qmd <- file.info(paths$qmd)$mtime time_app <- file.info(paths$app)$mtime + time_settings <- file.info(paths$target_settings)$mtime time_pages <- file.info(paths$target_pages)$mtime - if ((time_qmd > time_pages) || (time_app > time_pages)) { + if ((time_qmd > time_pages) || (time_app > time_pages) || + (time_settings > time_pages)) { return(TRUE) } @@ -1409,8 +1412,8 @@ extract_html_pages <- function( } # Get translated messages - if (!is.null(settings_yaml$system_messages)) { - messages <- settings_yaml$system_messages + if (!is.null(settings_yaml$`system-messages`)) { + messages <- settings_yaml$`system-messages` } }, error = function(e) {