Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions frontend/packages/cozeloop/components/src/columns-select/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
import * as sort from 'react-sortable-hoc';
import { Fragment, useEffect, useMemo, useState } from 'react';

import { IconCozHandle, IconCozTableSetting } from '@coze-arch/coze-design/icons';
import {
IconCozHandle,
IconCozTableSetting,
} from '@coze-arch/coze-design/icons';
import {
Button,
Checkbox,
Expand All @@ -13,6 +16,7 @@ import {
Tooltip,
type ColumnProps,
} from '@coze-arch/coze-design';
import { I18n } from '@cozeloop/i18n-adapter';
// @ts-expect-error react-sortable-hoc ts type issue
const { sortableContainer, sortableElement, sortableHandle } = sort;
const { arrayMove } = sort;
Expand Down Expand Up @@ -231,7 +235,11 @@ export const ColumnSelector = ({
trigger="click"
>
<div>
<Tooltip content="列管理" theme="dark" position="top">
<Tooltip
content={I18n.t('column_management')}
theme="dark"
position="top"
>
<Button
icon={<IconCozTableSetting />}
type="primary"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export function ExprGroupRender<L, O, R>({
type="primary"
>
<span className="text-brand-9 text-[14px] leading-[20px]">
{I18n.t('fornax_components_logic_expr_add_filter')}
{I18n.t('logic_expr_add_filter')}
</span>
</ToolButton>
{showAddGroupButton ? (
Expand All @@ -103,7 +103,7 @@ export function ExprGroupRender<L, O, R>({
icon={<IconCozPlusCircle />}
onClick={() => onAddGroup?.(path)}
>
{I18n.t('fornax_components_logic_expr_add_filter_group')}
{I18n.t('logic_expr_add_filter_group')}
</ToolButton>
</>
) : null}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export const ExprRender = <L, O, R>({
{isEdit ? (
<Tooltip
theme="dark"
content={I18n.t('fornax_components_logic_expr_delete_filter')}
content={I18n.t('logic_expr_delete_filter')}
>
<IconButton
className={classNames(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function LogicNot(props: LogicNotProps) {
onClick();
}}
>
{I18n.t('fornax_components_logic_expr_not')}
{I18n.t('logic_expr_not')}
</div>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,13 @@ export function ColumnsManage({
);

return (
<Tooltip theme="dark" content={I18n.t('column_management')}>
<div>
<ColumnSelector
columns={options}
defaultColumns={defaultOptions}
sortable={sortable}
onChange={hanldeColumnsChange}
/>
</div>
</Tooltip>
<div>
<ColumnSelector
columns={options}
defaultColumns={defaultOptions}
sortable={sortable}
onChange={hanldeColumnsChange}
/>
</div>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const ColumnRender = ({
<div className="flex items-center gap-[4px]">
<Typography.Text className="text-[14px] !font-semibold">
{nameField.getValue() ||
`${I18n.t('data_engine_column_placeholder', { placeholder1: index + 1 })}`}
`${I18n.t('column_placeholder', { placeholder1: index + 1 })}`}
</Typography.Text>
{activeKey.includes(`${index}`) ? (
<IconCozArrowDown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export const useDatasetColumnEdit = ({
<div className="flex items-center gap-2">
{I18n.t('edit_column')}
<Typography.Text className="!coz-fg-secondary">
{I18n.t('data_engine_column_count_info', { currentColumnNum })}
{I18n.t('column_count_info', { currentColumnNum })}
</Typography.Text>
</div>
{ExpandNode}
Expand Down Expand Up @@ -188,7 +188,7 @@ export const useDatasetColumnEdit = ({
<Anchor.Link
key={index}
href={`#column-${index}`}
title={`${item.name || `${I18n.t('data_engine_column_placeholder', { placeholder1: index + 1 })}`}`}
title={`${item.name || `${I18n.t('column_placeholder', { placeholder1: index + 1 })}`}`}
/>
))}
</LoopAnchor>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,7 @@ export const SubmitVersion = ({
datasetDetail?.latest_version || '',
) <= 0
) {
callback(
`${I18n.t('data_engine_new_version_greater_than_current', { placeholder1: datasetDetail?.latest_version })}`,
);
callback(`${I18n.t('new_version_greater_than_current')}`);
return false;
}
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export const DatasetItemList: React.FC<DatasetItemListProps> = ({
<Typography.Text className="!font-medium">
#{(item.item_id as string)?.slice(-5)}
</Typography.Text>
{I18n.t('data_engine_this_change_irreversible')}
{I18n.t('this_change_irreversible')}
</Typography.Text>
),
autoLoading: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export const useBatchSelect = ({
<Typography.Text size="small" className="mx-[2px] font-medium">
{batchSelectItems.size}
</Typography.Text>
{I18n.t('data_engine_items')}
{I18n.t('tiao_items')}
</Typography.Text>
<Typography.Text
link
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const ColumnMapField = ({
ellipsis
className="!coz-fg-secondary ml-3 !w-fit overflow-hidden"
>
{I18n.t('data_engine_import_data_columns')}
{I18n.t('import_data_columns')}
{value?.fieldSchema?.isRequired ? (
<span className="text-red ml-[2px]">*</span>
) : (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export const validarDatasetItem = (
const division = decimalValue.dividedBy(multipleOfDecimal);
if (!division.isInteger()) {
callback(
`${I18n.t('data_engine_decimal_places_support', { placeholder1: multipleOfDecimal.decimalPlaces() })}`,
`${I18n.t('decimal_places_support', { num: multipleOfDecimal.decimalPlaces() })}`,
);
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const DatasetList = () => {
<Typography.Text className="!font-medium mx-[2px]">
{row.name}
</Typography.Text>
{I18n.t('data_engine_this_change_irreversible')}
{I18n.t('this_change_irreversible')}
</Typography.Text>
),
autoLoading: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const ImportResultInfo = ({
<Typography.Text className="!font-medium mx-1">
{Number(progress?.processed) - Number(progress?.added) || 0}
</Typography.Text>
{I18n.t('fornax_tiao')}
{I18n.t('tiao')}
</Typography.Text>
</div>
{errors?.length ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export function handleDelete({
<>
{I18n.t('cozeloop_open_evaluate_confirm_to_delete')}
<span className="font-medium px-[2px]">{record.name}</span>
{I18n.t('data_engine_this_change_irreversible')}
{I18n.t('this_change_irreversible')}
</>
),
okText: I18n.t('delete'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const downloadCSVTemplate = () => {
const fields = ['input', 'reference_output'];
const data = [
[I18n.t('evaluate_biggest_animal_world'), I18n.t('evaluate_blue_whale')],
[I18n.t('evaluate_living_habits_animal'), I18n.t('data_engine_eat_fish')],
[I18n.t('evaluate_living_habits_animal'), I18n.t('eat_fish')],
];
const templateJson: UnparseObject<string[]> = {
fields,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ export const sourceNameRuleValidator: RuleItem['validator'] = (
const firstChar = value.charAt(0);
console.log(firstChar);
if (/^[-_.]/.test(firstChar)) {
callback(I18n.t('data_engine_support_letter_number_chinese_start'));
callback(I18n.t('support_letter_number_chinese_start'));
} else {
callback(
I18n.t('data_engine_support_letter_number_chinese_special_char'),
);
callback(I18n.t('support_letter_number_chinese_special_char'));
}
}
return true;
Expand All @@ -29,9 +27,7 @@ export const columnNameRuleValidator: RuleItem['validator'] = (
callback,
) => {
if (!/^[a-zA-Z][a-zA-Z0-9_]*$/.test(value)) {
callback(
I18n.t('data_engine_support_letter_number_underscore_start_letter'),
);
callback(I18n.t('support_letter_number_underscore_start_letter'));
}
return true;
};
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function getXlsxHeaders(file: File): Promise<string[]> {
};

reader.onerror = () =>
reject(new Error(I18n.t('fornax_knowledge_file_read_fail')));
reject(new Error(I18n.t('knowledge_file_read_fail')));
reader.readAsArrayBuffer(file);
});
}
Expand Down Expand Up @@ -153,6 +153,6 @@ export const getFileHeaders = async (
return { headers: [] };
} catch (error) {
console.error(error);
return { headers: [], error: I18n.t('data_engine_file_format_error') };
return { headers: [], error: I18n.t('file_format_error') };
}
};
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useMemo } from 'react';

import { type EventParams } from '@visactor/vchart';
import { I18n } from '@cozeloop/i18n-adapter';
import { type ColumnAnnotation } from '@cozeloop/api-schema/evaluation';

import { CHART_MORE_KEY, getScorePercentage, splitData } from '../utils';
Expand Down Expand Up @@ -32,7 +33,7 @@ export function AnnotateChartCard({
return cur;
},
{
[CHART_MORE_KEY]: I18n.t('fornax_analytics_subtitle_others'),
[CHART_MORE_KEY]: I18n.t('analytics_subtitle_others'),
} as unknown as Record<string, string>,
);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useMemo } from 'react';

import { type EventParams } from '@visactor/vchart';
import { I18n } from '@cozeloop/i18n-adapter';
import { type ColumnEvaluator } from '@cozeloop/api-schema/evaluation';

import { CHART_MORE_KEY, getScorePercentage, splitData } from '../utils';
Expand Down Expand Up @@ -34,7 +35,7 @@ export function EvaluatorChartCard({
const { data } = splitData(originalData, maxCount);

const nameMap = {
[CHART_MORE_KEY]: I18n.t('fornax_analytics_subtitle_others'),
[CHART_MORE_KEY]: I18n.t('analytics_subtitle_others'),
};
const result: ChartItemValue[] = data.map(([score, item]) => ({
name: nameMap[score] ?? score,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export function TagSelect({
}}
>
<IconCozPlus />
<span className="ml-2">{I18n.t('data_engine_create_new_tag')}</span>
<span className="ml-2">{I18n.t('create_new_tag')}</span>
</div>
}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function AnnotateColumnHeader({
<div className="group flex items-center max-w-full">
<TypographyText>{annotation.tag_key_name}</TypographyText>
<Tag color="grey" size="small" className="ml-1 shrink-0">
{I18n.t('data_engine_manual_annotation')}
{I18n.t('manual_annotation')}
</Tag>
<Button
icon={<IconCozTrashCan />}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,7 @@ export default function ({
setExpand(e.target.value === 'quick_annotate');
}}
>
<Radio value="default">
{I18n.t('fornax_prompt_compare_normal')}
</Radio>
<Radio value="default">{I18n.t('prompt_compare_normal')}</Radio>
<Radio value="quick_annotate">
{I18n.t('quick_annotation_mode')}
</Radio>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export function getFilterFields(
?.map(getEvalSetLogicField),
},
{
title: I18n.t('data_engine_manual_annotation'),
title: I18n.t('manual_annotation'),
name: 'annotation',
type: 'options',
children: columnAnnotations?.map(getAnnotationLogicField),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export default function ExperimentItemDetail({
}}
disabled={activeItemStore.isFirst}
>
{I18n.t('data_engine_previous')}
{I18n.t('previous')}
</Button>
<Button
icon={<IconCozArrowRight />}
Expand All @@ -114,7 +114,7 @@ export default function ExperimentItemDetail({
}}
disabled={activeItemStore.isLast}
>
{I18n.t('data_engine_next')}
{I18n.t('next')}
</Button>
<Divider layout="vertical" style={{ height: '12px' }} />
<ColumnsManage
Expand Down Expand Up @@ -160,7 +160,7 @@ export default function ExperimentItemDetail({
borderBottom: '1px solid var(--coz-stroke-primary',
}}
>
{I18n.t('loop_evaluate_evaluation_dataset')}
{I18n.t('loop_evaluation_dataset')}
</div>
<div className="overflow-auto">
<ExperimentItemDetailTable
Expand All @@ -176,7 +176,7 @@ export default function ExperimentItemDetail({
<div className="text-[var(--coz-fg-plus)]">
<EvalActualOutputTable expand={expand} item={item} />
</div>
<CollapsibleField title={I18n.t('loop_evaluate_evaluator_score')}>
<CollapsibleField title={I18n.t('evaluator_score')}>
<EvaluatorResultTable
spaceID={spaceID}
evaluatorRecordMap={item?.evaluatorsResult}
Expand All @@ -189,7 +189,7 @@ export default function ExperimentItemDetail({
</CollapsibleField>
<div className="h-2"></div>
{columnAnnotations.length ? (
<CollapsibleField title={I18n.t('data_engine_manual_annotation')}>
<CollapsibleField title={I18n.t('manual_annotation')}>
<AnnotateTable
spaceID={spaceID as string}
annotation={columnAnnotations}
Expand Down
Loading
Loading