The BWX WordPress connector (WPC) creates translation projects in BWX from assets in a WordPress server.
This article assumes your WPC has been configured properly and will guide you through creating a project in BWX.
You can check our API documentation here:
Bureau Works API
If you still don’t know how to authenticate to our API,
you can check the steps here:
API authentication
Creating a translation project with WPC
The endpoint to create a translation using WPC (Bureau Works API ) accepts quite a few parameters. They are detailed in the table below.
Parameter |
Type |
Description |
Required |
---|---|---|---|
orgUnitUUID |
string |
The UUID of the Organizational Unit under which the project will be created. This information is present in the URL of the Org. Unit. |
✅ |
productTag |
string |
The identifier tag of the project in the Org. Unit. It defaults to wordpress |
|
reference |
string |
The name of the project that appears in our dashboard. It defaults to WordPress CI Project |
|
sourceLanguage1 |
string |
The source language of the assets to be translated. If none is provided, this is retrieved from the Org. Unit’s configuration. |
|
targetLanguages1 |
list |
The list of target languages the assets should be translated to. If none is provided, this information is retrieved from the Org. Unit's configuration. |
|
workflows |
list |
A list of workflows to use for all assets. If none is provided, the workflows will be inferred by our system for each file. |
|
tags |
list |
List of tags to add to the project. |
|
wpType |
string |
The type of asset to fetch from WordPress |
✅ |
wpIds |
list |
List of asset ids to fetch from WordPress. If this is empty, all assets of the given will be considered for translation |
|
wpPaths |
list |
Used to include assets whose link match any entry in this array. Has no effect if wpIds is provided |
|
wpExcludePaths |
list |
Assets whose links match elements of this array will not be considered for translation. Has no effect if wpIds is provided |
|
skipHashCheck |
boolean |
Whether assets with same content should be sent for translation again. This needs to be true if a previous project containing the assets was marked as CANCELLED |
|
1 The code of the language is expected in these parameters. This information is available through the Languages endpoint on our documentation - Bureau Works API
wpType is required so the connector knows what to look for.
If wpIds is not empty, then wpPaths and wpExcludePaths will not be taken into account.
Also, the execution will fail if the type of any page provided in wpIds doesn’t match the wpType parameter.
Including specific pages
The wpPaths parameter expects a list of paths. If this is provided, only the assets listed will be considered for translation.
Take a look at the following example request:
{
"orgUnitUUID": "org-unit-uuid",
"targetLanguages": ["es_es"],
"workflows": ["TRANSLATION"],
"wpType": "post",
"wpPaths": [
"/blog/my-awesome-blog-post/",
"/blog/a-surprising-story",
"/blog/museum*"
]
}
This will create a project to translate the assets with the following slugs:
-
/blog/my-awesome-blog-post
-
/blog/a-surprising-story
-
Every page whose slug contains the /blog/museum text. You can use the wildcard character only at end of strings.
This project will contain only the language Spanish (Spain) and the workflow TRANSLATION for all files.
Excluding specific pages from translation
The wpExcludePaths parameter expects a list of paths. If this is provided, the assets listed will not be considered for translation.
This parameter is similar to wpPaths, so the wildcard character is also available here.
wpExcludePaths takes precedence over wpPaths.
This means that if the slug of a page matches values from both lists,
the page will not be considered for translation.
Comments
0 comments
Please sign in to leave a comment.