AI Assist v3.2.0: Introduction of translation style guide and field translation max depth configuration in code assistant

Translation style guide

In some cases you might want/need the translator to follow a certain style guide - for instance you might tell it not to translate certain words, or be more formal or casual. To configure this you can pass a styleguide property under the translation configuration:

assist({
translate: {
styleguide: `Be extremely formal and precise. Translate as if you are Spock from Star Trek.`,
},
})

The style guide is currently limited to 2000 characters, and the translation might get slower the longer your style guide is. If the provided string is longer than the limit, the plugin will throw an error upon loading the studio.

Note that translation style guides are currently only possible to declare on a global level - it can not be defined per-field for now.

Field translation max depth

By default, field level translations will translate 6 "path-segments" deep.

Depth is based on field path segments like so:

title has depth 1

array[_key="no"].title has depth 3

If this is not sufficient for your document types, you can now set a maxPathDepth:

assist({
translate: {
field: {
maxPathDepth: 12
},
},
})

Be careful not to set this value too high in studios with recursive document schemas, as it could have negative impact on performance.

maxPathDepth is hard-capped to 50.