Docs - add 'fr' translation + fixes

This commit is contained in:
Sam
2023-06-18 20:45:39 +02:00
parent bf1e12f35d
commit 4491b8f8de
69 changed files with 3783 additions and 3385 deletions

View File

@@ -65,13 +65,13 @@ def get_workouts(auth_user: User) -> Union[Dict, HttpResponse]:
**Example requests**:
- without parameters
- without parameters:
.. sourcecode:: http
GET /api/workouts/ HTTP/1.1
- with some query parameters
- with some query parameters:
.. sourcecode:: http
@@ -79,7 +79,7 @@ def get_workouts(auth_user: User) -> Union[Dict, HttpResponse]:
**Example responses**:
- returning at least one workout
- returning at least one workout:
.. sourcecode:: http
@@ -187,7 +187,7 @@ def get_workouts(auth_user: User) -> Union[Dict, HttpResponse]:
:query integer per_page: number of workouts per page
(default: 5, max: 100)
:query integer sport_id: sport id
:quert string title: any part (or all) of the workout title;
:query string title: any part (or all) of the workout title;
title matching is case-insensitive
:query string from: start date (format: ``%Y-%m-%d``)
:query string to: end date (format: ``%Y-%m-%d``)
@@ -206,12 +206,12 @@ def get_workouts(auth_user: User) -> Union[Dict, HttpResponse]:
:reqheader Authorization: OAuth 2.0 Bearer Token
:statuscode 200: success
:statuscode 200: ``success``
:statuscode 401:
- provide a valid auth token
- signature expired, please log in again
- invalid token, please log in again
:statuscode 500:
- ``provide a valid auth token``
- ``signature expired, please log in again``
- ``invalid token, please log in again``
:statuscode 500: ``error, please try again or contact the administrator``
"""
try:
@@ -315,7 +315,7 @@ def get_workout(
**Example responses**:
- success
- success:
.. sourcecode:: http
@@ -377,13 +377,13 @@ def get_workout(
:reqheader Authorization: OAuth 2.0 Bearer Token
:statuscode 200: success
:statuscode 200: ``success``
:statuscode 401:
- provide a valid auth token
- signature expired, please log in again
- invalid token, please log in again
:statuscode 403: you do not have permissions
:statuscode 404: workout not found
- ``provide a valid auth token``
- ``signature expired, please log in again``
- ``invalid token, please log in again``
:statuscode 403: ``you do not have permissions``
:statuscode 404: ``workout not found``
"""
workout_uuid = decode_short_id(workout_short_id)
@@ -499,15 +499,15 @@ def get_workout_gpx(
:reqheader Authorization: OAuth 2.0 Bearer Token
:statuscode 200: success
:statuscode 200: ``success``
:statuscode 401:
- provide a valid auth token
- signature expired, please log in again
- invalid token, please log in again
- ``provide a valid auth token``
- ``signature expired, please log in again``
- ``invalid token, please log in again``
:statuscode 404:
- workout not found
- no gpx file for this workout
:statuscode 500:
- ``workout not found``
- ``no gpx file for this workout``
:statuscode 500: ``error, please try again or contact the administrator``
"""
return get_workout_data(auth_user, workout_short_id, 'gpx')
@@ -570,15 +570,15 @@ def get_workout_chart_data(
:reqheader Authorization: OAuth 2.0 Bearer Token
:statuscode 200: success
:statuscode 200: ``success``
:statuscode 401:
- provide a valid auth token
- signature expired, please log in again
- invalid token, please log in again
- ``provide a valid auth token``
- ``signature expired, please log in again``
- ``invalid token, please log in again``
:statuscode 404:
- workout not found
- no gpx file for this workout
:statuscode 500:
- ``workout not found``
- ``no gpx file for this workout``
:statuscode 500: ``error, please try again or contact the administrator``
"""
return get_workout_data(auth_user, workout_short_id, 'chart_data')
@@ -624,14 +624,14 @@ def get_segment_gpx(
:reqheader Authorization: OAuth 2.0 Bearer Token
:statuscode 200: success
:statuscode 400: no gpx file for this workout
:statuscode 200: ``success``
:statuscode 400: ``no gpx file for this workout``
:statuscode 401:
- provide a valid auth token
- signature expired, please log in again
- invalid token, please log in again
:statuscode 404: workout not found
:statuscode 500:
- ``provide a valid auth token``
- ``signature expired, please log in again``
- ``invalid token, please log in again``
:statuscode 404: ``workout not found``
:statuscode 500: ``error, please try again or contact the administrator``
"""
return get_workout_data(auth_user, workout_short_id, 'gpx', segment_id)
@@ -647,7 +647,7 @@ def get_segment_chart_data(
auth_user: User, workout_short_id: str, segment_id: int
) -> Union[Dict, HttpResponse]:
"""
Get chart data from a workout gpx file, to display it with Recharts
Get chart data from a workout gpx file, to display it with Chart.js.
**Scope**: ``workouts:read``
@@ -697,14 +697,14 @@ def get_segment_chart_data(
:reqheader Authorization: OAuth 2.0 Bearer Token
:statuscode 200: success
:statuscode 400: no gpx file for this workout
:statuscode 200: ``success``
:statuscode 400: ``no gpx file for this workout``
:statuscode 401:
- provide a valid auth token
- signature expired, please log in again
- invalid token, please log in again
:statuscode 404: workout not found
:statuscode 500:
- ``provide a valid auth token``
- ``signature expired, please log in again``
- ``invalid token, please log in again``
:statuscode 404: ``workout not found``
:statuscode 500: ``error, please try again or contact the administrator``
"""
return get_workout_data(
@@ -739,14 +739,14 @@ def download_workout_gpx(
:param string workout_short_id: workout short id
:statuscode 200: success
:statuscode 200: ``success``
:statuscode 401:
- provide a valid auth token
- signature expired, please log in again
- invalid token, please log in again
- ``provide a valid auth token``
- ``signature expired, please log in again``
- ``invalid token, please log in again``
:statuscode 404:
- workout not found
- no gpx file for workout
- ``workout not found``
- ``no gpx file for workout``
"""
workout_uuid = decode_short_id(workout_short_id)
workout = Workout.query.filter_by(
@@ -794,13 +794,13 @@ def get_map(map_id: int) -> Union[HttpResponse, Response]:
:param string map_id: workout map id
:statuscode 200: success
:statuscode 200: ``success``
:statuscode 401:
- provide a valid auth token
- signature expired, please log in again
- invalid token, please log in again
:statuscode 404: map does not exist
:statuscode 500:
- ``provide a valid auth token``
- ``signature expired, please log in again``
- ``invalid token, please log in again``
:statuscode 404: ``map does not exist``
:statuscode 500: ``error, please try again or contact the administrator``
"""
try:
@@ -967,16 +967,16 @@ def post_workout(auth_user: User) -> Union[Tuple[Dict, int], HttpResponse]:
:statuscode 201: workout created
:statuscode 400:
- invalid payload
- no file part
- no selected file
- file extension not allowed
- ``invalid payload``
- ``no file part``
- ``no selected file``
- ``file extension not allowed``
:statuscode 401:
- provide a valid auth token
- signature expired, please log in again
- invalid token, please log in again
:statuscode 413: error during picture update: file size exceeds 1.0MB
:statuscode 500:
- ``provide a valid auth token``
- ``signature expired, please log in again``
- ``invalid token, please log in again``
:statuscode 413: ``error during picture update: file size exceeds 1.0MB``
:statuscode 500: ``error, please try again or contact the administrator``
"""
try:
@@ -1151,12 +1151,12 @@ def post_workout_no_gpx(
:reqheader Authorization: OAuth 2.0 Bearer Token
:statuscode 201: workout created
:statuscode 400: invalid payload
:statuscode 400: ``invalid payload``
:statuscode 401:
- provide a valid auth token
- signature expired, please log in again
- invalid token, please log in again
:statuscode 500:
- ``provide a valid auth token``
- ``signature expired, please log in again``
- ``invalid token, please log in again``
:statuscode 500: ``error, please try again or contact the administrator``
"""
workout_data = request.get_json()
@@ -1325,13 +1325,13 @@ def update_workout(
:reqheader Authorization: OAuth 2.0 Bearer Token
:statuscode 200: workout updated
:statuscode 400: invalid payload
:statuscode 400: ``invalid payload``
:statuscode 401:
- provide a valid auth token
- signature expired, please log in again
- invalid token, please log in again
:statuscode 404: workout not found
:statuscode 500:
- ``provide a valid auth token``
- ``signature expired, please log in again``
- ``invalid token, please log in again``
:statuscode 404: ``workout not found``
:statuscode 500: ``error, please try again or contact the administrator``
"""
workout_data = request.get_json()
@@ -1418,11 +1418,11 @@ def delete_workout(
:statuscode 204: workout deleted
:statuscode 401:
- provide a valid auth token
- signature expired, please log in again
- invalid token, please log in again
:statuscode 404: workout not found
:statuscode 500: error, please try again or contact the administrator
- ``provide a valid auth token``
- ``signature expired, please log in again``
- ``invalid token, please log in again``
:statuscode 404: ``workout not found``
:statuscode 500: ``error, please try again or contact the administrator``
"""