class File extends Package

Class File

Methods

__construct(string $projectId, string $apiKey, Client $httpClient)

Constructor.

from Package
string
getProjectId()

Get the project ID.

from Package
string
getApiKey()

Get the API key.

from Package
Client
getHttpClient()

Get the HTTP client object.

from Package
string
getBasePath(string $action)

Get the base path for the command including an action.

from Package
ResponseInterface
add(Languagefile $languagefile, string $type = '', string $branch = '')

Add new file to Crowdin project.

ResponseInterface
update(Languagefile $languagefile, string $branch = '')

Upload latest version of your localization file to Crowdin.

ResponseInterface
delete(Languagefile $file)

Delete file from Crowdin project. All the translations will be lost without ability to restore them.

ResponseInterface
export(string $file, string $language, string $toPath)

This method exports single translated files from Crowdin.

Details

in Package at line 45
__construct(string $projectId, string $apiKey, Client $httpClient)

Constructor.

Parameters

string $projectId The project ID.
string $apiKey The API key
Client $httpClient The HTTP client object.

in Package at line 57
protected string getProjectId()

Get the project ID.

Return Value

string

in Package at line 67
protected string getApiKey()

Get the API key.

Return Value

string

in Package at line 77
protected Client getHttpClient()

Get the HTTP client object.

Return Value

Client

in Package at line 89
protected string getBasePath(string $action)

Get the base path for the command including an action.

Parameters

string $action The action to perform.

Return Value

string

at line 37
ResponseInterface add(Languagefile $languagefile, string $type = '', string $branch = '')

Add new file to Crowdin project.

Parameters

Languagefile $languagefile The translation file object
string $type The type.
string $branch The branch.

Return Value

ResponseInterface

See also

https://crowdin.com/page/api/add-file

at line 74
ResponseInterface update(Languagefile $languagefile, string $branch = '')

Upload latest version of your localization file to Crowdin.

Parameters

Languagefile $languagefile The translation file object
string $branch The branch.

Return Value

ResponseInterface

See also

https://crowdin.com/page/api/update-file

at line 102
ResponseInterface delete(Languagefile $file)

Delete file from Crowdin project. All the translations will be lost without ability to restore them.

Parameters

Languagefile $file The file to delete.

Return Value

ResponseInterface

See also

https://crowdin.com/page/api/delete-file

at line 121
ResponseInterface export(string $file, string $language, string $toPath)

This method exports single translated files from Crowdin.

Additionally, it can be applied to export XLIFF files for offline localization. (@todo)

Parameters

string $file The file name.
string $language The language tag.
string $toPath Export to path.

Return Value

ResponseInterface

See also

https://crowdin.com/page/api/export-file