Skip to content

Commit

Permalink
Merge pull request #28 from kobotoolbox/update-language-xls-page
Browse files Browse the repository at this point in the history
Update language xls page
  • Loading branch information
tinok authored Oct 14, 2020
2 parents 592e4f6 + 8aea5d3 commit 3901dfe
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 21 deletions.
16 changes: 4 additions & 12 deletions source/calculate_questions.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Calculate Question Type

Some advanced forms may require an internal calculation to take place as part of the form (rather than afterwards during the analysis). This can be done by adding a Calculation and writing the mathematical expression into the question label field.
Some advanced forms may require an internal calculation to take place as part of the form (rather than afterwards during the analysis). This can be done by adding a Calculation and writing the mathematical expression into the question label field.

![image](/images/calculate_questions/calculation.gif)
![image](/images/calculate_questions/calculation.gif)

A mathematical expression could be as simple as `5 + 1`, but most likely it would include reference to another question.

Expand All @@ -12,18 +12,10 @@ For example, if you want to convert the answer to a question about someone's inc

You can also use the answer to this Calculate question for other purposes, such as building your skip logic (for example only ask a follow-up question above a certain income threshold) or by displaying it inside a Note ([see here](responses_inside_question.md) for help on how to display the response to one question in the label of another question).


## List of available functions

There are a lot of different options available, such as the round() function (e.g. `round(${int_1} div ${int_2}, 1`) will round the result of a division to a single decimal). For a list of some of the many mathematical expressions that can be used in this field, please see [XForm specifications on calculation functions](https://docs.getodk.org/form-operators-functions/) for the technical background of all the functions available in KoBoToolbox and XLSForms. For advance use of calculations in KoBoToolbox, please refer to this article.

## List of available calculation operators


![image](/images/calculate_questions/operator.png)

**More operators and functions**

There are a lot of different options available, such as the round() function (e.g. `round(${int_1} div ${int_2}, 1`) will round the result of a division to a single decimal). For a list of some of the many mathematical expressions that can be used in this field, please see [XForm specifications on calculation functions](https://docs.getodk.org/form-operators-functions/) for the technical background of all the functions available in KoBoToolbox and XLSForms. For advance use of calculations in KoBoToolbox, please refer to [this article](advanced_calculate.md).

## List of available calculation operators

![image](/images/calculate_questions/operator.png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/images/language_xls/form_title_updated.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/images/language_xls/hints_updated.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/images/language_xls/label_updated.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 9 additions & 9 deletions source/language_xls.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,27 @@ Here are detailed instructions on how you can add another language to your form:

3. Open the file in Excel (Google Spreadsheet, Open Office Calc, etc will all work) (If you're in Excel it's possible you have to take the file out of Protected View first. [See here](https://support.office.com/en-us/article/what-is-protected-view-d6f09ac7-e6b9-4495-8e43-2bbcdbcb6653?ocmsassetID=HA010355931&CorrelationId=04b441d5-5c7c-441a-bbac-8f34b3071869&ui=en-US&rs=en-US&ad=US).) Your spreadsheet will have three sheets (see the little tabs at the bottom): survey, choices, settings. Stay in the survey sheet for now.

4. Find the column called 'label'. This is where your original question labels are stored. Insert another column to the right of label. In the header (first row) of this new column, write `label::language`, for example `label::Français` or `label::English`. Note: you can change the size of your columns, add colors or change the font size, none of these will affect your form.
4. Find the column called 'label'. This is where your original question labels are stored. Insert another column to the right of label. In the header (first row) of this new column, write `label::language (code)`, for example `label::Français (fr)` or `label::English (en)`. Note: you can change the size of your columns, add colors or change the font size, none of these will affect your form.

5. Then, if you have hints in your form, the same needs to apply to that hint column, for example `hint::Français` or `hint::English`.
5. Then, if you have hints in your form, the same needs to apply to that hint column, for example `hint::Français (fr)` or `hint::English (en)`.

![image](/images/language_xls/hints.png)
![image](/images/language_xls/hints_updated.png)

6. Now add your translations for every row inside the `label::yourlanguage` column. When you are done, make sure you didn't skip any questions (for every field that has text inside the label column there should be text inside the `label::yourlanguage` column).
6. Now add your translations for every row inside the `label::yourlanguage (code)` column. When you are done, make sure you didn't skip any questions (for every field that has text inside the label column there should be text inside the `label::yourlanguage (code)` column). You can find the official 2-character language codes (subtags) [here](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry).

Tip: Copy-paste the original label column and then make changes to the translations so you don't leave anything blank by accident: It's better to have something showing in the wrong language than not having a blank question in some language. _You can repeat this step and add as many languages as you like, each in their separate columns and with a different name inside `label::yourlanguage`._
Tip: Copy-paste the original label column and then make changes to the translations so you don't leave anything blank by accident: It's better to have something showing in the wrong language than not having a blank question in some language. _You can repeat this step and add as many languages as you like, each in their separate columns and with a different name inside `label::yourlanguage (code)`._

![image](/images/language_xls/label.png)
![image](/images/language_xls/label_updated.png)

7. Now switch to the 'choices' sheet of your file. (If there is no such sheet in your file -you only have two sheets called survey and settings- then don't worry - your form doesn't use any multiple choice questions -- you're done! Skip the next step.)

8. In the choices sheet you have another column called label. Repeat steps 5 and 6. Make sure that you use the exact same spelling for `label::yourlanguage`. For example, `label::Francais` and `label::Français` are not identical.
8. In the choices sheet you have another column called label. Repeat steps 5 and 6. Make sure that you use the exact same spelling for `label::yourlanguage (code)`. For example, `label::Francais (fr)` and `label::Français (fr)` are not identical.

![image](/images/language_xls/choices_label.png)
![image](/images/language_xls/choices_label_updated.png)

9. In the settings sheet, underneath form_title edit the text of your form's title to something like "My form (English and French)" so you can easily identify it later.

![image](/images/language_xls/form_title.png)
![image](/images/language_xls/form_title_updated.png)

10. Save your file and close Excel.

Expand Down

0 comments on commit 3901dfe

Please sign in to comment.