2023-01-13 10:55:04 +08:00
|
|
|
export const getCronLocale = (lang: string) => {
|
|
|
|
let packageName = '@nocobase/client';
|
|
|
|
let locale = null;
|
|
|
|
try {
|
|
|
|
const file = `${packageName}/src/locale`;
|
|
|
|
require.resolve(file);
|
|
|
|
locale = require(file).cron?.[lang];
|
|
|
|
} catch (error) {
|
|
|
|
try {
|
|
|
|
const file = `${packageName}/lib/locale`;
|
|
|
|
require.resolve(file);
|
|
|
|
locale = require(file).cron?.[lang];
|
|
|
|
} catch (error) {}
|
|
|
|
}
|
2023-03-19 10:55:05 +08:00
|
|
|
return locale;
|
2023-01-13 10:55:04 +08:00
|
|
|
};
|