A general approach to quantum fields and strings on adeles