diff --git a/package.json b/package.json index e993d7f..919ef93 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "scripts": { "dev": "vite --host", "dev-test": "vite --host --mode=test", + "dev-lang-en": "set APP_LANGUAGE=en-US && vite --host --mode=lang-en", "build": "tsc && vite build", "build-test": "tsc && vite build --mode=test", "build-relative": "tsc && vite build --mode=relative", diff --git a/src/assets/core.scss b/src/assets/core.scss index 1068bb6..4cb65b1 100644 --- a/src/assets/core.scss +++ b/src/assets/core.scss @@ -454,6 +454,19 @@ } } } +.lang-en-US{ + .page-action { + button{ + @apply min-w-[140px]; + .text{ + text-align: center; + } + svg{ + margin-left: 5px; + } + } + } +} // 时间选择 .timer-select-container { diff --git a/src/components/article/edit-modal.tsx b/src/components/article/edit-modal.tsx index 167646f..710fa66 100644 --- a/src/components/article/edit-modal.tsx +++ b/src/components/article/edit-modal.tsx @@ -145,7 +145,7 @@ export default function ArticleEditModal(props: Props) { onCancel={() => props.onClose?.()} okButtonProps={{loading: state.loading}} onOk={handleSave} - okText={props.type == 'news' ? t('confirm') : t('news.edit_generate_video_again')} + okText={props.type == 'news' ? t('confirm_text') : t('news.edit_generate_video_again')} >
{ @@ -170,7 +170,7 @@ export default function ArticleEditModal(props: Props) {
{props.type == 'news' && props.id ? : null} - +
); diff --git a/src/components/form/tag-select.tsx b/src/components/form/tag-select.tsx index 3b0fa1e..4f37b64 100644 --- a/src/components/form/tag-select.tsx +++ b/src/components/form/tag-select.tsx @@ -122,7 +122,7 @@ const TagSelect = (props: { set(!visible) }} > - {checkedAll || selectValues.length == 0 ? t('news.news_all_source') : t('news.source')} + {(checkedAll || selectValues.length == 0) ? t('news.news_all_source') : t('news.source')}
@@ -131,7 +131,7 @@ const TagSelect = (props: {
  • handleAllChanged(!checkedAll)}>t('news.news_all_source') + onClick={() => handleAllChanged(!checkedAll)}>{t('news.news_all_source')} handleAllChanged(e.target.checked)}/>
    diff --git a/src/i18n/translations/en-US.json b/src/i18n/translations/en-US.json index 091909f..94c1f63 100644 --- a/src/i18n/translations/en-US.json +++ b/src/i18n/translations/en-US.json @@ -1,5 +1,5 @@ { - "AppTitle": "Metahuman Streaming platform", + "AppTitle": "AI Livesteam", "Hello": "Hello", "close": "Close", "confirm": { @@ -12,21 +12,21 @@ "delete_success": "Delete success", "download": "Download", "generating": { - "title": "Preview - Click video item to play" + "title": "Preview - Click the video to play" }, "history": { "delete_confirm": "Are you sure you want to delete this video?", "push_success": "Streaming success", - "search_key": "Please enter keywords for video title", - "text": "History video" + "search_key": "Please enter title keywords", + "text": "Video history" }, "live": { "duration": "Duration", - "edit_locked": "Disable to sort", + "edit_locked": "Locked", "edit_unlock": "Unlock", "play_first": "Play first video", - "playlist_count": "Current playlist total has {{count}} items", - "title": "Live" + "playlist_count": "{{count}} videos in total", + "title": "Livestream" }, "login": { "code_sending": "Sending...", @@ -43,7 +43,7 @@ "editing": "Editing", "generating": "Generating", "live": "Streaming", - "materials": "News Materials" + "materials": "News" }, "news": { "delete_confirm": "Are you sure you want to delete this item?", @@ -52,18 +52,19 @@ "delete_empty": "Please select the items to delete", "download_empty": "Please select the news to download", "download_failed": "Download failed!", - "edit_form_search": "Please enter keywords for news title", + "edit_form_search": "Please enter title keywords", "editing": "Editing", "filter_all": "All", "filter_source": "News source", "generate_video": "Generating", "get_detail": "Get news details", "get_detail_error": "Get new details failed", - "image_count": "image", + "image_count": "Images", + "word_count": "Words", "materials": { "title": "News Materials" }, - "news_all_source": "source", + "news_all_source": "All", "push_empty": "please select the news to edit", "push_failed": "Failed to editing", "push_stream_empty": "please select the news to streaming", @@ -72,41 +73,37 @@ "push_success": "Push success", "push_to_edit": "Editing", "pushed": "Pushed", - "search_key_title": "Please enter keywords", + "search_key_title": "Please enter title keywords", "source": "source", "title": "News content", "title_image_count": "Number of pictures", - "title_operate": "Operation", + "title_operate": "", "title_time": "time", "title_word_count": "Wordcount", - "word_count": "word", - - "edit_digital_text": "MetaHuman materiel", - "edit_other_text": "Other media materiel", + "edit_digital_text": "MetaHuman Material", + "edit_other_text": "Other media Material", "edit_generate_video_again": "Regenerate", "edit_generate_again": "Regenerate", - "edit_generate_video": "Video generation", + "edit_generate_video": "Generating", "edit_save_failed": "Save failed!", - "edit_notice_keep_1": "Keep at least one content block", "edit_notice_enter_text": "Please enter content", "edit_notice_enter_article_title": "Please enter title", "edit_notice_enter_article_title1": "Please enter news title", "edit_notice_enter_article_content": "Please enter content", - "edit_add_group": "Add Group", "edit_delete_group": "Delete Group", - "edit_delete_group_confirm": "Are you sure delete the group?", + "edit_delete_group_confirm": "Are you sure you want to delete the group?", "delete_the_picture": "Are you sure delete the picture?" }, "upload": { "upload_failed": "Upload failed", "delete_confirm": "Are you sure delete the picture?", - "upload_image": "Upload Picture" + "upload_image": "Upload Image" }, "delete": "Delete", "cancel": "Cancel", - "confirm": "Confirm", + "confirm_text": "Confirm", "select": { "pushed": "Pushed: {{count}}", "select_all": "Select all", @@ -116,7 +113,7 @@ "total": "Total: {{count}}" }, "time_filter": { - "all": "All time", + "all": "All", "last_week": "Last week", "past_24_hour": "Past 24 hour", "past_30_min": "Past 30 min", @@ -144,9 +141,10 @@ "sort_modify_success": "Video sequence changed", "title": "Title", "title_generated_time": "Time stamp", - "title_operation": "Operation", + "title_operation": "", "title_thumb": "Cover", "playing": "Playing", "generating": "Generating" - } -} \ No newline at end of file + }, + "history.pushed": "Streaming: {{count}}" +} diff --git a/src/i18n/translations/zh-CN.json b/src/i18n/translations/zh-CN.json index 89af5d8..ddbe421 100644 --- a/src/i18n/translations/zh-CN.json +++ b/src/i18n/translations/zh-CN.json @@ -80,20 +80,17 @@ "title_time": "时间", "title_word_count": "字数", "word_count": "字数", - "edit_digital_text": "数字人主播台编辑区", "edit_other_text": "素材融合呈现编辑区", "edit_generate_video_again": "重新生成", "edit_generate_again": "重新生成", "edit_generate_video": "生成视频", "edit_save_failed": "保存失败,请重试!", - "edit_notice_keep_1": "至少保留一个内容块", "edit_notice_enter_text": "请先添加内容", "edit_notice_enter_article_title": "请输入文章标题", "edit_notice_enter_article_title1": "请输入标题内容", "edit_notice_enter_article_content": "请输入正文文本内容", - "edit_add_group": "新增分组", "edit_delete_group": "删除此分组", "edit_delete_group_confirm": "请确认删除此分组?", @@ -106,7 +103,7 @@ }, "delete": "删除", "cancel": "取消", - "confirm": "确定", + "confirm_text": "确定", "select": { "pushed": "已推送: {{count}} 条", "select_all": "全选", @@ -147,5 +144,6 @@ "title_operation": "操作", "title_thumb": "缩略图", "playing": "播放中" - } -} \ No newline at end of file + }, + "history.pushed": "已推送 {{count}} 条" +} diff --git a/src/pages/library/index.tsx b/src/pages/library/index.tsx index 8110de8..230ba80 100644 --- a/src/pages/library/index.tsx +++ b/src/pages/library/index.tsx @@ -108,7 +108,7 @@ export default function LibraryIndex() {
    {t('select.total',{count:data?.list?.length || 0})} - {t('select.pushed',{count:state.pushedCount})} + {t('history.pushed',{count:state.pushedCount})} {t('select.selected_some',{count:checkedIdArray.length})}
    ) } export const BaseLayout: React.FC = ({children}) => { - const {i18n,onChangeLocalization} = useConfig(); + const {i18n} = useTranslation(); const [params] = useSearchParams(); return (
    @@ -87,12 +87,12 @@ export const BaseLayout: React.FC = ({children}) => {
    - {params.get('lang') || AppConfig.APP_LANG == 'multiple' &&
    + {(params.get('lang') == 'yes' || AppConfig.APP_LANG == 'multiple') &&
    { - i18n == 'zh-CN'?( - + i18n.language == 'zh-CN'?( + ):( - + ) }
    } diff --git a/vite.config.ts b/vite.config.ts index 9ef559a..5510978 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -4,9 +4,17 @@ import {resolve} from "path"; import AppPackage from './package.json' import dayjs from "dayjs"; +const DevServerList:{ + [key:string]:string +} = { + 'test':'https://fm-admin.starbitech.com', + 'development':'http://192.168.0.231:9999', + 'lang-en':'https://mh.starbitech.com' +} +console.log('build-lang',process.env.APP_LANGUAGE) // https://vitejs.dev/config/ export default defineConfig(({mode}) => { - const devServerHost = mode == 'test' ? 'https://fm-admin.starbitech.com' : 'http://192.168.0.231:9999' + const devServerHost = DevServerList[mode] || 'http://192.168.0.231:9999' const AUTH_TOKEN_KEY = mode == 'production' ? 'digital-person-token' : `digital-person-token_${mode}` if (mode !== 'production') {