[improvement] rename packages dir to src (#3659)
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import { get } from '..';
|
||||
import { camelize } from '../format/string';
|
||||
import locale from '../../locale';
|
||||
|
||||
export function createI18N(name: string) {
|
||||
const prefix = camelize(name) + '.';
|
||||
|
||||
return function (path: string, ...args: any[]): string {
|
||||
const message = get(locale.messages(), prefix + path) || get(locale.messages(), path);
|
||||
return typeof message === 'function' ? message(...args) : message;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user