chore: replace all cn comments of fe to en version by volc api (#320)

This commit is contained in:
tecvan
2025-07-31 10:32:15 +08:00
committed by GitHub
parent 716ec0cba8
commit 71f6245a01
2960 changed files with 15545 additions and 15545 deletions

View File

@@ -18,37 +18,37 @@ import cronstrue from 'cronstrue/i18n';
import { I18n } from '@coze-arch/i18n';
const langMap = {
// 简体中文
// Simplified Chinese
'zh-CN': 'zh_CN',
zh: 'zh-CN',
// 繁体中文
// Traditional Chinese
zh_TW: 'zh_TW',
// 英语
// English
'en-US': 'en',
en: 'en',
// 日语
// Japanese
'ja-JP': 'ja',
ja: 'ja',
// 韩语
// Korean
'ko-KR': 'ko',
ko: 'ko',
// 法语
// French
'fr-FR': 'fr',
fr: 'fr',
// 德语
// German
'de-DE': 'de',
de: 'de',
// 意大利语
// Italian
'it-IT': 'it',
it: 'it',
// 西班牙语
// Spanish
'es-ES': 'es',
es: 'es',
};
// 校验使用 cronjob 翻译结果
// Verify translation results using cronjob
export const isCronJobVerify = cronJob => {
// 仅支持 6 位 cronjob后端限制
// Only 6-bit cronjobs are supported (backend limit).
const parts = cronJob?.split(' ');
if (parts?.length !== 6) {
return false;
@@ -59,9 +59,9 @@ export const isCronJobVerify = cronJob => {
throwExceptionOnParseError: true,
});
// 额外校验一下字符串是否包含 null undefined
// 1 2 3 31 1- 1 在上午 03:02:01, 限每月 31 号, 或者为星期一, 一月至undefined
// 1 2 3 31 1 1#6 在上午 03:02:01, 限每月 31 号, 限每月的null 星期一, 仅于一月份
// Extra check if the string contains null undefined
// 1 2 3 31 1- 1 at 03:02:01 am, limited to the 31st of each month, or for Monday, January to undefined
// 1 2 3 31 1 1 #6 at 03:02:01 am, limited to the 31st of each month, limited to null Mondays of each month, only in January
if (rs.includes('null') || rs.includes('undefined')) {
return false;
}

View File

@@ -18,7 +18,7 @@ import dayjs from 'dayjs';
let getIsIPadCache: boolean | undefined;
/**
* gpt-4 提供的代码
* Code provided by gpt-4
*/
export const getIsIPad = () => {
if (typeof getIsIPadCache === 'undefined') {
@@ -34,7 +34,7 @@ export const getIsIPad = () => {
return getIsIPadCache;
};
/* 时间戳转文本,并省略年份或日期*/
/* Timestamp converts text and omits the year or date*/
export const formatOmittedDateTime = time => {
if (!time) {
return '';
@@ -46,20 +46,20 @@ export const formatOmittedDateTime = time => {
let formatStr: string;
if (!today.isSame(day, 'year')) {
// 不是当年,展示年份
// Not the year, show the year
formatStr = 'YYYY-MM-DD HH:mm';
} else if (!today.isSame(day, 'day')) {
// 不是当天, 展示日期
// Not the day, the display date.
formatStr = 'MM-DD HH:mm';
} else {
// 当天只展示时间
// Show time only on the day
formatStr = 'HH:mm';
}
return day.format(formatStr);
};
/** 等待 */
/** wait */
export const wait = (ms: number) =>
new Promise(r => {
setTimeout(r, ms);
@@ -68,7 +68,7 @@ export const wait = (ms: number) =>
import { reporter as infraReporter } from '@coze-arch/logger';
/**
* 流程使用的 slardar 上报实例
* The slardar reporting instance used by the process
*/
export const reporter = infraReporter.createReporterWithPreset({
namespace: 'workflow',