diff --git a/core/core-backend/src/main/resources/application-standalone.yml b/core/core-backend/src/main/resources/application-standalone.yml index b521aa59d0..dc736ca3a7 100644 --- a/core/core-backend/src/main/resources/application-standalone.yml +++ b/core/core-backend/src/main/resources/application-standalone.yml @@ -4,7 +4,7 @@ spring: username: root password: 123456 messages: - basename: i18n/lic,i18n/core,i18n/permissions,i18n/xpack + basename: i18n/lic,i18n/core,i18n/permissions,i18n/xpack,i18n/sync flyway: enabled: true table: de_standalone_version diff --git a/core/core-frontend/src/locales/en.ts b/core/core-frontend/src/locales/en.ts index 0be6e61556..f1270edfff 100644 --- a/core/core-frontend/src/locales/en.ts +++ b/core/core-frontend/src/locales/en.ts @@ -1090,5 +1090,169 @@ export default { switch_chart: 'Switch chart type', switch_table: 'Switch to detail table', download: 'Download' + }, + sync_manage: { + title: 'Sync Management', + ds_search_placeholder: 'Search by name or description' + }, + sync_datasource: { + title: 'Data Connection Management', + source_ds: 'Source', + target_ds: 'Target', + add_source_ds: 'Add', + add_target_ds: 'Add', + name: 'Name', + desc: 'Description', + type: 'Type', + status: 'Status', + create_time: 'Creation Time', + update_time: 'Update Time', + operation: 'Operation', + edit: 'Edit', + delete: 'Delete', + confirm_batch_delete_target_ds: 'Are you sure you want to delete {0} target data sources?', + confirm_batch_delete_source_ds: 'Are you sure you want to delete {0} source data sources?', + recently_created: 'Recently Created', + has_running_task_msg: + 'Once the running task is completed, synchronization will continue using the previous configuration. You need to manually resave the task', + edit_datasource: 'Edit', + add_datasource: 'Create New', + config_info: 'Configuration Information', + ds_type: 'Datasource Type', + valid: 'Valid', + invalid: 'Invalid', + start_time: 'Start Time', + end_time: 'End Time', + ds_delete_confirm: 'Are you sure you want to delete this data source?', + datasource: 'Data Source', + select_folder: 'Please select a folder', + sync_ds: 'Synchronize', + sync_to_datasource: 'Sync to the prepared data source list', + input_ds_name: 'Please enter the data source name', + folder: 'Parent Folder', + cancel: 'Cancel', + save: 'Save', + next: 'Next', + prev: 'Previous', + validate: 'Validate', + validate_success: 'Validation Successful', + select_type: 'Please select the data source type', + extra_params: 'Additional JDBC connection string', + remark: 'Remark', + input_name: 'Please enter name', + input_limit_2_25: '{0}-{1} characters', + input_limit_2_50: '2-50 characters', + input_limit_2_64: '2-64 characters', + input_limit_1_64: '1-64 characters', + data_source_configuration: 'Data source configuration', + data_source_table: 'Data source table', + auth_method: 'Authentication method', + passwd: 'Username and password', + kerbers_info: + 'Please ensure krb5.conf and Keytab Key are added to the path: /opt/dataease2.0/conf', + client_principal: 'Client Principal', + keytab_Key_path: 'Keytab Key Path', + data_base: 'Database name', + user_name: 'Username', + password: 'Password', + host: 'Host name/IP address', + doris_host: 'Doris address', + query_port: 'Query Port', + http_port: 'HTTP Port', + port: 'Port', + datasource_url: 'Address', + please_input_datasource_url: 'Please enter Elasticsearch address, e.g., http://es_host:es_port', + please_input_data_base: 'Please enter database name', + please_input_jdbc_url: 'Please enter JDBC connection', + please_select_oracle_type: 'Select connection type', + please_input_user_name: 'Please enter username', + please_input_password: 'Please enter password', + please_input_host: 'Please enter host', + please_input_url: 'Please enter URL address', + please_input_port: 'Please enter port', + please_input_be_port: 'Please enter BE port', + modify: 'Edit data source', + validate_failed: 'Validation failed', + oracle_connection_type: 'Service name/SID', + oracle_sid: 'SID', + oracle_service_name: 'Service name', + get_schema: 'Get Schema', + schema: 'Schema', + charset: 'Character set', + targetCharset: 'Target character set', + please_choose_schema: 'Please select database Schema', + please_choose_charset: 'Please select database character set', + please_choose_targetCharset: 'Please select target character set', + edit_datasource_msg: + 'Modifying data source information may cause datasets under this data source to become unavailable. Confirm modification?', + repeat_datasource_msg: 'Duplicate data source information with the same configuration exists.', + in_valid: 'Invalid data source', + initial_pool_size: 'Initial connection count', + min_pool_size: 'Minimum connection count', + max_pool_size: 'Maximum connection count', + max_idle_time: 'Maximum idle time (seconds)', + bucket_num: 'Bucket count', + replication_num: 'Replication count', + please_input_bucket_num: 'Please enter bucket count', + please_input_replication_num: 'Please enter replication count', + acquire_increment: 'Increment', + connect_timeout: 'Connection timeout (seconds)', + please_input_initial_pool_size: 'Please enter initial connection count', + please_input_min_pool_size: 'Please enter minimum connection count', + please_input_max_pool_size: 'Please enter maximum connection count', + please_input_max_idle_time: 'Please enter maximum idle time (seconds)', + please_input_acquire_increment: 'Please enter increment', + please_input_query_timeout: 'Please enter query timeout', + please_input_connect_timeout: 'Please enter connection timeout (seconds)', + no_less_then_0: 'Parameters in advanced settings cannot be less than zero', + port_no_less_then_0: 'Port cannot be less than zero', + priority: 'Advanced settings', + jdbcUrl: 'JDBC connection', + _ip_address: 'Please enter host name/IP address', + display_name: 'Display name', + connection_mode: 'Connection mode', + please_select: 'Please select', + query_timeout: 'Query timeout', + description: 'Description', + tips: 'Tips' + }, + sync_task: { + title: 'Task Management', + list: 'Task List', + log_list: 'Task Logs', + add_task: 'Add Task', + name: 'Name', + desc: 'Description', + status: 'Status', + create_time: 'Creation Time', + update_time: 'Update Time', + operation: 'Operation', + edit: 'Edit', + delete: 'Delete', + start: 'Enable', + stop: 'Stop', + terminated: 'Terminate Sync', + running_one: 'Run Once', + trigger_last_time: 'Last Execution Time', + trigger_next_time: 'Next Execution Time', + status_success: 'Success', + status_running: 'In Progress', + status_failed: 'Failed', + status_stopped: 'Task Stopped', + status_waiting: 'Waiting for Sync', + status_done: 'Task Completed', + status_terminated: 'Terminated', + status_connection_lost: 'Connection Lost', + log: 'Log', + show_log: 'View Log', + last_execute_result: 'Last Execution Result', + execute_result: 'Execution Result', + task_status: 'Task Status', + sync: 'Sync', + target_table: 'Target Table', + batch_del: 'Batch Delete', + selection_info: 'Selected {0} items', + clear_button: 'Clear', + task_text: 'Task' } } diff --git a/core/core-frontend/src/locales/tw.ts b/core/core-frontend/src/locales/tw.ts index 5d65fde922..1491ba13be 100644 --- a/core/core-frontend/src/locales/tw.ts +++ b/core/core-frontend/src/locales/tw.ts @@ -2978,7 +2978,7 @@ export default { }, sync_manage: { title: '同步管理', - ds_search_placeholder: '搜索名稱,描述' + ds_search_placeholder: '搜尋名稱或描述' }, sync_datasource: { title: '數據連接管理', @@ -2991,23 +2991,124 @@ export default { type: '類型', status: '狀態', create_time: '創建時間', - update_time: '更新時間', + update_time: '更新时间', operation: '操作', edit: '編輯', delete: '刪除', confirm_batch_delete_target_ds: '確定刪除{0}個目標數據源嗎?', - confirm_batch_delete_source_ds: '確定刪除{0}個源數據源嗎?' + confirm_batch_delete_source_ds: '確定刪除{0}個源數據源嗎?', + recently_created: '最近創建', + has_running_task_msg: + '執行中的任務完成後,將繼續使用修改之前的配置進行同步,需手動對任務進行重新保存。', + edit_datasource: '編輯數據源', + add_datasource: '新建數據源', + config_info: '配置信息', + ds_type: '數據源類型', + valid: '有效', + invalid: '無效', + start_time: '開始時間', + end_time: '結束時間', + ds_delete_confirm: '確定刪除該數據源嗎?', + datasource: '數據源', + select_folder: '請選擇文件夾', + sync_ds: '同步數據源', + sync_to_datasource: '將同步至數據準備的數據源列表', + input_ds_name: '請輸入數據源名稱', + folder: '所屬文件夾', + cancel: '取消', + save: '儲存', + next: '下一步', + prev: '上一步', + validate: '驗證', + validate_success: '驗證成功', + select_type: '请选择數據源類型', + extra_params: '額外的 JDBC 連線字串', + remark: '備註', + input_name: '請輸入名稱', + input_limit_2_25: '{0}-{1}字符', + input_limit_2_50: '2-50字符', + input_limit_2_64: '2-64字符', + input_limit_1_64: '1-64字符', + data_source_configuration: '數據源配置', + data_source_table: '數據源表', + auth_method: '認證方式', + passwd: '用戶名和密碼', + kerbers_info: '請確保 krb5.conf 和 Keytab Key 已經添加到路徑:/opt/dataease2.0/conf', + client_principal: '客戶端主體', + keytab_Key_path: 'Keytab Key 路徑', + data_base: '數據庫名稱', + user_name: '用戶名', + password: '密碼', + host: '主機名/IP地址', + doris_host: 'Doris 地址', + query_port: '查詢端口', + http_port: 'HTTP 端口', + port: '端口', + datasource_url: '地址', + please_input_datasource_url: '請輸入 Elasticsearch 地址,如: http://es_host:es_port', + please_input_data_base: '請輸入數據庫名稱', + please_input_jdbc_url: '請輸入 JDBC 連接', + please_select_oracle_type: '選擇連接類型', + please_input_user_name: '請輸入用戶名', + please_input_password: '請輸入密碼', + please_input_host: '請輸入主機', + please_input_url: '請輸入URL地址', + please_input_port: '請輸入端口', + please_input_be_port: '請輸入 BE 端口', + modify: '編輯數據源', + validate_failed: '驗證失敗', + oracle_connection_type: '服務名/SID', + oracle_sid: 'SID', + oracle_service_name: '服務名', + get_schema: '獲取 Schema', + schema: 'Schema', + charset: '字符集', + targetCharset: '目標字符集', + please_choose_schema: '請選擇數據庫 Schema', + please_choose_charset: '請選擇數據庫字符集', + please_choose_targetCharset: '請選擇目標字符集', + edit_datasource_msg: '修改數據源信息,可能會導致該數據源下的數據集不可用,確認修改?', + repeat_datasource_msg: '已經存在相同配置的數據源信息。', + in_valid: '無效數據源', + initial_pool_size: '初始連接數', + min_pool_size: '最小連接數', + max_pool_size: '最大連接數', + max_idle_time: '最大空閒(秒)', + bucket_num: 'Bucket 數量', + replication_num: '副本數量', + please_input_bucket_num: '請輸入 Bucket 數量', + please_input_replication_num: '請輸入副本數量', + acquire_increment: '增長數', + connect_timeout: '連接超時(秒)', + please_input_initial_pool_size: '請輸入初始連接數', + please_input_min_pool_size: '請輸入最小連接數', + please_input_max_pool_size: '請輸入最大連接數', + please_input_max_idle_time: '請輸入最大空閒(秒)', + please_input_acquire_increment: '請輸入增長數', + please_input_query_timeout: '請輸入查詢超時', + please_input_connect_timeout: '請輸入連接超時(秒)', + no_less_then_0: '高級設置中的參數不能小於零', + port_no_less_then_0: '端口不能小於零', + priority: '高級設置', + jdbcUrl: 'JDBC 連接', + _ip_address: '請輸入主機名/IP地址', + display_name: '顯示名稱', + connection_mode: '連接方式', + please_select: '請選擇', + query_timeout: '查询超时', + description: '描述', + tips: '提示' }, sync_task: { title: '任務管理', list: '任務列表', - log_list: '任務日志', + log_list: '任務日誌', add_task: '添加任務', name: '名稱', desc: '描述', status: '狀態', create_time: '創建時間', - update_time: '更新時間', + update_time: '更新时间', operation: '操作', edit: '編輯', delete: '刪除', @@ -3025,8 +3126,8 @@ export default { status_done: '任務結束', status_terminated: '終止', status_connection_lost: '連接丟失', - log: '日志', - show_log: '查看日志', + log: '日誌', + show_log: '查看日誌', last_execute_result: '上次執行結果', execute_result: '執行結果', task_status: '任務狀態', diff --git a/core/core-frontend/src/locales/zh-CN.ts b/core/core-frontend/src/locales/zh-CN.ts index 45b17740f1..71100f0d4f 100644 --- a/core/core-frontend/src/locales/zh-CN.ts +++ b/core/core-frontend/src/locales/zh-CN.ts @@ -2996,7 +2996,108 @@ export default { edit: '编辑', delete: '删除', confirm_batch_delete_target_ds: '确定删除{0}个目标数据源吗?', - confirm_batch_delete_source_ds: '确定删除{0}个源数据源吗?' + confirm_batch_delete_source_ds: '确定删除{0}个源数据源吗?', + recently_created: '最近创建', + has_running_task_msg: + '执行中的任务完成后,将继续使用修改之前的配置进行同步,需手动对任务进行重新保存。', + edit_datasource: '编辑数据源', + add_datasource: '新建数据源', + config_info: '配置信息', + ds_type: '数据源类型', + valid: '有效', + invalid: '无效', + start_time: '开始时间', + end_time: '结束时间', + ds_delete_confirm: '确定删除该数据源吗?', + datasource: '数据源', + select_folder: '请选择文件夹', + sync_ds: '同步数据源', + sync_to_datasource: '将同步至数据准备的数据源列表', + input_ds_name: '请输入数据源名称', + folder: '所属文件夹', + cancel: '取消', + save: '保存', + next: '下一步', + prev: '上一步', + validate: '校验', + validate_success: '校验成功', + select_type: '请选择数据源类型', + extra_params: '额外的 JDBC 连接字符串', + remark: '备注', + input_name: '请输入名称', + input_limit_2_25: '{0}-{1}字符', + input_limit_2_50: '2-50字符', + input_limit_2_64: '2-64字符', + input_limit_1_64: '1-64字符', + data_source_configuration: '数据源配置', + data_source_table: '数据源表', + auth_method: '认证方式', + passwd: '用户名密码', + kerbers_info: '请确保 krb5.Conf、Keytab Key,已经添加到路径:/opt/dataease2.0/conf', + client_principal: 'Client Principal', + keytab_Key_path: 'Keytab Key Path', + data_base: '数据库名称', + user_name: '用户名', + password: '密码', + host: '主机名/IP地址', + doris_host: 'Doris 地址', + query_port: 'Query Port', + http_port: 'Http Port', + port: '端口', + datasource_url: '地址', + please_input_datasource_url: '请输入 Elasticsearch 地址,如: http://es_host:es_port', + please_input_data_base: '请输入数据库名称', + please_input_jdbc_url: '请输入 JDBC 连接', + please_select_oracle_type: '选择连接类型', + please_input_user_name: '请输入用户名', + please_input_password: '请输入密码', + please_input_host: '请输入主机', + please_input_url: '请输入URL地址', + please_input_port: '请输入端口', + please_input_be_port: '请输入BE端口', + modify: '编辑数据源', + validate_failed: '校验失败', + oracle_connection_type: '服务名/SID', + oracle_sid: 'SID', + oracle_service_name: '服务名', + get_schema: '获取 Schema', + schema: 'Schema', + charset: '字符集', + targetCharset: '目标字符集', + please_choose_schema: '请选择数据库 Schema', + please_choose_charset: '请选择数据库字符集', + please_choose_targetCharset: '请选择目标字符集', + edit_datasource_msg: '修改数据源信息,可能会导致该数据源下的数据集不可用,确认修改?', + repeat_datasource_msg: '已经存在相同配置的数据源信息, ', + in_valid: '无效数据源', + initial_pool_size: '初始连接数', + min_pool_size: '最小连接数', + max_pool_size: '最大连接数', + max_idle_time: '最大空闲(秒)', + bucket_num: 'Bucket 数量', + replication_num: '副本数量', + please_input_bucket_num: '请输入 Bucket 数量', + please_input_replication_num: '请输入副本数量', + acquire_increment: '增长数', + connect_timeout: '连接超时(秒)', + please_input_initial_pool_size: '请输入初始连接数', + please_input_min_pool_size: '请输入最小连接数', + please_input_max_pool_size: '请输入最大连接数', + please_input_max_idle_time: '请输入最大空闲(秒)', + please_input_acquire_increment: '请输入增长数', + please_input_query_timeout: '请输入查询超时', + please_input_connect_timeout: '请输入连接超时(秒)', + no_less_then_0: '高级设置中的参数不能小于零', + port_no_less_then_0: '端口不能小于零', + priority: '高级设置', + jdbcUrl: 'JDBC 连接', + _ip_address: '请输入主机名/IP地址', + display_name: '显示名称', + connection_mode: '连接方式', + please_select: '请选择', + query_timeout: '查询超时', + description: '描述', + tips: '提示' }, sync_task: { title: '任务管理', diff --git a/de-xpack b/de-xpack index b2b01bc805..8e402c6c3d 160000 --- a/de-xpack +++ b/de-xpack @@ -1 +1 @@ -Subproject commit b2b01bc8057344a79f862fd5bf402743e579bb91 +Subproject commit 8e402c6c3df6923ecd4ac88a4ea2d613f75f6b4e diff --git a/sdk/common/src/main/java/io/dataease/i18n/Translator.java b/sdk/common/src/main/java/io/dataease/i18n/Translator.java index dcd0ff4aae..e6a05acdc4 100644 --- a/sdk/common/src/main/java/io/dataease/i18n/Translator.java +++ b/sdk/common/src/main/java/io/dataease/i18n/Translator.java @@ -13,10 +13,7 @@ import org.springframework.stereotype.Component; import java.lang.reflect.Array; import java.lang.reflect.Field; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashSet; -import java.util.Map; +import java.util.*; @Component public class Translator { @@ -39,6 +36,17 @@ public class Translator { return messageSource.getMessage(key, null, key, LocaleContextHolder.getLocale()); } + /** + * 获取国际化消息并替换占位符 + * + * @param key 国际化键 如:确定删除名为{0}的{1}吗? + * @param placeholders 占位值 + * @return 替换后的消息 + */ + public static String get(String key, Object... placeholders) { + return messageSource.getMessage(key, placeholders, key, LocaleContextHolder.getLocale()); + } + private static Object translateRawString(String key, String rawString) { if (StringUtils.isBlank(rawString)) { return rawString;