Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
[READ-ONLY] Subtree split of the Symfony Locale Component -- clone into Symfony/Component/ (master at symfony/symfony)
PHP

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
Exception
Resources
Stub
Tests
CHANGELOG.md
LICENSE
Locale.php
README.md
composer.json
phpunit.xml.dist

README.md

Locale Component

Locale provides fallback code to handle cases when the intl extension is missing.

Loading the fallback classes for example using the ClassLoader component only requires adding the following lines to your autoloader:

// intl
if (!function_exists('intl_get_error_code')) {
    require __DIR__.'/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs/functions.php';

    $loader->registerPrefixFallback(__DIR__.'/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs');
}

Resources

You can run the unit tests with the following command:

phpunit

If your PHP have the intl extension enabled but the intl extension ICU data version mismatch the one shipped with the component, you can build the data for it and use the USE_INTL_ICU_DATA_VERSION environment variable.

php Resources/data/build-data.php
export USE_INTL_ICU_DATA_VERSION=true
phpunit

This way the tests will use the ICU data files with the same version of your intl extension.

Read the file Resources/data/UPDATE.txt for more info about building or updating the ICU data files.

Something went wrong with that request. Please try again.