@Override
    public void onEnable() {
        FishMetrics.onEnabled(this);

        this.api = new PluginApi();

        FileConfiguration config = getConfig();
        api.reloadMessages(config);

        int delay = config.getInt("delay", 20);
        setupPeriodicBroadcast(delay);
        
        String locale = config.getString("locale", "en");
        if(locale == null || locale.isEmpty()) {
            locale = "en";
        }
        
        YamlConfiguration defaultConfig = new YamlConfiguration();
        InputStream defaultStream = getResource("default_messages.yml");
        
        try {
            defaultConfig.load(defaultStream);
        } catch (IOException | InvalidConfigurationException ex) {
            Logger.getLogger(Plugin.class.getName()).log(Level.SEVERE, null, ex);
        }
        
        YamlConfiguration messagesConfig = new YamlConfiguration();
        File messagesFile = new File(getDataFolder(), "messages_" + locale + ".yml");
        
        try {
            messagesConfig.load(messagesFile);
        } catch (FileNotFoundException ex) {
            Logger.getLogger(Plugin.class.getName()).log(Level.WARNING, "Could not find file: " + messagesFile);
        } catch (IOException | InvalidConfigurationException ex) {
            Logger.getLogger(Plugin.class.getName()).log(Level.SEVERE, null, ex);
        }
        
        LanguageStrings strings = new LanguageStrings(messagesConfig, defaultConfig);
        getCommand("brc").setExecutor(new BroadcastCommand(this, api, strings));
    }