Package 'tr.iatgen'

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

Help Index


Return the list of available languages for iatgen translation

Description

Return the list of available languages for iatgen translation

Usage

available.languages()

Value

Returns data.frame listing the supported languages.

Code

Translation identifier

Description

Verbose translation description

Examples

available.languages()

Export blank translation template

Description

Export blank translation template

Usage

export.template(src_lang = "en")

Arguments

src_lang

Source language – "en" for english is the only supported one.

Value

The path to the template file (class: character).

Examples

export.template()

Run a standalone Shiny App for iatgen translation

Description

This starts R shiny web based application to facilitate iatgen-generated QSF translation. It is a pass through function to shiny::runApp.

runApp.png

Usage

runApp(...)

Arguments

...

All parameters are passed to Shiny runApp function

Value

No return value, called for side effects (running the shiny App UI)

Examples

# this will start the shiny UI
tr.iatgen::runApp()

Translate iatgen generated QSF file

Description

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.

Usage

translate.qsf(file, lang, lang_file = NULL, src_lang = "en", dst_file = NULL)

Arguments

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.

Value

Translated file path/location (class: character)

Examples

# example code
my_qsf_file <- system.file("examples/iat-flowins.qsf", package = "tr.iatgen")
translate.qsf(file = my_qsf_file, lang = "pt-pt")

Graphical user interface (GUI) to translate iatgen generate QSF file

Description

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.

Usage

translate.qsf.gui()

Value

Translated file path/location (class: character)

Examples

translate.qsf.gui()

Validate user-supplied file to translate iatgen generated QSF file

Description

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.

Usage

validate.language(file, src_lang = "en")

Arguments

file

Source CSV file to validate

src_lang

Source language – "en" for english is the only supported one.

Value

Heading of the second column (language identifier, class: character) if successful, NULL if error

Examples

my_csv_file <- system.file("langs/en_jp.csv", package = "tr.iatgen")
validate.language(file = my_csv_file)