Languages
Note
All language pack management operations require the SETTINGS
permission.
Retrieve installed language packs
- GET /api/languages
Retrieves a list of installed language packs.
The response body will contain a list response.
Example
GET /api/languages HTTP/1.1 Host: example.com X-Api-Key: abcdef...
HTTP/1.1 200 OK Content-Type: application/json { "language_packs": { "_core": { "identifier": "_core", "name": "Core", "languages": [] }, "some_plugin": { "identifier": "some_plugin", "name": "Some Plugin", "languages": [ { "locale": "de", "locale_display": "Deutsch", "locale_english": "German", "last_update": 1474574597, "author": "Gina Häußge" }, { "locale": "it", "locale_display": "Italiano", "locale_english": "Italian", "last_update": 1470859680, "author": "The italian Transifex Team" } ] } }
- Status Codes:
200 OK – No error
Upload a language pack
- POST /api/languages
Uploads a new language pack to OctoPrint.
Other than most of the other requests on OctoPrint’s API which are expected as JSON, this request is expected as
Content-Type: multipart/form-data
due to the included file upload.To upload a file, the request body must contain the
file
form field with the contents and file name of the file to upload.Only files with one of the extensions
zip
,tar.gz
,tgz
ortar
will be processed, for other file extensions a 400 Bad Request will be returned.Will return a list of installed language packs upon completion, as described in Retrieve installed language packs.
- Form Parameters:
file – The language pack file to upload
- Status Codes:
200 OK – The file was uploaded successfully
Delete a language pack
- DELETE /api/languages/(string: locale)/(string: pack)
Deletes the language pack
pack
for localelocale
. Can be either the_core
pack (containing translations for core OctoPrint) or the language pack for a plugin specified by the plugin identifier.Returns a list of installed language packs, as described in Retrieve installed language packs.
Example
DELETE /api/languages/it/some_plugin HTTP/1.1 Host: example.com X-Api-Key: abcdef...
HTTP/1.1 200 OK Content-Type: application/json { "language_packs": { "_core": { "identifier": "_core", "name": "Core", "languages": [] }, "some_plugin": { "identifier": "some_plugin", "name": "Some Plugin", "languages": [ { "locale": "de", "locale_display": "Deutsch", "locale_english": "German", "last_update": 1474574597, "author": "Gina Häußge" } ] } }
- Parameters:
locale – The locale for which to delete the language pack
pack – The language pack to delete
- Status Codes:
200 OK – The language pack was deleted
Data model
List response
Name |
Multiplicity |
Type |
Description |
---|---|---|---|
|
0..* |
Map of component lists |
Map of component lists, indexed by the component’s identifier |
Component list
Name |
Multiplicity |
Type |
Description |
---|---|---|---|
|
1 |
string |
The plugin’s identifier, |
|
1 |
string |
Displayable name of the component, |
|
0..* |
List of language pack meta data |
Language packs for the component |
Language pack metadata
Name |
Multiplicity |
Type |
Description |
---|---|---|---|
|
1 |
string |
Locale of the language pack |
|
1 |
string |
Displayable name of the locale |
|
1 |
string |
English representation of the locale |
|
0..1 |
int |
Timestamp of the last update of the language pack |
|
0..1 |
string |
Author of the language pack |