I have a flask app with database. I need to localize some types of entities there. The problem is, i am using Flask-Marshmallow for parsing/serializing my database objects. And there is an endpoint, that grabs the root object (User) and all it related nested objects (Match), which in it's turn grab it's related objects (Question), which i need to localize. So, having Accept-Language header can't be directly passed to nested->nested (Question) object. It's some architecture issue, i believe, not a technical one. If someone ever face such a problem and know any workarounds, please let me know.
# views.py
@app.route('/self', methods=['GET'])
@auth.login_required
def get_user:
user = g.user
schema = UserSchema()
res = schema.dumps(user)
# UserSchema.py
class UserSchema(marshmallow.Schema):
id = fields.Int()
matches = fields.Nested('MatchSchema', many=True)
// etc.