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" } ] } }
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-datadue to the included file upload.To upload a file, the request body must contain the
fileform field with the contents and file name of the file to upload.Only files with one of the extensions
zip,tar.gz,tgzortarwill 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.
Delete a language pack¶
- DELETE /api/languages/(string: locale)/(string: pack)¶
Deletes the language pack
packfor localelocale. Can be either the_corepack (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" } ] } }
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 |