Custom scripts in Translator++ are divided into 4 different workspaces:Global workspace
There is no built in iterator in the global workspace.
1. Global workspace
There is no built in iterator on Global level workspace
2. Object based iterator
In this workspace the script will be executed for each selected object (or all if none selected)
3. Row based iterator
In this workspace the script will be executed for each row within selected object (or all if none selected).
4. Cell based iterator
In this workspace the script will be executed for each cell (row and column) within selected object (or all if none selected).
Global properties and function
Use global scoped variable (such as: window) to make the variables available across iteration.
For example, take a look at the following example:
In addition to the Translator++ standard library, you can also use the following functions that were created specifically for the iteration framework.
Immediately halt the iteration process
Object level iterator
object level, you can access the properties of the current object via
String: the ID of the current object
Integer: the current index of iteration
Integer: Maximum index of current execution
Boolean: True if the current iteration is the last from the process.
Row level iterator
If no objects are selected then all object will be processed.
All information of the current data are stored in the
Row level iterator can use all the
this properties from the Object level iterator. In addition, the cell based iterator has the following properties:
String: Id of the current object
Integer: The index of the row
String: The key text
Array: the cells in the current row
Array: the tags of the current row
Object: the parameters of the current row
Array: the context of the current row
Array: the comments of the current row. Index of the comments represents its cell id.
Remove the new line from all messages. Keep the newline if the first or the last line are not Japanese.
Replaces the first line of translated text with the first line of original text
Cell level iterator
Cell level iterator can use all the
this properties from the Object level iterator and Row level iterator. In addition, the cell level iterator has the following properties:
Integer: The index of the cell
String: The text of the cell
This is a read only property
Obj: Coordinate of the cell
Set text into the current cell
Translate found cells with Sugoi Trans (excludes the first or the last row in the message)