Skip to content

Commit

Permalink
add more docs
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielHabenicht committed May 14, 2021
1 parent 15913d2 commit 5534710
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
13 changes: 7 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing

## Translate Questionnaires
## Translate Questionnaires

[Head over to Crowdin and submit translations in any language you speak.](https://wevsvirushack.crowdin.com/covquestions)

Expand All @@ -15,13 +15,16 @@ After creating you Questionnaire you can either send us an email, open an issue

1. Clone this repo `git clone https://github.com/CovOpen/CovQuestions.git`.
2. Navigate to [`api/v1`](/api/v1).
3. Add your `questionnaire.json` to the `./input` folder. Make sure:
3. Add your `questionnaire.json` to the [`input`](/api/v1/input) folder. Make sure:
- that `id` and `version` of your Questionnaire are unique. (Check the [`api/v1/src/data`](/api/v1/src/data) folder for id's (folder name) and versions (child folder names))
- again the id (look into [src/data](./src/data) for already published questionnaires).
- the version number and maybe increase it.
- the questionnaire has to be in english (you can submit/add translations later)
- the language of the questionnaire and the language specified in the `language` attribute.
4. Run `npm run pre-build`
7. Commit and create a Branch which can be merged to master.
5. Create a Branch, commit and open a PR which can be merged to master.

Now the CD Pipeline will take over.
Now the CD Pipeline will take over.

## Submit a new version of a Questionnaire

Expand All @@ -31,8 +34,6 @@ Now the CD Pipeline will take over.
2. (Optional) Add your translation files to data/questionnaires/<your Questionnaire Id>/i18n.
3. Run npm run pre-build-trans. (If you dont have any translations you can run both commands with npm run pre-build)



## Translate a Questionnaire

Head over to https://wevsvirushack.crowdin.com/covquestions and start translating.
Expand Down
3 changes: 1 addition & 2 deletions api/v1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ To generate the documentation run `npm run build-swagger`.

## Update questionnaires

In order to update a questionnaire or submit a new one:
See our [Contributers Guide](/CONTRIBUTING.md)

1. Add a new questionnaire in the `data/questionnaire` folder. (don't forget to increase the version number)
2. Run `npm run i18n-extract` this will modify your questionnaire and update it with unique translation ids. Furtermore it submits your strings to the localization file (in `i18n`).

(Run the build process)
Expand Down
2 changes: 2 additions & 0 deletions api/v1/src/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export function validate(path: string) {

const questionnaire = JSON.parse(fs.readFileSync(path, "utf8"));

console.log("Validating schema...");
var valid = jsonValidator.validate("schema.json", questionnaire);
if (!valid)
throw Error(
Expand All @@ -22,6 +23,7 @@ export function validate(path: string) {
)}`
);

console.log("Running embedded Tests...");
validateWithTestCases(questionnaire);
}

Expand Down

0 comments on commit 5534710

Please sign in to comment.