Custom File Format Module
Use this module to add support of new custom file formats. It’s implemented by delegating a source file parsing to an app with a custom file format module. When translations are completed, Crowdin passes a source file and a string array with translations to the Custom file format app for translation files generation.
Access
You can grant access to this module to one of the following user categories:
For Crowdin:
- Only me (i.e., project owner)
- All project members
- Selected users
For Crowdin Enterprise:
- Only organization admins
- All users in the organization projects
- Selected users
Structure
Properties
key | Type: Required: yes Description: Module identifier within the Crowdin app. |
type | Type: Required: yes Description: The custom file format identifier. Can be used in API to force the processing of the files by the Custom file format app. If the |
url | Type: Required: yes Description: The relative URL triggered on file import, update, translation upload, and export. |
multilingual | Type: Required: no Allowed values: Description: This parameter is used to combine the content of multiple languages into one request when uploading and downloading translations in your Crowdin project. |
signaturePatterns | Type: Description: Contains |
Communication between Custom File Format App and Crowdin
On the initial file import, the system detects custom file format using the signaturePatterns
or type
parameters and makes an HTTP request to the app’s URL ($baseUrl . $url
) for further processing. Then app processes the file in a custom format and responds to the system. The requests and responses to and from the custom file format apps have two-minute timeouts. The maximum request and response payload size is limited to 5 MB.
Request to the App
Request payload example:
Properties:
jobType | Type: Possible values: Description: Specifies the action that should be executed by the app. |
file.content , file.contentUrl | Type: Description: Parameters used to pass the base64 encoded source file content ( |
strings , stringsUrl | Type(strings): Type(stringsUrl): Description: Parameters used for translations download (for |
Expected Response from the App for the parse-file Job Type
Response payload example:
Properties:
data.strings , data.stringsUrl | Type(data.strings): Type(data.stringsUrl): Description: Parameters used to pass the parsed strings content. |
preview , previewUrl | Type(preview): Type(previewUrl): Description: Parameters used to pass the optional HTML preview of the parsed strings content, which can be generated by the app. The generated HTML preview will be displayed in the Editor. See the HTML Preview file example. |
error.message | Type: Description: An error message that can be passed from the app to Crowdin Enterprise and will be visible to a user in the UI. |
Expected Response from the App for the build-file Job Type
Response payload example:
Properties:
data.content , data.contentUrl | Type(data.content): Type(data.contentUrl): Description: Parameters used to pass the base64 encoded translation file content ( |
error.message | Type: Description: An error message that can be passed from the app to Crowdin Enterprise and will be visible to a user in the UI. |
Strings Array Structure
Below you can see an example of the strings structure expected from the app for parse-file
job type and passed to the app for build-file
job type.
Payload example:
Properties:
previewId | Type: Required: yes (only for the Description: Numeric identifier of the string in the HTML Preview file. Used for |
id | Type: Description: Numeric identifier of the string in your Crowdin Enterprise project. Used for |
identifier | Type: Description: Unique string key within the file. |
customData | Type: Description: Any custom data that need to be linked to the string. Added custom data will be exported along the corresponding strings on translation export. |
HTML Preview of the File
HTML Preview of the file example: