civ5 Translation

cool3a2

Deity
Joined
Mar 30, 2007
Messages
2,177
The hungarian community is working on translating civ 5 and has produced a first playable version already. It's problem, however, is, that it overrides the english texts. This is bad as any mod would either need to be provided in two versions or require user intervention (via editing the mod). It'd be a far better solution if we could add hungarian language support somehow.

Well, there is the Civ5/assets/Gameplay/XML/NewTexts folder, where the subfolder for the different languages can be found and also some config files. An example language config file:
<?xml version="1.0" encoding="utf-8" ?>
<GameData>
<Languages>
<Row>
<ID>0</ID>
<Type>en_US</Type>
<Name>English</Name>
<TableName>Language_en_US</TableName>
<PluralRule>2</PluralRule>
</Row>
</Languages>

<SpokenLanguages>
<Row>
<ID>0</ID>
<Type>en_US</Type>
<DisplayName>English</DisplayName>
<Path>English</Path>
</Row>
</SpokenLanguages>
</GameData>

Besides of this, There is the MyGames/civ5 folder where a general config file can be found. Besides of others, it contains the following three lines:
; The currently selected steam language
SteamLanguage = german

; The currently selected language.
Language = de_DE

; The currently selected spoken language.
AudioLanguage = de_DE
(The language can differ of course.)
I tried to set that file to hungarian using phrases like hungarian and hu_HU. Also, I made a subfolder in Civ5/assets/Gameplay/XML/NewTexts called HU_HU containing all the translated xmls (their language tag is Language_hu_HU) and of course, I created a language config file called hungarian.txt with the following content:
<?xml version="1.0" encoding="utf-8" ?>
<GameData>
<Languages>
<Row>
<ID>0</ID>
<Type>hu_HU</Type>
<Name>Hungarian</Name>
<TableName>Language_hu_HU</TableName>
<PluralRule>2</PluralRule>
</Row>
</Languages>

<SpokenLanguages>
<Row>
<ID>0</ID>
<Type>hu_HU</Type>
<DisplayName>Hungarian</DisplayName>
<Path>English</Path>
</Row>
</SpokenLanguages>
</GameData>
(I played around with the ID, but no difference.)
If I start the game, the menu occurs in the language previously set (not hungarian) and if I leave civ5, the configs lines I mentioned are set back to german for instance (actually to whatever they were set before I edited them). I suppose that steam stores the language setting and the game then looks them up when loading. There would be two ways to solve this:
1. Another language, let's say english, could point to Language_hu_HU. This should be set for civ5, so players without these changes will still see the english texts, while hungarian users that have configured their civ5 see hungarian texts. Both languages could be provided at once in different files, the game will handle them according to how it is configured.
2. Hungarian is added by reconfigure steam so that the settings made in civ5s general config file doesn't get restored when civ5 loads (or gets restored correctly). This would be the better solution.

I suppose this will affect many other languages, too, so I'd be glad if civfanatics would support this attempt by making sure this thread doesn't disappear too soon and of course, if anyone would help with suggestions.


EDIT:
This... http://wiki.2kgames.com/civ5/index.php/Mods:AddingNewLanguage#Config.ini ... doesn't work for me.
 
I tried a little longer with that guide I posted. Well, I wasn't too successful. I also tried to copy the files to both paths, My Documents/My Games/Civ5/text and Steam/steamapps/common/Civ5/Assets/Gameplay/XML/NewText. Well, it still doesn't work, but according to the logs, the languages table is added twice then. This means, that adding the data works, but the game is unable to switch languages. There are no more errors according to the logs though... Civ5s config file seems to be okay. I set its write protection through its properties, so that the game won't override it. It doesn't, but obviously it also ignores it completely. Ah.. there is no setting in civ5 in-game menu to set up the language for me. Heard, that for somes, there is. Not for me. I guess steam overrides the language setting of the config file...

EDIT: Seems I made a big step with a dirty trick. I've set the game to english via steam, then I went to steam/steamapps/bla bla bla and deleted the english.xml file. Then I added the hungarian text files there and created a file called Language_Hungarian.xml containing the following:
<?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>
<Type>en_US</Type>
<Name>Magyar</Name>
<TableName>Language_hu_HU</TableName>
<PluralRule>2</PluralRule>
<UseExtendedFont>1</UseExtendedFont>
</Row>
</Languages>


<SpokenLanguages>
<Row>
<ID>0</ID>
<Type>en_US</Type>
<DisplayName>English</DisplayName>
<Path>English</Path>
</Row>
</SpokenLanguages>

</GameData>
That redirects the english language to the hungarian texts. Hungarians won't be able to have both languages installed at once, but mods can contain files for both languages without problems and in a way that Hungarians and english speakers will have their own languages respectively. I suppose there is a bug with the language switch as I've read about similar things earlier. If this is the case or if there will be someone smarter then me later, on this can be improved. Hungarizations and other languages should remain compatible.
 
I am not sure if I understand it right, but why don't you make the Hungarian xmls as a mod? So, not to overwrite the English files or change anything,but only add xmls with updates for the text files, and in case someone want to use Civ5 in Hungarian, then they can install the mod and enable it in mod browser. This way both languages can be used.
 
This won't solve the problem. The Hungarization is quite okay, even if it uses the Language_hu_HU-tags. You could load the edited files as mod, sure, but it would be annoying if one would need to load the mod everytime instead of having the translation active all the time. Also, one can never know what could happen if the translation gets merged with a mod. However, the actual problems occur when you have mods. When you override the Language_en_US-tags, no matter whether you do it with a mod or 'hardcoded', you'd need to provide two language files that collide with each others as they use the same language-tag. Maybe this won't cause crashes - haven't tried it - but one of the languages wouldn't work. You'd need to provide a separate file that the user would have to apply manually and a modmod would be an ugly solution. And it might cause problem if two players that use different languages want to play the same mod. The game will recognize the translation as a separate mod, therefor a multiplayer game can't be done. The way I did it now, makes it sure that both, Hungarians and english speakers will see their own languages correctly while both load the exact same mod. That should make live easier.
 
I know this is an old thread, but my post will be about the same issue and it's even my own thread. State of the art is, that we have done the translation the way the link I gave in post 1 mentions it. Together with nitram, we were able to unhide the language pulldown in civ5s options menu and were able to set the language to Hungarian. Although the language was reset after each new start of civ5. At least, we could have tested it this ways. At some point, translations stopped due to a decrease of motivation. Meanwhile G&K arrived making the unhide trick unfunctional again. Lately, a new user started to work on a translation for G&K, but has problems to set the language to hungarian. The config.ini. trick still doesn't work (setting is simply ignored) and there is no setting to set the language in the game. There is through steam, but only for the official languages. Anyone knows how to set the language?
 
I made some progress. Nitram once suggested to edit the OptionsMenu.xml to make the texts language setting appear in the options menu. Yet Gods & Kings shipped a second copy. So, if you are using vanilla Civ5 the file is here:
Steam\SteamApps\common\sid meier's civilization v\Assets\UI\Options
Otherwise, if you are running Gods & Kings, search here for the file:
Steam\SteamApps\common\sid meier's civilization v\Assets\DLC\Expansion\UI\Options
Open the xml-file and search for the following line:
<PullDown Style="GenericPullDown" ScrollThreshold="200" SpaceForScroll="0" Size="230,32" ID="LanguagePull" Hidden="1" >
...and change it to:
<PullDown Style="GenericPullDown" ScrollThreshold="200" SpaceForScroll="0" Size="230,32" ID="LanguagePull" Hidden="0" >
You can then switch between all installed languages and if you have followed the guide thats link is given in post 1, your language should be there.

At first, I had problems when loading a mod (game crashed to desktop), but I tried it by adding a language based on the official german translation that I renamed to Haha / haha and everything was fine. I suppose that as the hungarian translation was based on vanilla civ5, either files or text entries were missing causing the crash. So try making sure there is a complete example of each file for your translation and everything will be fine, I suppose. Of course, the language_xy_XY in the xmls must be correct.

Now, there is still a problem with this: the setting is not stored properly. After each launch of civ5, the language is reset. As mentioned earlier, the config.ini-approach doesn't work for me, actually my setting there is reset as well (which is strange habit for a software...). On the other side, nitram said once, that he does not have this problem. Maybe there is some setting in steam or civ5 to be set to avoid this. I'll report if I should find out more details.
 
I'm doing the Finnish language pack and it seems you're still doing things the old unsupported way. I used the same way (replacing English) in the first versions I released back in 2010, but in 2011 I switched to the Firaxis recommended way of doing language packs. This means:

config.ini: change Language = en_US to Language = fi_FI

XML like following:
Code:
<?xml version="1.0" encoding="utf-8"?>
<GameData>
	<Table name="Language_fi_FI">
		<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>
			<Type>fi_FI</Type>
			<Name>Suomi</Name>
			<TableName>Language_fi_FI</TableName>
			<PluralRule>2</PluralRule>
			<UseExtendedFont>0</UseExtendedFont>
			<FontName>TeX Gyre Adventor</FontName>
			<FontWidthScale>0.4</FontWidthScale>
			<FontHeightScale>0.8</FontHeightScale>
		</Row>
	</Languages>
	<Language_fi_FI>
		<Row Tag="TXT_KEY_...">
			<Text>...</Text>
		</Row>
	</Language_fi_FI>
</GameData>

The XML file is located at Documents\My Games\Sid Meier's Civilization 5\Text

And this way has worked perfectly since then. As things are I currently have everything in one file. The requirement to edit config.ini is far from being user friendly, but it is easier than instructing people to first edit an XML file and then go select the language from a dropdown box each time they start a game.


Another annoyance with this are DLC packs and Gods & Kings: until they are translated the text displays in German! I find this to be a bug in the game, because English should always be the fallback language.
 
Back
Top Bottom