Title: | Translate 'iatgen' Generated QSF Files |
---|---|
Description: | Automates translating the instructions of 'iatgen' generated qsf (Qualtrics survey files) to other languages using either officially supported or user-supplied translations (for tutorial see Santos et al., 2023 <doi:10.17504/protocols.io.kxygx34jdg8j/v1>). |
Authors: | Michal Kouril [aut, cre] , João O. Santos [aut] |
Maintainer: | Michal Kouril <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.1.0 |
Built: | 2024-10-26 03:40:08 UTC |
Source: | CRAN |
Return the list of available languages for iatgen translation
available.languages()
available.languages()
Returns data.frame listing the supported languages.
Translation identifier
Verbose translation description
available.languages()
available.languages()
Export blank translation template
export.template(src_lang = "en")
export.template(src_lang = "en")
src_lang |
Source language – "en" for english is the only supported one. |
The path to the template file (class: character).
export.template()
export.template()
This starts R shiny web based application to facilitate iatgen-generated QSF translation. It is a pass through function to shiny::runApp.
runApp(...)
runApp(...)
... |
All parameters are passed to Shiny runApp function |
No return value, called for side effects (running the shiny App UI)
# this will start the shiny UI tr.iatgen::runApp()
# this will start the shiny UI tr.iatgen::runApp()
Read-in iatgen generated QSF file and translated it to a target language specified by user either from the list of available languages included in tr.iatgen package or using the custom supplied translation file.
translate.qsf(file, lang, lang_file = NULL, src_lang = "en", dst_file = NULL)
translate.qsf(file, lang, lang_file = NULL, src_lang = "en", dst_file = NULL)
file |
qsf file |
lang |
Target language (abbreviation). |
lang_file |
CSV file containing custom translation. |
src_lang |
Source language – "en" for english is the only supported one. |
dst_file |
save the translated file as. If NULL temporary file will be created. |
Translated file path/location (class: character)
# example code my_qsf_file <- system.file("examples/iat-flowins.qsf", package = "tr.iatgen") translate.qsf(file = my_qsf_file, lang = "pt-pt")
# example code my_qsf_file <- system.file("examples/iat-flowins.qsf", package = "tr.iatgen") translate.qsf(file = my_qsf_file, lang = "pt-pt")
This function allows you to translate an iatgen QSF file by visually selecting the files and settings for the translation.
It's a wrapper around 'translate.qsf()', meant to be make it more user-friendly for less technical users.
See the official iatgen website for a web based alternative.
translate.qsf.gui()
translate.qsf.gui()
Translated file path/location (class: character)
translate.qsf.gui()
translate.qsf.gui()
The validate.language function reads in csv file which is expected to contain 2 columns and 28 rows:
the first column contains the english language text (as compared to the template file)
the second column contains the translation of the first column in a target language The first rows contains heading – heading of the first column is "en" for English and the heading of the second colum is iana formatted target langugage specifier.
validate.language(file, src_lang = "en")
validate.language(file, src_lang = "en")
file |
Source CSV file to validate |
src_lang |
Source language – "en" for english is the only supported one. |
Heading of the second column (language identifier, class: character) if successful, NULL if error
my_csv_file <- system.file("langs/en_jp.csv", package = "tr.iatgen") validate.language(file = my_csv_file)
my_csv_file <- system.file("langs/en_jp.csv", package = "tr.iatgen") validate.language(file = my_csv_file)