LocaleModel::testLocale PHP Méthode

testLocale() public méthode

Temporarily enable a locale pack without installing it/
public testLocale ( string $LocaleKey )
$LocaleKey string The key of the folder.
    public function testLocale($LocaleKey)
    {
        $Available = $this->availableLocalePacks();
        if (!isset($Available[$LocaleKey])) {
            throw notFoundException('Locale');
        }
        // Grab all of the definition files from the locale.
        $Paths = SafeGlob(PATH_ROOT . "/locales/{$LocaleKey}/*.php");
        // Unload the dynamic config
        Gdn::locale()->unload();
        // Load each locale file, checking for errors
        foreach ($Paths as $Path) {
            Gdn::locale()->load($Path, false);
        }
    }