Nit: Indentation is messed up it should be:

```js
locales = Array.isArray(locales) ? locales :
          typeof(locales) == 'string' ? [ locales ] :
          null;
```