[TYPO3-doc] Domain model for documentation

Robert Lemke robert at typo3.org
Mon Jul 30 09:19:52 CEST 2012


Hi François,

On 28.07.2012, at 19:35, François Suter <fsu-lists at cobweb.ch> wrote:

> OK. Is there a list of all locales available in FLOW3 or should we just validate the general "ab_CD" schema (e.g. with a regexp like /[a-z]{2}(_[A-Z]{2}/ ?

Basically it's all in http://www.ietf.org/rfc/rfc4646.txt … but to simplify things a bit, you can take a shortcut an look at the Locale class in FLOW3.

The regex we are using takes most cases of the standard into account:

/^(?P<language>[a-zA-Z]{2,3})(?:[-_](?P<script>[a-zA-Z]{4}))?(?:[-_](?P<region>[a-zA-Z]{2}|[0-9]{3})){0,1}(?:[-_](?P<variant>(?:[a-zA-Z0-9]{5,8})|(?:[0-9][a-zA-Z0-9]{3})))?(?:[-_].+)*$/

Cheers,
Robert



More information about the TYPO3-project-documentation mailing list