MichaelMakesGames / stellarmaps

Stylized maps from Stellaris saves
38 stars 0 forks source link

Country names with hybrid species are not correctly localized #8

Open RandomComputerUser opened 4 weeks ago

RandomComputerUser commented 4 weeks ago

This country name does not localize correctly:

        name={
            key="%ADJ%"
            variables={
                {
                    key="1"
                    value={
                        key="HALF_SPECIES_NAME"
                        variables={
                            {
                                key="base"
                                value={
                                    key="PRESCRIPTED_species_adjective_voor"
                                }
                            }
 {
                                key="SPECIES_TWO"
                                value={
                                    key="PRESCRIPTED_species_adjective_humans1"
                                }
                            }
 {
                                key="1"
                                value={
                                    key="High_Kingdom"
                                }
                            }

                        }
                    }
                }

            }
        }

In English, it should be Half-Human High Kingdom, but the map displays it as Half-$SPECIES_TWO$ Voor $1$.

MichaelMakesGames commented 4 weeks ago

@RandomComputerUser thanks for reporting! I think I see what's going on, but could you upload the save file?

RandomComputerUser commented 4 weeks ago

Here is the save file: 2478.12.20.zip

I came across this issue while testing my own personal Stellaris-related program. I found the following English localizations:

So the name should be computed like so: Half-$SPECIES_TWO$ Half-Human $1$ Half-Human High Kingdom

MichaelMakesGames commented 4 weeks ago

Ah, I knew your username looked familiar... Are you reviving https://randomcomputeruser.github.io/stellaris/stellaris-map-generator/index.html?

I have a special case for %ADJ% which just isn't correctly handling all variables. Should be easy to fix! Thanks for the save

RandomComputerUser commented 4 weeks ago

Ah, I knew your username looked familiar... Are you reviving https://randomcomputeruser.github.io/stellaris/stellaris-map-generator/index.html?

I have a special case for %ADJ% which just isn't correctly handling all variables. Should be easy to fix! Thanks for the save

I was actually working on a personal program I use to generate CSVs for various stats by country over time (somewhat similar to Stellaris dashboard but it accepts a save folder instead of updating a database on-the-fly). I might update my map generator, but the code is of pretty poor quality so I'd probably just rewrite it entirely. Also, my current solution to localization uses a 10 MB JSON file with all English localizations in the game, which is both larger than I'd like and probably not legal to store in my repo. The best solution I can currently think of is to make the user upload the Stellaris game directory before generating a map.

I also found %ADJ% to be a weird case. I don't fully understand it, but my code seems to work for now.

MichaelMakesGames commented 4 weeks ago

Yeah, %ADJ% is weird...

For loc files, Chromium-based browsers can request access to the file system, but that doesn't work in Firefox.

I'm planning on making a web version of StellarMaps. I might have backend function handle loc. That's been OKed by one of the Stellaris community managers.