<?php

function i18n_initialize(string $packge,string $localedir,?string $locale) {
    if (function_exists("gettext")) {
        if (!$locale) {
            $locale="";
        }
        setlocale(LC_ALL, $locale);
        
        bindtextdomain($package, $localedir);
        if (function_exists("bind_textdomain_codeset")) {
            bind_textdomain_codeset($package,"UTF-8");
        }
    }
}

