Localization Tutorial for CiV

Merri

Warlord
Joined
Aug 18, 2007
Messages
231
As there has been trouble understanding the official documentation when it comes to localization I ended up writing what I know to Modiki.

Testing these things is very slow so I hope whatever I've written is correct. I'm applying a lot of gender use to Finnish language pack at the moment and so far things look good. The most annoying thing seems to be that I can't use a transform for a manually selected form/gender/plural, ie. none of this stuff works:

{1_UnitName[2] : lower}
{{1_UnitName[2]} : lower}
{1_UnitName ^ 'neuter:second_trait' : lower}
{{1_UnitName ^ 'neuter:second_trait'} : lower }

Or well, it works and selects the first form from the string list, but that isn't what I think it should do. So far haven't had any luck in transforming a manually selected form.
 
Nope, we aren't far enough with the translation. But I think you wouldn't really need it to help me. This is not an issue with how we set up the files. Even with the official languages, it is not possible to switch languages without steam. I mean, english is always there and if I tell steam to use german, it is there as well. I should be able to switch between them, but I am not. Well, the only thing that might be buggy, is the hungarian.xml:
Code:
<?xml version="1.0" encoding="utf-8"?>
<GameData>
	<Table name="Language_hu_HU">
		<Column name="ID" type="integer" primarykey="true" autoincrement="true" />
		<Column name="Tag" type="text" notnull="true" />
		<Column name="Text" type="text" notnull="true" />
		<Column name="Gender" type="text" />
		<Column name="Plurality" type="text" />
	</Table>
	<Languages>
		<Row>
			<ID>15</ID>
			<Type>hu_HU</Type>
			<Name>Magyar</Name>
			<TableName>Language_hu_HU</TableName>
			<PluralRule>2</PluralRule>
		</Row>
	</Languages>
</GameData>
Still, even if there would be a bug in here, this wouldn't explain why I can't switch between the official languages either.

EDIT: I would be able to provide you a vanilla civ5 translation, but it won't be entirely translated.
 
Hmm, I was first thinking on checking for possible errors on your language, but I guess I could do the other way around and ask you to try the Finnish language pack. You can see the link for download in my signature. For the test I have to request things to be as pure as possible so:
  • Don't touch Steam language setting. Touching it resets config.ini and that is something we don't want.
  • Have unmodified Civilization V files (no customizations to enable the language dropdown)
  • Edit config.ini to Language = fi_FI
  • Only have Suomi.xml in the My Games\Civ5\Text folder (don't want anything else to mix things up)

With these conditions met the game should start to Finnish language. As your Hungarian translation this pack also lacks some strings.
 
Okay, thank you for your files! I think the approach you suggested is the best we could choose as you already got your file working.

I did the following to meet your scenario: first, I told steam to check local files. This made sure that all my changes to the options screen are gone. I started the game once to check if anything is on default - everything is fine, no option to switch the language in the options. From this point on, I never touched Steam again. I moved any file away from my My Games/Civ5... folder. Then, I downloaded your archive with the latest date and I unpacked it to My Games/Civ5... Edited the config and then started the game. It was still set to german (my default language), the setting in the config was set back to german as well. Tried the same with english, same result. Your translation doesn't work for me either... I suppose there are different versions of civ5 which might be the reason why it does work for you - nothing new from Firaxis that they mess with versions, see civ4. In any case, you'd also have to take this issue in consideration as you can't make sure your users will use the 'right' version of civ5, so it seems we share the same fate... I already checked steams and civ5s files, but couldn't find anything that would have anything to do with the language. I suppose we can't do anything about this, instead, Firaxis would need to fix their game...
 
Have you checked if there are any errors in the Logs folder?

The language pack has a few things editing English data in the DB which might cause an error if being loaded to a version with a non-English fallback. It might be worth giving a shot to setting language to English and then see if things are different.
 
This is the content of my xml.log:
Code:
[4024.156] **** Validating Game Database *****
[4025.625] Performing Localization Checks
[4025.625] Checking Tag Format...
[4025.625] Note: Tags must only use [A-Z_] characters, start with 'TXT_KEY_', and be under 128 characters long.
[4025.625] In table Language_en_US...
[4025.625] Tag (TXT_KEYMODDING_SHOWDLCMODS) does not start with 'TXT_KEY_'
[4025.640] In table Language_fi_FI...
[4025.640] Tag (TXT_KEYMODDING_SHOWDLCMODS) does not start with 'TXT_KEY_'
[4025.656] Validating UnitGameplay
[4025.656] Number of selection sounds doesn't match number of units.
[4025.656] Validating Notifications
[4025.656] Number of notification xml entries does not match enum size
[4025.656] **** VALIDATION FAILED *****
[4025.656] Validation Took 1.500526 seconds
[4026.187] **** Validating Prefetch Process *****
[4026.187] **** Validation Success *****
[4026.187] SetGlobalActionInfo
[4026.187] 
-- SQLite Memory Statistics --
Memory Usage:
		[Cur]		[Max]
Malloc:		388304		29123120
PageCache:	4303		4982
LookAside:	0		0
Scratch:	0		1

Static Buffer Overflows:
		[TooLarge]	[NoSpace]
PageCache:	0		26001400
Scratch:	0		0

Largest Allocations:
Malloc:		131072
PageCache:	1160
Scratch:	6640

Prepared Statements:
Current:		10
------------------------------

And the database.log:
Code:
[4009.359] constraint failed
[4009.359] While executing - 'INSERT INTO ArtDefine_StrategicView(StrategicViewType, TileType, Asset) VALUES(?,?,?)'
[4020.593] no such table: ContentPackage.LocalizedText
[4024.171] Validating Foreign Key Constraints...
[4024.984] Invalid Reference on Leader_MinorCivApproachBiases.LeaderType - "LEADER_HARALD" does not exist in Leaders
[4024.984] Invalid Reference on Leader_MinorCivApproachBiases.LeaderType - "LEADER_KAMEHAMEHA" does not exist in Leaders
[4024.984] Invalid Reference on Leader_MinorCivApproachBiases.LeaderType - "LEADER_SEJONG" does not exist in Leaders
[4024.984] Invalid Reference on Leader_MinorCivApproachBiases.LeaderType - "LEADER_NEBUCHADNEZZAR" does not exist in Leaders
[4024.984] Invalid Reference on Leader_Flavors.LeaderType - "LEADER_HARALD" does not exist in Leaders
[4024.984] Invalid Reference on Leader_Flavors.LeaderType - "LEADER_HARALD" does not exist in Leaders
[4024.984] Invalid Reference on Leader_Flavors.LeaderType - "LEADER_HARALD" does not exist in Leaders
[4024.984] Invalid Reference on Leader_Flavors.LeaderType - "LEADER_HARALD" does not exist in Leaders
[4024.984] Invalid Reference on Leader_Flavors.LeaderType - "LEADER_KAMEHAMEHA" does not exist in Leaders
[4024.984] Invalid Reference on Leader_Flavors.LeaderType - "LEADER_KAMEHAMEHA" does not exist in Leaders
[4024.984] Invalid Reference on Leader_Flavors.LeaderType - "LEADER_KAMEHAMEHA" does not exist in Leaders
[4024.984] Invalid Reference on Leader_Flavors.LeaderType - "LEADER_KAMEHAMEHA" does not exist in Leaders
[4024.984] Invalid Reference on Leader_Flavors.LeaderType - "LEADER_KAMEHAMEHA" does not exist in Leaders
[4024.984] Invalid Reference on Leader_Flavors.LeaderType - "LEADER_KAMEHAMEHA" does not exist in Leaders
[4024.984] Invalid Reference on Leader_Flavors.LeaderType - "LEADER_KAMEHAMEHA" does not exist in Leaders
[4024.984] Invalid Reference on Leader_Flavors.LeaderType - "LEADER_SEJONG" does not exist in Leaders
[4024.984] Invalid Reference on Leader_Flavors.LeaderType - "LEADER_SEJONG" does not exist in Leaders
[4024.984] Invalid Reference on Leader_Flavors.LeaderType - "LEADER_SEJONG" does not exist in Leaders
[4024.984] Invalid Reference on Leader_Flavors.LeaderType - "LEADER_SEJONG" does not exist in Leaders
[4024.984] Invalid Reference on Leader_Flavors.LeaderType - "LEADER_NEBUCHADNEZZAR" does not exist in Leaders
[4024.984] Invalid Reference on Leader_Flavors.LeaderType - "LEADER_NEBUCHADNEZZAR" does not exist in Leaders
[4024.984] Invalid Reference on Leader_Flavors.LeaderType - "LEADER_NEBUCHADNEZZAR" does not exist in Leaders
[4024.984] Invalid Reference on Leader_Flavors.LeaderType - "LEADER_NEBUCHADNEZZAR" does not exist in Leaders
[4024.984] Invalid Reference on Leader_Flavors.LeaderType - "LEADER_NEBUCHADNEZZAR" does not exist in Leaders
[4025.625] Failed Validation.
[4026.187] 
-- SQLite Memory Statistics --
Memory Usage:
		[Cur]		[Max]
Malloc:		388304		29123120
PageCache:	4303		4982
LookAside:	0		0
Scratch:	0		1

Static Buffer Overflows:
		[TooLarge]	[NoSpace]
PageCache:	0		26001400
Scratch:	0		0

Largest Allocations:
Malloc:		131072
PageCache:	1160
Scratch:	6640

Prepared Statements:
Current:		10
------------------------------

Just normal things that are there even if I don't load any translation. The other logs don't mention anything strange either.
 
Have you installed SQLite Manager extension to Firefox or do you have any other SQLite database tool installed? Would be nice to know if the strings are in the database.


And yes, this week I'm awake in quite an odd time of the day.
 
I'm not quite sure if the strings are there as there are 14 db files in my cache directory. Yet there are only 5 with a fresh change date (started civ5 again doing everything as you described earlier). Out of the 5 fresh db files, Localization-Merged.db sounds most promising and does contain texts in different languages. There is a table called Languages which lists Finnish, yet there is no Language_fi_FI table. On the other side, there are tables for all the other languages that are also known by steam. So I suppose that I am watching the right db-file, but your texts don't seem to have been loaded. Let me know if I should watch the wrong place.
 
That would be the correct place. Now we know that for you the error is in actually loading the database strings. Try removing these lines in Suomi.xml and see what happens:
Code:
		<Update>
			<Where Type="en_US"/>
			<Set Name="Englanti"/>
		</Update>

Code:
	<SpokenLanguages>
		<Update>
			<Where Type="en_US"/>
			<Set DisplayName="Englanti"/>
		</Update>
	</SpokenLanguages>

These deal with English and might cause an error that stops loading any further data. Just a guess.
 
Success! After I removed those lines, the translation worked and I was even able to load mods (which I couldn't when switching to hungarian through menu). Thank you for your help and my appologies for having hijacked your thread! I still need to find out why the hungarian translation doesn't work, but I guess I'll be able to find it out myself by comparing it with your translation. I suppose it is because I split it into several files. Anyways, thank you very much!
 
I managed to get the hungarian translation working, but only if the language is set to english via steam and to hungarian via config. Seems like an ID should not be specified for the language. Still, if I set steam to german, the setting in the config is ignored. The hungarian texts are loaded properly to the db though. Don't know what triggers the game to ignore the config. Also, I don't see how I could set steams language setting to english through an install script for the translation. And even if I provide the options menu trick, mods won't load (will crash; on the other side, mods load fine if hungarian is loaded by default) for some unknown reason. I assume these are internal we can't fix. All we can do is giving instructions to the users to set their language through steam to english...
 
Sounds like English is a forced fallback language, which is bit of a shame. Although the fact DLC+G&K fallbacks to German instead of English is odd in that light. In addition I've found a lot of tags which just totally ignore any gender or plural work with them. Localization surely would have had a need for a bit more attention.

Of course... I am a purist or a perfectionist when it comes to these things :)
 
Back
Top Bottom