mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-03 08:19:37 +08:00
11 lines
396 B
TypeScript
11 lines
396 B
TypeScript
import assign from 'object-assign';
|
|
|
|
export default function getLocale(props, context, componentName, getDefaultLocale) {
|
|
const locale = context && context.antLocale && context.antLocale[componentName] ?
|
|
context.antLocale[componentName] : getDefaultLocale();
|
|
|
|
const result = assign({}, locale, props.locale);
|
|
result.lang = assign({}, locale.lang, props.locale.lang);
|
|
return result;
|
|
}
|