"""
Language Translate
Translations from one to another language
"""

name = "language/translate"
version = "1.0.1"

"""
Translate text usecase
Translate text to another language
"""
usecase TranslateText {
  input {
      text
      targetLanguage
      sourceLanguage
  }

  result {
      text
      sourceLanguage
  } 

  error {
      title!
      detail
  }

  example Successful {
    input {
      text = 'Enjoy your stay.',
      targetLanguage = 'ES',
    }

    result {
      text = 'Disfrute de su estancia.'
      sourceLanguage = 'EN'
    }
  }

  example Failed {
    input {
      targetLanguage = 'EN',
    }

    error {
      title = 'Bad request',
      detail = 'Parameter \'text\' not specified.'
    }
  }
}

"""
Text
"""
field text string

"""
Target language
Language that specified text is translated into
"""
field targetLanguage enum {
    BG, CS, DA, DE, EL, EN_GB = 'EN-GB', EN_US = 'EN-US', EN, ES, ET, FI, FR, HU, IT, JA, 
    LT, LV, NL, PL, PT_PT = 'PT-PT', PT_BR = 'PT-BR', PT, RO, RU, SK, SL, SV, ZH
}

"""
Source language
Language of specified text
"""
field sourceLanguage enum {
    BG, CS, DA, DE, EL, EN, ES, ET, FI, FR, HU, IT, JA, LT, LV, 
    NL, PL, PT, RO, RU, SK, SL, SV, ZH
}

"""
Title
A short, human-readable summary of the problem type.
"""
field title string

"""
Detail
A human-readable explanation specific to this occurrence of the problem.
"""
field detail string