Skip to content

API Settings

Elena edited this page Apr 5, 2021 · 6 revisions

Table of Contents

Description

Content for UI panels available in the TaskTracker plugin.

You can add interface texts in a new language and/or change texts in existing languages via API. Alternatively, you can change your interface texts by editing your settings config file directly and then regenerating the database.

Model

Field Type Description
{lng_key} Object Interface texts as shown to users in the language specified by the interface language key (en, ru, de, and others). For example, en stands for interface texts in English.

Public fields

Field Type Description
... Array Interface texts in different languages. See a response example below.

Available languages:

  • en - English
  • ru - Russian

Response example

[
  {
    "surveyPane": 
    [
      { "key": "en" },
      {
        "age": "Age",
        "gender": "Gender",
        "experience": "Program experience",
        "country": "Country",
        "years": "Full years",
        "months": "Months",
        "startSession": "Start the session"
      },
      { "key": "ru" },
      {
        "age": "Возраст",
        "gender": "Пол",
        "experience": "Опыт программирования",
        "country": "Страна",
        "years": "Полных лет",
        "months": "Месяцев",
        "startSession": "Начать работу"
      }
    ],
    "taskChoosePane": 
    [
      { "key": "en" },
      {
        "chooseTask": "Choose the task",
        "finishSession": "Finish the session",
        "startSolving": "Start solving"
      },
      { "key": "ru" },
      {
        "chooseTask": "Выберите задачу",
        "finishSession": "Закончить работу",
        "startSolving": "Начать решение"
      }
    ],
    "taskPane": 
    [
      { "key": "en" },
      {
        "inputData": "Input data",
        "outputData": "Output data",
        "submit": "Submit",
        "backToTasks": "Back to the tasks"
      },
      { "key": "ru" },
      {
        "inputData": "Входные данные",
        "outputData": "Выходные данные",
        "submit": "Отправить решение",
        "backToTasks": "Вернуться к задачам"
      }
    ],
    "finishPane": 
    [
      { "key": "en" },
      {
        "praise": "Nicely done!",
        "backToSurvey": "Back to the survey",
        "finalMessage": "Do not forget to remove the plugin",
        "backToTasks": "Back to the tasks"
      },
      { "key": "ru" },
      {
        "praise": "Отличная работа!",
        "backToSurvey": "Вернуться к анкете",
        "finalMessage": "Не забудьте удалить плагин",
        "backToTasks": "Вернуться к задачам"
      }
    ]
  }
]

Operations

Create settings

Operation

Endpoint Method Description
/api/settings POST Create an instance (multilanguages set) of UI texts in the database.

Note: You can create only one instance of interface texts in the database per request.

Request parameters

Parameter Type Description
descriptions Array Interface texts in different languages.

Request example

{
  "descriptions": 
  [
    {
      "language": "en",
      "info": {
        "surveyPane": {
          "age": "Age",
          "gender": "Gender",
          "experience": "Programming experience",
          "country": "Country",
          "years": "Full years",
          "months": "Months",
          "startSession": "Start the session"
        },
        "taskChoosePane": {
          "chooseTask": "Choose the task",
          "finishSession": "Finish the session",
          "startSolving": "Start solvin"
        },
        "taskPane": {
          "inputData": "Input data",
          "outputData": "Output data",
          "submit": "Submit"
        },
        "finishPane": {
          "praise": "Nicely done!",
          "backToSurvey": "Back to the survey",
          "finalMessage": "Do not forget to remove the plugin"
        },
        "commonText": {
          "backToTasks": "Back to the tasks"
        }
      }
    },
    {
      "language": "ru",
      "info": {
        "surveyPane": {
          "age": "Возраст",
          "gender": "Пол",
          "experience": "Опыт программирования",
          "country": "Страна",
          "years": "Полных лет",
          "months": "Месяцев",
          "startSession": "Начать работу"
        },
        "taskChoosePane": {
          "chooseTask": "Выберите задачу",
          "finishSession": "Закончить работу",
          "startSolving": "Начать решение"
        },
        "taskPane": {
          "inputData": "Входные данные",
          "outputData": "Выходные данные",
          "submit": "Отправить решение"
        },
        "finishPane": {
          "praise": "Отличная работа!",
          "backToSurvey": "Вернуться к анкете",
          "finalMessage": "Не забудьте удалить плагин"
        },
        "commonText": {
          "backToTasks": "Вернуться к задачам"
        }
      }
    }
  ]
}

Response

Public fields of the settings.


Get settings

Operation

Endpoint Method Description
/api/settings GET Get all configured interface texts in different languages.

Request parameters

Empty body.

Response

Public fields of the settings.


Delete settings

Operation

Endpoint Method Description
/api/settings DELETE Delete all interface texts in different languages.

Request parameters

Empty body.

Response

Public fields of the settings.