mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-07-01 10:42:19 +08:00
chore(plugin-workflow): add all missed en-US locale keys (#6885)
This commit is contained in:
parent
106e84a1b4
commit
55b810b81f
@ -1,9 +1,16 @@
|
||||
{
|
||||
"Form event": "Form event",
|
||||
"Event triggers when submitted a workflow bound form action.": "Event triggers when submitted a workflow bound form action.",
|
||||
"Form data model": "Form data model",
|
||||
"Use a collection to match form data.": "Use a collection to match form data.",
|
||||
"Post-action event": "Post-action event",
|
||||
"Triggered after the completion of a request initiated through an action button or API, such as after adding or updating data. Suitable for data processing, sending notifications, etc., after actions are completed.": "Triggered after the completion of a request initiated through an action button or API, such as after adding or updating data. Suitable for data processing, sending notifications, etc., after actions are completed.",
|
||||
"Collection": "Collection",
|
||||
"The collection to which the triggered data belongs.": "The collection to which the triggered data belongs.",
|
||||
"Trigger mode": "Trigger mode",
|
||||
"Local mode, triggered after the completion of actions bound to this workflow": "Local mode, triggered after the completion of actions bound to this workflow",
|
||||
"Global mode, triggered after the completion of the following actions": "Global mode, triggered after the completion of the following actions",
|
||||
"Select actions": "Select actions",
|
||||
"Create record action": "Create record action",
|
||||
"Update record action": "Update record action",
|
||||
"Associations to use": "Associations to use",
|
||||
"User submitted form": "User submitted form",
|
||||
"Role of user submitted form": "Role of user submitted form"
|
||||
}
|
||||
"Trigger data": "Trigger data",
|
||||
"User acted": "User acted",
|
||||
"Role of user acted": "Role of user acted"
|
||||
}
|
@ -1,12 +1,13 @@
|
||||
{
|
||||
"Aggregate": "Aggregate",
|
||||
"Counting, summing, finding maximum, minimum, and average values for multiple records of a collection or associated data of a record.":
|
||||
"Counting, summing, finding maximum, minimum, and average values for multiple records of a collection or associated data of a record.",
|
||||
"Counting, summing, finding maximum, minimum, and average values for multiple records of a collection or associated data of a record.": "Counting, summing, finding maximum, minimum, and average values for multiple records of a collection or associated data of a record.",
|
||||
"Aggregator function": "Aggregator function",
|
||||
"Target type": "Target type",
|
||||
"Data of collection": "Data of collection",
|
||||
"Data of associated collection": "Data of associated collection",
|
||||
"Field to aggregate": "Field to aggregate",
|
||||
"Distinct": "Distinct",
|
||||
"Query result": "Query result"
|
||||
}
|
||||
"Query result": "Query result",
|
||||
"Result precision": "Result precision",
|
||||
"Number of decimal places for query result.": "Number of decimal places for query result."
|
||||
}
|
@ -2,8 +2,9 @@
|
||||
"Delay": "Delay",
|
||||
"Delay a period of time and then continue or exit the process. Can be used to set wait or timeout times in parallel branches.": "Delay a period of time and then continue or exit the process. Can be used to set wait or timeout times in parallel branches.",
|
||||
"Duration": "Duration",
|
||||
"Unit": "Unit",
|
||||
"End status": "End status",
|
||||
"Select status": "Select status",
|
||||
"Succeed and continue": "Succeed and continue",
|
||||
"Fail and exit": "Fail and exit"
|
||||
}
|
||||
}
|
@ -1,11 +1,12 @@
|
||||
{
|
||||
"Dynamic Calculation": "Dynamic Calculation",
|
||||
"Expression": "Expression",
|
||||
"Dynamic expression calculation": "Dynamic expression calculation",
|
||||
"Calculate an expression based on a calculation engine and obtain a value as the result. Variables in the upstream nodes can be used in the expression. The expression is dynamic one from an expression collections.": "Calculate an expression based on a calculation engine and obtain a value as the result. Variables in the upstream nodes can be used in the expression. The expression is dynamic one from an expression collections.",
|
||||
"Select dynamic expression": "Select dynamic expression",
|
||||
"Select the dynamic expression queried from the upstream node. You need to query it from an expression collection.": "Select the dynamic expression queried from the upstream node. You need to query it from an expression collection.",
|
||||
"Variable datasource": "Variable datasource",
|
||||
"Dynamic expression": "Dynamic expression",
|
||||
"An expression for calculation in each rows": "An expression for calculation in each rows",
|
||||
"Used to store expressions for use in workflows so that different expressions can be called for different data.": "Used to store expressions for use in workflows so that different expressions can be called for different data.",
|
||||
"Unconfigured": "Unconfigured",
|
||||
"Calculation result": "Calculation result"
|
||||
}
|
||||
}
|
@ -1,9 +1,22 @@
|
||||
{
|
||||
"Loop": "Loop",
|
||||
"Loop target": "Loop target",
|
||||
"Loop index": "Loop index",
|
||||
"Loop index (starts from 0)": "Loop index (starts from 0)",
|
||||
"Loop sequence (starts from 1)": "Loop sequence (starts from 1)",
|
||||
"Loop length": "Loop length",
|
||||
"By using a loop node, you can perform the same operation on multiple sets of data. The source of these sets can be either multiple records from a query node or multiple associated records of a single record. Loop node can also be used for iterating a certain number of times or for looping through each character in a string. However, excessive looping may cause performance issues, so use with caution.": "By using a loop node, you can perform the same operation on multiple sets of data. The source of these sets can be either multiple records from a query node or multiple associated records of a single record. Loop node can also be used for iterating a certain number of times or for looping through each character in a string. However, excessive looping may cause performance issues, so use with caution.",
|
||||
"Scope variables": "Scope variables",
|
||||
"A single number will be treated as a loop count, a single string will be treated as an array of characters, and other non-array values will be converted to arrays. The loop node ends when the loop count is reached, or when the array loop is completed. You can also add condition nodes to the loop to terminate it.": "A single number will be treated as a loop count, a single string will be treated as an array of characters, and other non-array values will be converted to arrays. The loop node ends when the loop count is reached, or when the array loop is completed. You can also add condition nodes to the loop to terminate it."
|
||||
}
|
||||
"A single number will be treated as a loop count, a single string will be treated as an array of characters, and other non-array values will be converted to arrays. The loop node ends when the loop count is reached, or when the array loop is completed. You can also add condition nodes to the loop to terminate it.": "A single number will be treated as a loop count, a single string will be treated as an array of characters, and other non-array values will be converted to arrays. The loop node ends when the loop count is reached, or when the array loop is completed. You can also add condition nodes to the loop to terminate it.",
|
||||
"Enable loop condition": "Enable loop condition",
|
||||
"Loop condition on each item": "Loop condition on each item",
|
||||
"When to check": "When to check",
|
||||
"Before each starts": "Before each starts",
|
||||
"After each ends": "After each ends",
|
||||
"When condition is not met on item": "When condition is not met on item",
|
||||
"Exit loop": "Exit loop",
|
||||
"Continue on next item": "Continue on next item",
|
||||
"Condition": "Condition",
|
||||
"When node inside loop failed": "When node inside loop failed",
|
||||
"Continue loop on next item": "Continue loop on next item",
|
||||
"Exit loop and continue workflow": "Exit loop and continue workflow",
|
||||
"Exit workflow": "Exit workflow"
|
||||
}
|
@ -26,5 +26,10 @@
|
||||
"Update record form": "Update record form",
|
||||
"Filter settings": "Filter settings",
|
||||
"Workflow todos": "Workflow todos",
|
||||
"Task": "Task"
|
||||
"Task node": "Task node",
|
||||
"Unprocessed": "Unprocessed",
|
||||
"Please check one of your update record form, and add at least one filter condition in form settings.": "Please check one of your update record form, and add at least one filter condition in form settings.",
|
||||
"My manual tasks": "My manual tasks",
|
||||
"Task title": "Task title",
|
||||
"Title of each task item. Default to node title.": "Title of each task item. Default to node title."
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{
|
||||
"Send email. You can use the variables in the upstream nodes as receivers, subject and content of the email.": "Send email by calling SMTP service. You can use the variables in the upstream nodes as receivers, subject and content of the email.",
|
||||
"Ignore failed sending and continue workflow": "Ignore failed sending and continue workflow"
|
||||
}
|
||||
"Notification": "Notification",
|
||||
"Send notification. You can use the variables in the upstream nodes as content and ohter config.": "Send notification. You can use the variables in the upstream nodes as content and ohter config."
|
||||
}
|
@ -2,10 +2,11 @@
|
||||
"Parallel branch": "Parallel branch",
|
||||
"Run multiple branch processes in parallel.": "Run multiple branch processes in parallel.",
|
||||
"Add branch": "Add branch",
|
||||
"Mode": "Mode",
|
||||
"All succeeded": "All succeeded",
|
||||
"Any succeeded": "Any succeeded",
|
||||
"Any succeeded or failed": "Any succeeded or failed",
|
||||
"Continue after all branches succeeded": "Continue after all branches succeeded",
|
||||
"Continue after any branch succeeded": "Continue after any branch succeeded",
|
||||
"Continue after any branch succeeded, or exit after any branch failed.": "Continue after any branch succeeded, or exit after any branch failed."
|
||||
}
|
||||
}
|
@ -9,12 +9,16 @@
|
||||
"Add parameter": "Add parameter",
|
||||
"Body": "Body",
|
||||
"Use variable": "Use variable",
|
||||
"Add key-value pairs": "Add key-value pairs",
|
||||
"Format": "Format",
|
||||
"Insert": "Insert",
|
||||
"Timeout config": "Timeout config",
|
||||
"ms": "ms",
|
||||
"Timeout": "Timeout",
|
||||
"Milliseconds": "Milliseconds",
|
||||
"Input request data": "Input request data",
|
||||
"Only support standard JSON data": "Only support standard JSON data",
|
||||
"\"Content-Type\" only support \"application/json\", and no need to specify": "\"Content-Type\" only support \"application/json\", and no need to specify",
|
||||
"Ignore failed request and continue workflow": "Ignore failed request and continue workflow"
|
||||
}
|
||||
"\"Content-Type\" will be ignored from headers.": "\"Content-Type\" will be ignored from headers.",
|
||||
"Ignore failed request and continue workflow": "Ignore failed request and continue workflow",
|
||||
"Status code": "Status code",
|
||||
"Data": "Data",
|
||||
"Response headers": "Response headers"
|
||||
}
|
@ -2,5 +2,7 @@
|
||||
"Response message": "Response message",
|
||||
"Add response message, will be send to client when process of request ends.": "Add response message, will be send to client when process of request ends.",
|
||||
"Message content": "Message content",
|
||||
"Supports variables in template.": "Supports variables in template."
|
||||
}
|
||||
"Supports variables in template.": "Supports variables in template.",
|
||||
"If the workflow ends normally, the response message will return a success status by default.": "If the workflow ends normally, the response message will return a success status by default.",
|
||||
"If you want to return a failure status, please add an \"End Process\" node downstream to terminate the workflow.": "If you want to return a failure status, please add an \"End Process\" node downstream to terminate the workflow."
|
||||
}
|
@ -1,5 +1,7 @@
|
||||
{
|
||||
"SQL action": "SQL action",
|
||||
"Execute a SQL statement in database": "Execute a SQL statement in database",
|
||||
"Usage of SQL query result is not supported yet.": "Usage of SQL query result is not supported yet."
|
||||
}
|
||||
"Execute a SQL statement in database.": "Execute a SQL statement in database.",
|
||||
"Select a data source to execute SQL.": "Select a data source to execute SQL.",
|
||||
"SQL query result could be used through <1>JSON query node</1> (Commercial plugin).": "SQL query result could be used through <1>JSON query node</1> (Commercial plugin).",
|
||||
"Include meta information of this query in result": "Include meta information of this query in result"
|
||||
}
|
@ -1,7 +1,11 @@
|
||||
{
|
||||
"Workflow": "Workflow",
|
||||
"Execution history": "Execution history",
|
||||
"Clear all executions": "Clear all executions",
|
||||
"Clear executions will not reset executed count, and started executions will not be deleted, are you sure you want to delete them all?": "Clear executions will not reset executed count, and started executions will not be deleted, are you sure you want to delete them all?",
|
||||
"Executed": "Executed",
|
||||
"Sync": "Sync",
|
||||
"Sync enabled status of all workflows from database": "Sync enabled status of all workflows from database",
|
||||
"Trigger type": "Trigger type",
|
||||
"Status": "Status",
|
||||
"On": "On",
|
||||
@ -9,14 +13,51 @@
|
||||
"Version": "Version",
|
||||
"Copy to new version": "Copy to new version",
|
||||
"Duplicate": "Duplicate",
|
||||
"Duplicate to new workflow": "Duplicate to new workflow",
|
||||
"This is a main version, delete it will cause the whole workflow to be deleted (including all other revisions).": "This is a main version, delete it will cause the whole workflow to be deleted (including all other revisions).",
|
||||
"Current version will be deleted (without affecting other versions).": "Current version will be deleted (without affecting other versions).",
|
||||
"Execute manually": "Execute manually",
|
||||
"The trigger is not configured correctly, please check the trigger configuration.": "The trigger is not configured correctly, please check the trigger configuration.",
|
||||
"This type of trigger has not been supported to be executed manually.": "This type of trigger has not been supported to be executed manually.",
|
||||
"Trigger variables need to be filled for executing.": "Trigger variables need to be filled for executing.",
|
||||
"A new version will be created automatically after execution if current version is not executed.": "A new version will be created automatically after execution if current version is not executed.",
|
||||
"This will perform all the actions configured in the workflow. Are you sure you want to continue?": "This will perform all the actions configured in the workflow. Are you sure you want to continue?",
|
||||
"Automatically create a new version after execution": "Automatically create a new version after execution",
|
||||
"Workflow executed, the result status is <1>{{statusText}}</1><2>View the execution</2>": "Workflow executed, the result status is <1>{{statusText}}</1><2>View the execution</2>",
|
||||
"Loading": "Loading",
|
||||
"Load failed": "Load failed",
|
||||
"Use transaction": "Use transaction",
|
||||
"Data operation nodes in workflow will run in a same transaction until any interruption. Any failure will cause data rollback, and will also rollback the history of the execution.": "Data operation nodes in workflow will run in a same transaction until any interruption. Any failure will cause data rollback, and will also rollback the history of the execution.",
|
||||
"Auto delete history when execution is on end status": "Auto delete history when execution is on end status",
|
||||
"Maximum number of cycling triggers": "Maximum number of cycling triggers",
|
||||
"The triggers of same workflow by some node (create, update and sub-flow etc.) more than this number will be ignored. Large number may cause performance issues. Please use with caution.": "The triggers of same workflow by some node (create, update and sub-flow etc.) more than this number will be ignored. Large number may cause performance issues. Please use with caution.",
|
||||
"Trigger": "Trigger",
|
||||
"Unknown trigger": "Unknown trigger",
|
||||
"Workflow with unknown type will cause error. Please delete it or check plugin which provide this type.": "Workflow with unknown type will cause error. Please delete it or check plugin which provide this type.",
|
||||
"Trigger variables": "Trigger variables",
|
||||
"Trigger data": "Trigger data",
|
||||
"Trigger time": "Trigger time",
|
||||
"Triggered at": "Triggered at",
|
||||
"Execute mode": "Execute mode",
|
||||
"Execute workflow asynchronously or synchronously based on trigger type, and could not be changed after created.": "Execute workflow asynchronously or synchronously based on trigger type, and could not be changed after created.",
|
||||
"Asynchronously": "Asynchronously",
|
||||
"Synchronously": "Synchronously",
|
||||
"Will be executed in the background as a queued task.": "Will be executed in the background as a queued task.",
|
||||
"For user actions that require immediate feedback. Can not use asynchronous nodes in such mode, and it is not recommended to perform time-consuming operations under synchronous mode.": "For user actions that require immediate feedback. Can not use asynchronous nodes in such mode, and it is not recommended to perform time-consuming operations under synchronous mode.",
|
||||
"Go back": "Go back",
|
||||
"Bind workflows": "Bind workflows",
|
||||
"Support pre-action event (local mode), post-action event (local mode), and approval event here.": "Support pre-action event (local mode), post-action event (local mode), and approval event here.",
|
||||
"Workflow will be triggered directly once the button clicked, without data saving. Only supports to be bound with \"Custom action event\".": "Workflow will be triggered directly once the button clicked, without data saving. Only supports to be bound with \"Custom action event\".",
|
||||
"\"Submit to workflow\" to \"Post-action event\" is deprecated, please use \"Custom action event\" instead.": "\"Submit to workflow\" to \"Post-action event\" is deprecated, please use \"Custom action event\" instead.",
|
||||
"Workflow will be triggered before deleting succeeded (only supports pre-action event in local mode).": "Workflow will be triggered before deleting succeeded (only supports pre-action event in local mode).",
|
||||
"Submit to workflow": "Submit to workflow",
|
||||
"Add workflow": "Add workflow",
|
||||
"Select workflow": "Select workflow",
|
||||
"Trigger data context": "Trigger data context",
|
||||
"Full form data": "Full form data",
|
||||
"Select context": "Select context",
|
||||
"Collection event": "Collection event",
|
||||
"Triggered when data changes in the collection, such as after adding, updating, or deleting a record. Unlike \"Post-action event\", Collection event listens for data changes rather than HTTP requests. Unless you understand the exact meaning, it is recommended to use \"Post-action event\".": "Triggered when data changes in the collection, such as after adding, updating, or deleting a record. Unlike \"Post-action event\", Collection event listens for data changes rather than HTTP requests. Unless you understand the exact meaning, it is recommended to use \"Post-action event\".",
|
||||
"Trigger on": "Trigger on",
|
||||
"After record added": "After record added",
|
||||
"After record updated": "After record updated",
|
||||
@ -25,7 +66,11 @@
|
||||
"Changed fields": "Changed fields",
|
||||
"Triggered only if one of the selected fields changes. If unselected, it means that it will be triggered when any field changes. When record is added or deleted, any field is considered to have been changed.": "Triggered only if one of the selected fields changes. If unselected, it means that it will be triggered when any field changes. When record is added or deleted, any field is considered to have been changed.",
|
||||
"Only triggers when match conditions": "Only triggers when match conditions",
|
||||
"Preload associations": "Preload associations",
|
||||
"Please select the associated fields that need to be accessed in subsequent nodes. With more than two levels of to-many associations may cause performance issue, please use with caution.": "Please select the associated fields that need to be accessed in subsequent nodes. With more than two levels of to-many associations may cause performance issue, please use with caution.",
|
||||
"Choose a record or primary key of a record in the collection to trigger.": "Choose a record or primary key of a record in the collection to trigger.",
|
||||
"Schedule event": "Schedule event",
|
||||
"Triggered according to preset time conditions. Suitable for one-time or periodic tasks, such as sending notifications and cleaning data on a schedule.": "Triggered according to preset time conditions. Suitable for one-time or periodic tasks, such as sending notifications and cleaning data on a schedule.",
|
||||
"Trigger mode": "Trigger mode",
|
||||
"Based on certain date": "Based on certain date",
|
||||
"Based on date field of collection": "Based on date field of collection",
|
||||
@ -52,49 +97,111 @@
|
||||
"By field": "By field",
|
||||
"By custom date": "By custom date",
|
||||
"Advanced": "Advanced",
|
||||
"Execute on": "Execute on",
|
||||
"Current time": "Current time",
|
||||
"End": "End",
|
||||
"Node result": "Node result",
|
||||
"Constant": "Constant",
|
||||
"Null": "Null",
|
||||
"Boolean": "Boolean",
|
||||
"String": "String",
|
||||
"Variable key of node": "Variable key of node",
|
||||
"Scope variables": "Scope variables",
|
||||
"Operator": "Operator",
|
||||
"Arithmetic calculation": "Arithmetic calculation",
|
||||
"Calculate an expression based on a calculation engine and obtain a value as the result. Variables in the upstream nodes can be used in the expression.": "Calculate an expression based on a calculation engine and obtain a value as the result. Variables in the upstream nodes can be used in the expression.",
|
||||
"String operation": "String operation",
|
||||
"System variables": "System variables",
|
||||
"System time": "System time",
|
||||
"Date variables": "Date variables",
|
||||
"Date range": "Date range",
|
||||
"Executed at": "Executed at",
|
||||
"Queueing": "Queueing",
|
||||
"On going": "On going",
|
||||
"Succeeded": "Succeeded",
|
||||
"Failed": "Failed",
|
||||
"Resolved": "Resolved",
|
||||
"Pending": "Pending",
|
||||
"Failed": "Failed",
|
||||
"Error": "Error",
|
||||
"Aborted": "Aborted",
|
||||
"Canceled": "Canceled",
|
||||
"Rejected": "Rejected",
|
||||
"Retry needed": "Retry needed",
|
||||
"Completed": "Completed",
|
||||
"All": "All",
|
||||
"View result": "View result",
|
||||
"Triggered but still waiting in queue to execute.": "Triggered but still waiting in queue to execute.",
|
||||
"Started and executing, maybe waiting for an async callback (manual, delay etc.).": "Started and executing, maybe waiting for an async callback (manual, delay etc.).",
|
||||
"Successfully finished.": "Successfully finished.",
|
||||
"Failed to satisfy node configurations.": "Failed to satisfy node configurations.",
|
||||
"Some node meets error.": "Some node meets error.",
|
||||
"Running of some node was aborted by program flow.": "Running of some node was aborted by program flow.",
|
||||
"Manually canceled whole execution when waiting.": "Manually canceled whole execution when waiting.",
|
||||
"Rejected from a manual node.": "Rejected from a manual node.",
|
||||
"General failed but should do another try.": "General failed but should do another try.",
|
||||
"Cancel the execution": "Cancel the execution",
|
||||
"Are you sure you want to cancel the execution?": "Are you sure you want to cancel the execution?",
|
||||
"Operations": "Operations",
|
||||
"This node contains branches, deleting will also be preformed to them, are you sure?": "This node contains branches, deleting will also be preformed to them, are you sure?",
|
||||
"Control": "Control",
|
||||
"Collection operations": "Collection operations",
|
||||
"Manual": "Manual",
|
||||
"Extended types": "Extended types",
|
||||
"Node type": "Node type",
|
||||
"Unknown node": "Unknown node",
|
||||
"Node with unknown type will cause error. Please delete it or check plugin which provide this type.": "Node with unknown type will cause error. Please delete it or check plugin which provide this type.",
|
||||
"Calculation": "Calculation",
|
||||
"Configure calculation": "Configure calculation",
|
||||
"Calculation engine": "Calculation engine",
|
||||
"Basic": "Basic",
|
||||
"Calculation expression": "Calculation expression",
|
||||
"Expression syntax error": "Expression syntax error",
|
||||
"Syntax references: ": "Syntax references: ",
|
||||
"Calculation result": "Calculation result",
|
||||
"True": "True",
|
||||
"False": "False",
|
||||
"concat": "concat",
|
||||
"Condition": "Condition",
|
||||
"Based on boolean result of the calculation to determine whether to \"continue\" or \"exit\" the process, or continue on different branches of \"yes\" and \"no\".": "Based on boolean result of the calculation to determine whether to \"continue\" or \"exit\" the process, or continue on different branches of \"yes\" and \"no\".",
|
||||
"Mode": "Mode",
|
||||
"Continue when \"Yes\"": "Continue when \"Yes\"",
|
||||
"Branch into \"Yes\" and \"No\"": "Branch into \"Yes\" and \"No\"",
|
||||
"Conditions": "Conditions",
|
||||
"Condition expression": "Condition expression",
|
||||
"Inside of \"Yes\" branch": "Inside of \"Yes\" branch",
|
||||
"Inside of \"No\" branch": "Inside of \"No\" branch",
|
||||
"Create record": "Create record",
|
||||
"Add new record to a collection. You can use variables from upstream nodes to assign values to fields.": "Add new record to a collection. You can use variables from upstream nodes to assign values to fields.",
|
||||
"Update record": "Update record",
|
||||
"Update records of a collection. You can use variables from upstream nodes as query conditions and field values.": "Update records of a collection. You can use variables from upstream nodes as query conditions and field values.",
|
||||
"Update mode": "Update mode",
|
||||
"Update in a batch": "Update in a batch",
|
||||
"Update one by one": "Update one by one",
|
||||
"Update all eligible data at one time, which has better performance when the amount of data is large. But association fields are not supported (unless foreign key in current collection), and the updated data will not trigger other workflows.": "Update all eligible data at one time, which has better performance when the amount of data is large. But association fields are not supported (unless foreign key in current collection), and the updated data will not trigger other workflows.",
|
||||
"The updated data can trigger other workflows, and the audit log will also be recorded. But it is usually only applicable to several or dozens of pieces of data, otherwise there will be performance problems.": "The updated data can trigger other workflows, and the audit log will also be recorded. But it is usually only applicable to several or dozens of pieces of data, otherwise there will be performance problems.",
|
||||
"Query record": "Query record",
|
||||
"Query records from a collection. You can use variables from upstream nodes as query conditions.": "Query records from a collection. You can use variables from upstream nodes as query conditions.",
|
||||
"Allow multiple records as result": "Allow multiple records as result",
|
||||
"If checked, when there are multiple records in the query result, an array will be returned as the result, which can be operated on one by one using a loop node. Otherwise, only one record will be returned.": "If checked, when there are multiple records in the query result, an array will be returned as the result, which can be operated on one by one using a loop node. Otherwise, only one record will be returned.",
|
||||
"Result type": "Result type",
|
||||
"Single record": "Single record",
|
||||
"Multiple records": "Multiple records",
|
||||
"The result will be an object of the first matching record only, or null if no matched record.": "The result will be an object of the first matching record only, or null if no matched record.",
|
||||
"The result will be an array containing matched records, or an empty one if no matching records. This can be used to be processed in a loop node.": "The result will be an array containing matched records, or an empty one if no matching records. This can be used to be processed in a loop node.",
|
||||
"Exit when query result is null": "Exit when query result is null",
|
||||
"Please select collection first": "Please select collection first",
|
||||
"Only update records matching conditions": "Only update records matching conditions",
|
||||
"Fields that are not assigned a value will be set to the default value, and those that do not have a default value are set to null.": "Fields that are not assigned a value will be set to the default value, and those that do not have a default value are set to null.",
|
||||
"Trigger in executed workflow cannot be modified": "Trigger in executed workflow cannot be modified",
|
||||
"Node in executed workflow cannot be modified": "Node in executed workflow cannot be modified",
|
||||
"Please add at least one condition": "Please add at least one condition",
|
||||
"Unassigned fields will be set to default values, and those without default values will be set to null.": "Unassigned fields will be set to default values, and those without default values will be set to null.",
|
||||
"Delete record": "Delete record",
|
||||
"Delete records of a collection. Could use variables in workflow context as filter. All records match the filter will be deleted.": "Delete records of a collection. Could use variables in workflow context as filter. All records match the filter will be deleted.",
|
||||
"Executed workflow cannot be modified. Could be copied to a new version to modify.": "Executed workflow cannot be modified. Could be copied to a new version to modify.",
|
||||
"Can not delete": "Can not delete",
|
||||
"The result of this node has been referenced by other nodes ({{nodes}}), please remove the usage before deleting.": "The result of this node has been referenced by other nodes ({{nodes}}), please remove the usage before deleting.",
|
||||
"Maximum number of loop calls": "Maximum number of loop calls",
|
||||
"If the number of loop calls is too large, there will be performance issues.": "If the number of loop calls is too large, there will be performance issues."
|
||||
}
|
||||
"End process": "End process",
|
||||
"End the process immediately, with set status.": "End the process immediately, with set status.",
|
||||
"End status": "End status",
|
||||
"Succeeded": "Succeeded",
|
||||
"Test run": "Test run",
|
||||
"Test run will do the actual data manipulating or API calling, please use with caution.": "Test run will do the actual data manipulating or API calling, please use with caution.",
|
||||
"No variable": "No variable",
|
||||
"Add node": "Add node",
|
||||
"Move all downstream nodes to": "Move all downstream nodes to",
|
||||
"After end of branches": "After end of branches",
|
||||
"Inside of branch": "Inside of branch",
|
||||
"Workflow todos": "Workflow todos",
|
||||
"New version enabled": "New version enabled",
|
||||
"a": "a"
|
||||
}
|
140
scripts/addEnKeysFromZh.js
Normal file
140
scripts/addEnKeysFromZh.js
Normal file
@ -0,0 +1,140 @@
|
||||
const fs = require('fs/promises');
|
||||
const Path = require('path');
|
||||
const { exec } = require('child_process');
|
||||
const glob = require('glob');
|
||||
const { Command, Option } = require('commander');
|
||||
const { parse } = require('@nocobase/utils');
|
||||
|
||||
async function addEnKeysFromZh(filePath) {
|
||||
const enFilePath = filePath.replace(/zh-CN.json$/, 'en-US.json');
|
||||
|
||||
const content = await fs.readFile(filePath, 'utf8');
|
||||
const json = JSON.parse(content);
|
||||
const keys = Object.keys(json);
|
||||
let enFileExists;
|
||||
try {
|
||||
enFileExists = await fs.stat(enFilePath);
|
||||
} catch (error) {}
|
||||
|
||||
if (enFileExists) {
|
||||
const enContent = await fs.readFile(enFilePath, 'utf8');
|
||||
const enJsonKeys = Object.keys(JSON.parse(enContent));
|
||||
const keysSet = new Set(enJsonKeys);
|
||||
if (enJsonKeys.length !== keysSet.size) {
|
||||
return null;
|
||||
}
|
||||
if (keys.every((key) => keysSet.has(key))) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
const enJson = keys.reduce((result, key) => {
|
||||
result[key] = key;
|
||||
return result;
|
||||
}, {});
|
||||
|
||||
// 将修改后的内容写回文件
|
||||
await fs.writeFile(enFilePath, JSON.stringify(enJson, null, 2), 'utf8');
|
||||
|
||||
return enFilePath;
|
||||
}
|
||||
|
||||
function isMergeCommit() {
|
||||
return new Promise((resolve, reject) => {
|
||||
exec('git rev-parse --verify MERGE_HEAD', (error, stdout, stderr) => {
|
||||
if (error || stderr) {
|
||||
resolve(false);
|
||||
} else {
|
||||
resolve(true);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function getDiffFiles() {
|
||||
return new Promise((resolve, reject) => {
|
||||
exec('git diff --cached --name-only --diff-filter=ACM', (error, stdout, stderr) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
}
|
||||
if (stderr) {
|
||||
reject(stderr);
|
||||
}
|
||||
resolve(stdout.split('\n').filter(Boolean));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function gitAddFiles(files) {
|
||||
return new Promise((resolve, reject) => {
|
||||
exec(`git add ${files.join(' ')}`, (error, stdout, stderr) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
}
|
||||
if (stderr) {
|
||||
reject(stderr);
|
||||
}
|
||||
resolve(stdout);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
async function main({ mode, baseLang }) {
|
||||
const isMerge = await isMergeCommit();
|
||||
if (isMerge) return;
|
||||
const files = [];
|
||||
|
||||
if (mode === 'diff') {
|
||||
const diffFiles = await getDiffFiles();
|
||||
files.push(
|
||||
...diffFiles.filter(
|
||||
(file) => file.includes(`${Path.sep}src${Path.sep}`) && file.endsWith(`${Path.sep}${baseLang}.json`),
|
||||
),
|
||||
);
|
||||
} else if (mode === 'all') {
|
||||
const pattern = `./packages/**/src/**/locale/${baseLang}.json`;
|
||||
const ignore = (await fs.readFile('.gitignore', 'utf8')).split('\n').filter(Boolean);
|
||||
const paths = glob.sync(pattern, {
|
||||
root: process.cwd(),
|
||||
ignore,
|
||||
});
|
||||
files.push(...paths);
|
||||
}
|
||||
|
||||
const validFiles = [];
|
||||
|
||||
for (const file of files) {
|
||||
const res = await addEnKeysFromZh(file);
|
||||
if (res) {
|
||||
validFiles.push(file);
|
||||
}
|
||||
}
|
||||
|
||||
if (validFiles.length === 0) {
|
||||
console.log('No locale files need to be added, exit.');
|
||||
return;
|
||||
}
|
||||
|
||||
// 执行 git add 这些文件
|
||||
await gitAddFiles(validFiles);
|
||||
}
|
||||
|
||||
const cli = new Command();
|
||||
|
||||
cli
|
||||
// .arguments('[patterns...]')
|
||||
.addOption(new Option('-m, --mode <mode>', 'source mode').choices(['diff', 'all']).default('diff'))
|
||||
.option('-b, --base-lang <baseLang>', 'base language, default is zh-CN', 'zh-CN')
|
||||
// .option('-t, --target-lang <targetLang>', 'target language, default is en-US', 'en-US')
|
||||
// .option('-p, --search-pattern <pattern>', 'search pattern, default is "src/**/locale/{{baseLang}}.json"', 'src/**/locale/{{baseLang}}.json')
|
||||
.action(main);
|
||||
|
||||
cli
|
||||
.parseAsync(process.argv)
|
||||
.then(() => {
|
||||
process.exit(0);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user