<?php

/**
 * Plugin translation model.
 *
 * @package northmill-online-shared
 */
declare (strict_types=1);
namespace Northmill_Online_Shared_Checkout\Northmill_Online_Shared\Modules\i18n\Models;

use Northmill_Online_Shared_Checkout\Northmill_Online_Shared\Helpers\General_Helpers;
defined('ABSPATH') || exit;
/**
 * Class Plugin_Translation_Model
 */
class Plugin_Translation_Model extends Abstract_Translation_Model
{
    /**
     * {@inheritDoc}
     */
    protected function register_translation(): void
    {
        add_action('plugins_loaded', array($this, 'load_textdomain'), $this->priority, 0);
    }
    /**
     * {@inheritDoc}
     */
    protected function set_mofile_name(): void
    {
        $prefix = $this->mofile_prefix ?? $this->textdomain;
        $mofile_prefix = General_Helpers::ensure_trailing_symbol($prefix, '-');
        $this->mofile_name = $mofile_prefix . $this->locale . '.mo';
    }
}
