LocaleScanner

LocaleScanner

class LocaleScanner

Scans a directory with data files for locales.

The name of each file with the extension ".txt" is considered, if it "looks" like a locale:

  • the name must start with two letters;
  • the two letters may optionally be followed by an underscore and any sequence of other symbols.

For example, "de" and "de_DE" are considered to be locales. "root" and "meta" are not.

Methods

array scanLocales(string $sourceDir)

Returns all locales found in the given directory.

array scanAliases(string $sourceDir)

Returns all locale aliases found in the given directory.

Details