Glossary management
Delete all entries in a glossary.
name | type | description | default |
---|---|---|---|
qualifiedName | query | Qualified name of glossary, defaults to #GLOBAL_QUALIFIED_NAME | global/default |
code | condition |
---|---|
200 | The glossary was deleted |
401 | The user does not have the proper permissions to perform this operation |
500 | If there is an unexpected error in the server while performing this operation |
media type | data type | description |
---|---|---|
application/json | number (JSON) | The number of deleted glossary entries |
application/octet-stream | (custom) | |
application/vnd.zanata.glossary+json | number (JSON) | |
application/vnd.zanata.glossary+xml | int (XML) | |
application/xml | int (XML) |
DELETE /glossary Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
...
Upload glossary file (currently supported formats: po, csv)
media type | data type | description |
---|---|---|
multipart/form-data | (custom) | Multi-part form with the following named parts: file: The file contents srcLocale: Source locale for the glossary entries transLocale: Translation locale for the glossary entries fileName: The name of the file being uploaded qualifiedName: The qualified name for the glossary |
code | condition |
---|---|
201 | Files successfully uploaded |
401 | The user does not have the proper permissions to perform this operation |
500 | If there is an unexpected error in the server while performing this operation |
media type | data type |
---|---|
application/json | Glossary Results (JSON) |
POST /glossary
Content-Type: multipart/form-data
Accept: application/json
...
HTTP/1.1 201 Created
Content-Type: application/json
{
"glossaryEntries" : [ {
"id" : 444555,
"pos" : "verb",
"description" : "...",
"srcLang" : "en-US",
"sourceReference" : "...",
"glossaryTerms" : [ {
"content" : "Una casa",
"comment" : "...",
"locale" : "es-ES",
"lastModifiedDate" : 12345,
"lastModifiedBy" : "homer"
}, {
"content" : "家",
"comment" : "...",
"locale" : "ja",
"lastModifiedDate" : 12345,
"lastModifiedBy" : "..."
} ],
"termsCount" : 2,
"qualifiedName" : {
"name" : "global/default"
}
}, {
"id" : 444556,
"pos" : "noun",
"description" : "...",
"srcLang" : "...",
"sourceReference" : "...",
"glossaryTerms" : [ {
"content" : "家",
"comment" : "...",
"locale" : "ja",
"lastModifiedDate" : 12345,
"lastModifiedBy" : "..."
}, {
"content" : "家",
"comment" : "...",
"locale" : "ja",
"lastModifiedDate" : 12345,
"lastModifiedBy" : "..."
} ],
"termsCount" : 12345,
"qualifiedName" : {
"name" : "..."
}
} ],
"warnings" : [ "...", "..." ]
}
Returns a subset of Glossary entries for the given source and translation locale as indicated by the paging parameters.
name | type | description | default | constraints |
---|---|---|---|---|
filter | query | String filter for source content | ||
page | query | Current request page (default value: 1) | 1 | int |
qualifiedName | query | Qualified name of glossary, default to #GLOBAL_QUALIFIED_NAME | global/default | |
sizePerPage | query | Size of entry per page (default/max value: 1000) #MAX_PAGE_SIZE | 1000 | int |
sort | query | Fields to sort. Comma separated. e.g sort=desc,-part_of_speech See org.zanata.common.GlossarySortField | ||
srcLocale | query | Source locale - Required (default value: en-US). | en-US | |
transLocale | query | Translation locale |
code | condition |
---|---|
200 | Response containing Glossary entries for the given locale. |
400 | If page or sizePerPage are negative, or sizePerPage is greater than 1000 |
500 | If there is an unexpected error in the server while performing this operation |
media type | data type |
---|---|
application/json | Result List (JSON) |
application/vnd.zanata.glossary+json | Result List (JSON) |
GET /glossary/entries Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
{
"results" : [ { }, { } ],
"totalCount" : 12345
}
Create or update glossary entries. Glossary Terms with a locale different from the given locale parameter will be ignored.
name | type | description | default |
---|---|---|---|
locale | query | Locale to which the given glossary entries belong | |
qualifiedName | query | Qualified name of glossary, defaults to #GLOBAL_QUALIFIED_NAME | global/default |
media type | data type | description |
---|---|---|
application/json | array of Glossary Entry (JSON) | The glossary entries to create/update |
application/xml | list of Glossary Entry (XML) |
code | condition |
---|---|
200 | The glossary entries were successfully created or updated |
401 | The user does not have the proper permissions to perform this operation |
500 | If there is an unexpected error in the server while performing this operation |
media type | data type |
---|---|
application/json | Glossary Results (JSON) |
application/xml | Glossary Results (XML) |
POST /glossary/entries
Content-Type: application/json
Accept: application/json
[ {
"id" : 444555,
"pos" : "verb",
"description" : "...",
"srcLang" : "en-US",
"sourceReference" : "...",
"glossaryTerms" : [ {
"content" : "Una casa",
"comment" : "...",
"locale" : "es-ES",
"lastModifiedDate" : 12345,
"lastModifiedBy" : "homer"
}, {
"content" : "家",
"comment" : "...",
"locale" : "ja",
"lastModifiedDate" : 12345,
"lastModifiedBy" : "..."
} ],
"termsCount" : 2,
"qualifiedName" : {
"name" : "global/default"
}
} ]
HTTP/1.1 200 OK
Content-Type: application/json
{
"glossaryEntries" : [ {
"id" : 444555,
"pos" : "verb",
"description" : "...",
"srcLang" : "en-US",
"sourceReference" : "...",
"glossaryTerms" : [ {
"content" : "Una casa",
"comment" : "...",
"locale" : "es-ES",
"lastModifiedDate" : 12345,
"lastModifiedBy" : "homer"
}, {
"content" : "家",
"comment" : "...",
"locale" : "ja",
"lastModifiedDate" : 12345,
"lastModifiedBy" : "..."
} ],
"termsCount" : 2,
"qualifiedName" : {
"name" : "global/default"
}
}, {
"id" : 444556,
"pos" : "noun",
"description" : "...",
"srcLang" : "...",
"sourceReference" : "...",
"glossaryTerms" : [ {
"content" : "家",
"comment" : "...",
"locale" : "ja",
"lastModifiedDate" : 12345,
"lastModifiedBy" : "..."
}, {
"content" : "家",
"comment" : "...",
"locale" : "ja",
"lastModifiedDate" : 12345,
"lastModifiedBy" : "..."
} ],
"termsCount" : 12345,
"qualifiedName" : {
"name" : "..."
}
} ],
"warnings" : [ "...", "..." ]
}
Download all glossary entries as a file
name | type | description | default |
---|---|---|---|
fileType | query | 'po' or 'csv' (case insensitive) are currently supported | csv |
locales | query | optional comma separated list of languages required. | |
qualifiedName | query | Qualified name of glossary, default to #GLOBAL_QUALIFIED_NAME | global/default |
code | condition |
---|---|
200 | File is successfully built and served |
500 | If there is an unexpected error in the server while performing this operation |
media type | data type | description |
---|---|---|
application/octet-stream | (custom) | A file stream with the glossary contents in the specified format |
GET /glossary/file Accept: application/octet-stream
HTTP/1.1 200 OK
Content-Type: application/octet-stream
...
Return source locales available for all glossary entries
name | type | description | default |
---|---|---|---|
qualifiedName | query | Qualified name of glossary, default to #GLOBAL_QUALIFIED_NAME | global/default |
code | condition |
---|---|
200 | Returns the global glossary information |
500 | If there is an unexpected error in the server while performing this operation |
media type | data type |
---|---|
application/json | Glossary Info (JSON) |
application/vnd.zanata.glossary+json | Glossary Info (JSON) |
application/vnd.zanata.glossary+xml | Glossary Info (XML) |
application/xml | Glossary Info (XML) |
GET /glossary/info Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
{
"srcLocale" : {
"locale" : {
"localeId" : "es-ES",
"displayName" : "Spanish (Spain)",
"alias" : "es",
"nativeName" : "Español",
"enabled" : true,
"enabledByDefault" : true,
"pluralForms" : "nplurals=2; plural=(n != 1)",
"rtl" : true
},
"numberOfTerms" : 2
},
"transLocale" : [ {
"locale" : {
"localeId" : "es-ES",
"displayName" : "Spanish (Spain)",
"alias" : "es",
"nativeName" : "Español",
"enabled" : true,
"enabledByDefault" : true,
"pluralForms" : "nplurals=2; plural=(n != 1)",
"rtl" : true
},
"numberOfTerms" : 2
}, {
"locale" : {
"localeId" : "ja",
"displayName" : "Japanese",
"alias" : "ja-JP",
"nativeName" : "日本語",
"enabled" : true,
"enabledByDefault" : true,
"pluralForms" : "nplurals=1; plural=0",
"rtl" : true
},
"numberOfTerms" : 12345
} ]
}
Return default global glossary qualifiedName
code | condition |
---|---|
200 | Returns the qualified name for the system-wide glossary |
500 | If there is an unexpected error in the server while performing this operation |
media type | data type |
---|---|
application/json | Qualified Name (JSON) |
application/vnd.zanata.glossary+json | Qualified Name (JSON) |
application/vnd.zanata.glossary+xml | Qualified Name (XML) |
application/xml | Qualified Name (XML) |
GET /glossary/qualifiedName Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
{
"name" : "global/default"
}
Returns Glossary entries based on a fuzzy text search.
name | type | description | default | constraints |
---|---|---|---|---|
maxResults | query | Maximum results for global and project queries. May return up to double this number. Default: 20 | 20 | int |
project | query | (optional) Project slug if a project glossary should be searched in addition to the global glossary. | ||
searchText | query | Text containing terms to match in the search. | ||
srcLocale | query | Source locale | en-US | |
transLocale | query | Translation locale |
code | condition |
---|---|
200 | Response containing Glossary entries for the given search parameters. |
400 | When maxResults is not strictly positive or is more than 1000 |
400 | When searchText is missing |
400 | When transLocale is missing |
400 | When there is an error parsing the searchText |
500 | If there is an unexpected error in the server while performing this operation |
media type | data type |
---|---|
application/json | Result List (JSON) |
application/vnd.zanata.glossary+json | Result List (JSON) |
GET /glossary/search Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
{
"results" : [ { }, { } ],
"totalCount" : 12345
}
Get the details for a set of glossary terms. Includes source details, and details from the given locale.
name | type | description | constraints | multivalued |
---|---|---|---|---|
locale | path | include locale-specific detail for this locale | no | |
termIds | query | id for glossary terms in the default locale, found in results of #search(LocaleId, LocaleId, int, String, String) | long | yes |
code | condition |
---|---|
200 | Details successfully found |
500 | If there is an unexpected error in the server while performing this operation |
media type | data type | description |
---|---|---|
application/json | object (JSON) | Source and target glossary details. |
application/vnd.zanata.glossary+json | object (JSON) |
GET /glossary/details/{locale} Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
...
Delete a glossary entry.
name | type | description | default | constraints |
---|---|---|---|---|
id | path | id for source glossary term | long | |
qualifiedName | query | Qualified name of glossary, defaults to #GLOBAL_QUALIFIED_NAME | global/default |
code | condition |
---|---|
200 | The glossary entry was successfully deleted |
401 | The user does not have the proper permissions to perform this operation |
500 | If there is an unexpected error in the server while performing this operation |
media type | data type | description |
---|---|---|
application/json | Glossary Entry (JSON) | the removed glossary entry |
DELETE /glossary/entries/{id} Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
{
"id" : 444555,
"pos" : "verb",
"description" : "...",
"srcLang" : "en-US",
"sourceReference" : "...",
"glossaryTerms" : [ {
"content" : "Una casa",
"comment" : "...",
"locale" : "es-ES",
"lastModifiedDate" : 12345,
"lastModifiedBy" : "homer"
}, {
"content" : "家",
"comment" : "...",
"locale" : "ja",
"lastModifiedDate" : 12345,
"lastModifiedBy" : "..."
} ],
"termsCount" : 2,
"qualifiedName" : {
"name" : "global/default"
}
}