<?php
namespace PortalPeople\packagemanager;

use Yii;
use yii\base\{BootstrapInterface, Module};
use yii\i18n\PhpMessageSource;

/**
 * HSE Fatigue & Risk Calculator Module
 *
 * This module provides HSE-compliant fatigue and risk index calculations
 * for shift work patterns. It can be integrated into any Yii2 application.
 */
class Module extends Module implements BootstrapInterface
{
    public $controllerNamespace = 'PortalPeople\packagemanager\controllers';

    public function bootstrap($app)
    {
        $this->init();
    }

    public function init()
    {
        parent::init();

        // Register translations if needed
        if (!isset(Yii::$app->i18n->translations['api*'])) {
            Yii::$app->i18n->translations['api*'] = [
                'class' => PhpMessageSource::class,
                'sourceLanguage' => 'en-US',
                'basePath' => '@portalpeople/packagemanager/messages',
            ];
        }
        if (Yii::$app->name === 'NGauge Commerce'){
            \Yii::$app->urlManager->addRules([
                
            ]);
        }
    }
}