1 import { getLocale } from '../locale/locales';
2 import { deprecate } from '../utils/deprecate';
4 // If passed a locale key, it will set the locale for this
5 // instance. Otherwise, it will return the locale configuration
6 // variables for this instance.
7 export function locale (key) {
10 if (key === undefined) {
11 return this._locale._abbr;
13 newLocaleData = getLocale(key);
14 if (newLocaleData != null) {
15 this._locale = newLocaleData;
21 export var lang = deprecate(
22 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',
24 if (key === undefined) {
25 return this.localeData();
27 return this.locale(key);
32 export function localeData () {