SourceStringApi
extends AbstractApi
in package
Source strings are the text units for translation. Instead of modifying source files, you can manage source strings one by one.
Use API to add, edit, or delete some specific strings in the source-based and files-based projects.
Table of Contents
Methods
- create() : SourceString|null
- Add String
- delete() : mixed
- Delete String
- get() : SourceString
- Get String
- list() : ModelCollection
- List Strings
- update() : SourceString|null
- Edit String
Methods
create()
Add String
public
create(int $projectId, array<string|int, mixed> $data) : SourceString|null
Parameters
- $projectId : int
- $data : array<string|int, mixed>
-
string $data[identifier] Required for strings-based projects or file-based projects if scheme of CSV file includes identifier column
string $data[text] required
integer $data[fileId]
string $data[context]
bool $data[isHidden]
integer $data[maxLength]
Tags
Return values
SourceString|nulldelete()
Delete String
public
delete(int $projectId, int $stringId) : mixed
Parameters
- $projectId : int
- $stringId : int
Tags
get()
Get String
public
get(int $projectId, int $stringId) : SourceString
Parameters
- $projectId : int
- $stringId : int
Tags
Return values
SourceStringlist()
List Strings
public
list(int $projectId[, array<string|int, mixed> $params = [] ]) : ModelCollection
Parameters
- $projectId : int
- $params : array<string|int, mixed> = []
Tags
Return values
ModelCollectionupdate()
Edit String
public
update(SourceString $sourceString) : SourceString|null
Parameters
- $sourceString : SourceString