equinor / flotilla

Flotilla is the main point of access for operators to interact with multiple robots in a facility.
Eclipse Public License 2.0
16 stars 38 forks source link

Consider allowing more dynamic translations #1496

Closed andchiind closed 7 months ago

andchiind commented 7 months ago

Describe the new feature you would like to see Currently the translations work by replacing a given string with another one. This allows us to handle most situations, but there are a couple of limitations. One limitation is that different languages place words in different parts of the sentences in their grammar, so if we want to translate that part separately then we currently instead have to make one of the translations sound awkward.

Here is an example of places where we need to create compound translations: image

Another limitation is when we receive strings from the backend which we may want to translate, such as alerts. In this case it could for instance be convenient to simply paste the provided string into the TranslateText() function, but this will not work if the provided string contains variables, such as robot names.

Describe the solution you'd like What I think might be the simplest solution is to allow strings to make use of arguments using a typical string formatting syntax:

image

This allows us to change their location and ordering in a string, avoiding the need for translating parts of a sentence at a time.

How will this feature affect the current Threat Model? N/A, the strings are anyways not used to run code. We don't even need regex.