Custom module for adding a userrole after registration

Normally I’d do this with Rules, but the Drupal 8 version is not really usable through the UI at the moment; so I decided to try this with a custom module “add_userrole”, consisting of 2 files.

add_userrole.info.yml

name: Add Userrole
type: module
description: Add the correct userrole after saving a new user
package: Custom
core: 8.x

add_userrole.module

function add_userrole_user_presave(UserInterface $user) {
  $rol = $user->get('field_userrole')->value;
  if ($user->isNew()) {
    if ($rol == 'model') {
        $user->addRole('roleA');
    }
    if ($rol == 'fotograaf') {
        $user->addRole('roleB');
    }
    if ($rol == 'stylist') {
        $user->addRole('roleC');
    }
    if ($rol == 'modellenbureau') {
        $user->addRole('roleD');
    }
    if ($rol == 'videograaf') {
        $user->addRole('roleE');
    }
  }
}

After enabling the module, I get an error about config translations. Although my default language isn’t English, I find this strange because I’ve read that the info.yml file needs to contain the following code in order to take into account config translations, which is not the case in my info.yml file:

interface translation project
interface translation server pattern

Why do I get this error?

Drupal version: 


Source: https://www.drupal.org/taxonomy/term/4/feed