Nested translation & Metadata. Gender example

Hey!

I wanted to share an early feature we are just finishing off.

Its 3 parts:

  1. Local Variables. These work like Global Variables but can be assigned to a Localized String. This also means you can preview in the Editor without playmode!

7442741--912413--local vars.gif

  1. LocalizedStrings can now be used as Global and Local Variables. This is how you create nested translations.

For example if we wanted to show some text to say
The {item} is {something}

We could define our item like so:
7442741--912416--upload_2021-8-23_20-56-14.png

In English we would say:

The {item} is red.

In Spanish we could say
El {item} es rojo

This brings up a problem though. in Spanish items have gender and these genders can change the sentence.

For example a male item would be :
El {item} es rojo

and female:
La {item} es roja

This brings us to the third feature

  1. you can now access an entries metadata in a Smart String. We can then add the gender to the entry for the item like so:

and access it with {localizedString Name.gender}
Combine this with the choose operator and we can now handle gender in the example like so:

{item:{gender:choose(Male|Female):El|La} {} es {gender:choose(Male|Female):rojo|roja} }

We could also write it as {item.gender:choose(Male|Female):El {item} es rojo|La {item} es roja}
Which is probably simpler

7442741--912425--gender example.gif

We are just adding the final touches and hope to have this in the next release.

Edit:
This will be available in 1.0.0

6 Likes

We created a sample project in the next release. This now supports nested variables so we can now pass data into a nested localized string. For example here we pass the Entry (item) into the nested color string which gives it access to the gender metadata.

7444646--912773--gender sample.gif

2 Likes