Feminine and Masculine variants

What’s the best workflow for handling the difference between masculine and feminine ways of saying sentences?

I guess the best thing to do is have a separate table for feminine and a separate table for masculine and load which asset you need accordingly?

Be nice if the languages in the local generator had a dialect selector for feminine and masculine so you could just load them in the same as another language more or less

Hmm, interesting.
You can create custom Locales so having 2 Locales for each language is in theory possible however you would need to use a custom language code. E.G
English is en, so you could have en-masculine and en-feminine.
This makes me think we should add an extra field to let you set the true language code so that we can still fetch CultureInfo etc.
The problem with this though is that your language selection menu would now have versions for Feminine and Masculine which would probably not be what you want.
Maybe some sort of Locale variant system.

I think your approach of having 2 tables is the best we have at the moment. We do have the Smart String support for when you just need to change parts of the word Choose | Localization | 0.9.0-preview

The smart strings were my original idea but there are just too many differences in the way sentences are formed over various languages to make that feasible.

The locale variant idea seems like a reasonable way of handling it but agreed that the 2 asset tables and picking which one to load is probably the best bet for now.

Will probably make a google spreadsheet that contains the masculine and feminine variants for the game page and selected language.
Then will use 2 assets that will be populated using their respective columns in the spreadsheet.

1 Like

For anyone viewing in the future, this is how I set it up…

I have an override class for the LocaleColumn to add an extra string to the name which I use to display if the column is for masculine or feminine, then I also have a separate google sheet for each language that contains the masculine and feminine variant for that language.

6610378--752158--upload_2020-12-10_19-56-2.png

I also store the masculine and feminine varients in different table collections which contain all the different languages for that page.

6610378--752149--upload_2020-12-10_19-54-50.png

Then my Home-Masculine asset has multiple google sheet extensions for each of the languages so I can pull from separate pages and combine them onto the same asset (same with Home-Feminine).

This is the class I wrote for extending the column name.

    [DisplayName("Locale Column With Name Extension")]
    public class LocaleColumnNameExt : LocaleColumn
    {
        [SerializeField]
        private string _nameExtension;
      
        public override void PushHeader(StringTableCollection collection, out string header, out string headerNote)
        {
            var localeName = LocaleIdentifier.ToString();
            header = $"{localeName} - {_nameExtension}";
            headerNote = null;
        }
    }

The only thing missing really is a single button to press to push and pull everything, which you can find an example of how to do in the samples packages

and here’s a bonus class for adding the string as a note instead of a name extension.

    [DisplayName("Locale Column With Note")]
    public class LocaleColumnWithNote : LocaleColumn
    {
        [SerializeField] private string _headerNote;
      
        public override void PushHeader(StringTableCollection collection, out string header, out string headerNote)
        {
            header = LocaleIdentifier.ToString();
            headerNote = _headerNote;
        }
    }

1 Like

Nice :smile:

1 Like

I know I marked this as resolved, but is this the method that was intended while making the system?

I have to assume thought was put into this while the system was being developed and I feel like this isn’t the way you guys had thought it would be done while making it.

Seems like maybe you just assumed we would use the gender conjunctions with Smart.Format inside of the table indexes id assume?

Then maybe if the string was more complicated than what Smart.Format could handle you would attach custom metadata that contained the varients to use for the selected gender?

(just curious, I’m fine with redoing what i did, just want to do it in a way that is “correct”)

There’s not really a way we want to force you down. The smart format approach was one, using metadata was another but it’s really whatever suits your project.
We are open to feedback. If there’s something that we can do to help then we are happy to take the feedback onboard. Can you tell me a little more about what you are trying to do?
How will you be using data? Is it dialogue from a character?
It hard to have a system that does variants when so many languages have different types of variants. For example some languages would change based on honorifics. E.g am I talking to someone older or of a higher position than me.
So far using different tables, multiple entries, metadata and smart format are all ways to handle this. The best approach at the moment is to have the variant be part of the table or entry name, as you have done. Having a way to indicate variants is an interesting idea though. Just needs fleshing out. Should it be done via multiple locales? Would it work by changing the selected locale during the game? That would probably be too rigid. So maybe we need something else.
Using metadata to store variants for an entry does seem like a good way, we just need better editor features for it.

I have no negative feedback because it is a complicated topic and that’s why I originally went with the separate databases because of how complex things can get.

But now I’m thinking just using the metadata is a simpler approach and I can push and pull the metadata into an adjacent column then decide if i need to use it based off the user and the text being displayed. The only thing I guess to note would be that’s more memory to load in because each database would have more data for the different text variants instead of just loading the database you need. But because of things like the age differences requiring different text also I think the different database approach becomes too complicated.

But the project this is for is a racing game, no dialogue, so I may just be overthinking this massively… most text is actually static besides like the results text for when a race would finish.

The main complication im facing really is that we display some of our in-game Ui using a web browser, so those pages are displayed using angular and typescript, so im trying to think of a way to format the strings using the same approach across both languages, and a way to read from the same assets so we dont have to have an angular copy of the string table and a unity version. but something tells me angular is going to have a hard time using SmartFormat.NET and reading from unitys addressables package :smile:

1 Like