Current code does post-processing after translation…
1.
translate_event_responsibility <- function
[...]
df_translated <- df %>%
translated_join_vars(c("protest_domain", "pres_admin", "event_title")) %>%
select(-protest_domain, -pres_admin) %>% #rm translated vars except index_var
rename_with(~ paste0(.x, source_suffix), index_var) %>% # mark index_var
rename_with(~ sub(dest_suffix, "", .x), everything()) %>% # unmark translated vars
relocate(index_var_marked, .after = last_col()) %>% # keeping this column to match
relocate(event_title)
2.
second_level_es <-second_level %>%
translated_join_vars(c("dec_affiliation", "perp_affiliation",
"state_responsibility", "intentionality"),
translation) %>%
select(event_title, date, dec_firstname, dec_surnames, age, dec_affiliation_es,
# cause_death_es,
perp_affiliation_es, state_responsibility_es,
intentionality_es, unconfirmed) %>%
rename_with(~ sub("_es$", "", .x), everything())
3.
don <- don %>% translated_join_vars(
c("event_title", "dec_affiliation",
"state_responsibility", "intentionality",
"protest_domain"),
translation) %>%
mutate(cause_death_es = str_c("(en): ", cause_death)) %>%
add_nameline_es() %>%
add_dateline_es() %>%
add_simple_label_es() %>%
add_detailed_label() %>%
add_detailed_label_es()
4.
domain.responsibility_es <- domain.responsibility %>%
translated_join("protest_domain", translation) %>%
relocate(protest_domain_es)
The goal of this issue is either to incorporate these tasks into translated_join(), or create helper functions after the fact so that these tasks are functionalized and clearly stated in the function titles.
Current code does post-processing after translation…
1.
2.
3.
4.
The goal of this issue is either to incorporate these tasks into translated_join(), or create helper functions after the fact so that these tasks are functionalized and clearly stated in the function titles.