QScript Translations

From Q
Jump to navigation Jump to search

Translations

Allows you to modify the text used by Q when it generates tables and charts. e.g. Names of statistics, "NET".

allEnglishTexts

Returns the default English name for all translations. These can be used with get() and set().
Example:
project.translations.allEnglishTexts

equals(obj)

Whether two objects are the same.
objThe object to compare against.
Returns:true or false
Example:
data_file.getQuestionByName('Q2').equals(data_file.questions()[0])

get(name_en)

Gets the user-overridden text for the output string given by the English text. If it has not been overridden then the default text under the current language settings will be returned.
name_enEnglish text that is normally output.
Returns:The text that will be used. If you have not changed this then it will be the original English text.
Example:
log(item.translations.get('Column n'));

set(name_en, name_override)

Sets the user-overridden text for the output string given by the English text. If input for the user-overridden text is null, the user-overridden text is deleted.
name_enEnglish text that is normally output.
name_overrideThe text to use instead of the original.
Example:
item.translations.set('Column n', 'col n'));

type

Returns 'Translations'.