Localization system bugs

Here’s the first few impressions and what I did:

  1. edit locales/index.xml, adding:

     <locale id="cs-CZ" sort="7">
     	<ui language="Jazyk" region="Region" accept="Vyber"/>		
     	<label id="en-US,en-GB,en-CA,de-DE,fr-FR,nb-NO,es-ES" language="Czech" region="Česko"/>
     </locale>  
    
  2. add flag file _flags/cs-CZ.png

  3. copy de-DE directory to cs-CZ

  4. start the game

And here’s what happens:

  1. When I click on the US flag, I get the language choices, but my language says Deutsch (Czech). A bit of experimenting with the order shows that it’s not Deutsch specifically - it’s whatever language was on the previous line, or “null” if I change the sort parameter so that cs-CZ is first. This would suggest that there is some hardcoded list of language names somewhere.

  2. possibly related problem - if I select my language and then click on the flag again, I get empty window and have to kill the game. Other languages work OK

  3. Another possibly related problem - if I exit the game with cs-CZ selected (saved in config as locale), next startup ends (after loading complete) with Error 2007, context Main.finishSetup options menu. (Removing the locale line from config restores it).

  4. The “Č” character is not shown at all, probably indicating that the font in question doesn’t contain it. In fact, from all the “special” characters in Czech (áÁčČďĎéÉěĚíÍóÓřŘšŠťŤúÚůžŽ), only the vowels accented with ‘´’ are shown, everything else is just silently eaten.

  5. Any missing entry in the localization file screws up the game. I took data_status_effects.csv from some other than German locale, translated the strings, put this into the German locale directory and suddenly I couldn’t see battle preview of any battle that has enemies with any flavours. Found out that there were two extra values in the original, working, German file (one of them KNOCK_BACK, as if KNOCKBACK isn’t enough). I seriously think that the localization support should work on the principle of “if I can’t find something, use default text”, and it most certainly shouldn’t just stop working. (In case of broken status effects, once you click on “Battle” where an attempt is made, you cannot navigate away on the map anymore, the only thing that works is Quit)

  6. the “default” property of locale in locales/index.xml seems to be ignored, English (US) is always selected.

A wonderful list of bugs to start my morning with… ahhhh!

I know what I’ll be doing tomorrow :smiley:

  1. Turns out it’s simpler than that, there’s no hard-coded list anywhere. You’re just not supplying “cs-CZ” in your list of locales for Czech, so it doesn’t know what to call itself in its native language. The variable doesn’t get set that loop when it can’t find the translation, so it just carries over the text from the previous iteration, “Deutsch.” I’m updating the build so it clears out that text each iteration with a visible error dummy text in case the user forgets to supply something.

Putting “cs-CZ” in the label tag id string fixes that problem :slight_smile:

2&3) This is simply the game not having elegant error cases for missing data files.

  1. Missing characters in the font assets, I’ll fix that up! I might as well add some missing polish characters and Cyrillic while I’m at it. I’ll report back on how this goes.

  2. Yeah, this is a known issue. The principle you suggest is definitely my intention, the only thing is it has to be implemented in a lot of different places where strings are being immediately processed without first doing safety-checking to see if they are null. This happens a lot after the localization switch, and is a particular problem with status effects / flavors. My goal is to get this to the point where the game gives useful error feedback whenever something goes wrong, rather than just choking on it.

  3. Confirmed; this was the intention: The “default” property on the locales/index.xml is there to tell the game which language to select if the user has not yet selected a locale, ie, if no locale is specified in config.xml. If you clear out the locale line from your config folder, it will pick whatever language is set as default in index.xml. As of right now, it always picks english if nothing is specified in config.xml, regardless of what’s set to default. Fixing this…

Okay, I’ve added support for extra characters - this adds Latin Extended A & B, as well as Cyrillic. I just tested it, and this gets the missing Czech characters to show up.

I’ve also added a simple error message when loading locales - if anything is missing, it will show a warning, tell you which files are missing, and let you know that it will default to the english version of that file. This way you can work on a “partial” translation without having to have a full set of files.

Next, I’ve fixed a glitch in the overworld that was causing crashes - I explicitly check for failed localized strings in flavor names, and display the untranslated variable flag instead, so it’s super obvious where something’s missing.

One more thing I’ll be adding - when you select a locale, I’ll have it so that when you select a locale the game does a quick comparison against the language currently set as “default” in the locale index.xml file, and take note of whether any line items are missing. This way, it should be easy for the translator to keep tabs on things they’ve forgotten to translate without having to manually compare a bunch of csv files or go hunting around the game.

— Begin quote from "larsiusprime"

Putting “cs-CZ” in the label tag id string fixes that problem :slight_smile:

— End quote

Oh yea, obvious, isn’t it? Now :slight_smile: ) Fixes problems 1, 2 and 3.

All that and other fixes coming soon to version 1.0.59, which I’ll be uploading today if I can to the test server.

If I’m lucky, I’ll also get the Mac build up too, been meaning to update it.