MT: Translate with context
The descriptor "Corolla Color" in en
is translated to "Corolla Color" in es
. This probably has to do with capitalization and brand names.
Testing shows that by using a translation context "Corolla Color is the name of a crop descriptor." the MT will generate a correct translation: "Color de la corola".
In this ticket we add context templates to content/language.properties
for each entity with MT support. For Descriptor
the templates are:
translate.context.Descriptor.title={0} is the name of a crop descriptor.
# translate.context.Descriptor.description=It is further defined as: {0} # Unsure about this
translate.context.Descriptor.codes=Valid options are {0}.
The machineTranslate()
method will generate a context string by populating these "templates" and pass it to the machine translation service.
If a descriptor has codes, we can concatenate their titles into (for example) "Valid options are Red, Green, Blue".
Edited by Matija Obreza