Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Country names with hybrid species are not correctly localized #8

Closed
RandomComputerUser opened this issue Jun 7, 2024 · 6 comments
Closed

Comments

@RandomComputerUser
Copy link

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
Copy link
Owner

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

@RandomComputerUser
Copy link
Author

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:

  • HALF_SPECIES_NAME:0 is Half-$SPECIES_TWO$
  • PRESCRIPTED_species_adjective_humans1:1 is Human $1$
  • High_Kingdom:0 is High Kingdom

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

@MichaelMakesGames
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

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.

@MichaelMakesGames
Copy link
Owner

This is fixed in the main branch and will be included in the next release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants