Skip to content

[2.3][Translator] locales with @latin not available anymore #11396

@takeit

Description

@takeit

Hi,

What about if I have translation file like: messages.sr@latin.yml ? sr@latin is a valid ISO language code for Serbian in the Latin alphabet. After I have updated the Symfony 2.3 it throws InvalidArgumentException which means I cannot use files containing @latin. Before it worked just fine. Is is done for some special purpose @fabpot ?

Commit reference: 06a80fb

This is a reference code:

/**
     * Asserts that the locale is valid, throws an Exception if not.
     *
     * @param string $locale Locale to tests
     *
     * @throws \InvalidArgumentException If the locale contains invalid characters
     */
    private function assertValidLocale($locale)
    {
        if (0 !== preg_match('/[^a-z0-9_\\.\\-]+/i', $locale, $match)) {
            throw new \InvalidArgumentException(sprintf('Invalid locale: %s.', $locale));
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions