How to translate mods?

Camus

Chieftain
Joined
Dec 25, 2015
Messages
14
Location
Poland, Łódź
Hello.

I have a question - how to translate mods? I have no problems with translating the text, of course - but the problem comes with implementing the changes in game. I have no idea how to make translations work. I've tried to look on Google, but I haven't found a clue.

May I ask for help? :D
 

LeeS

Imperator
Joined
Jul 23, 2013
Messages
7,241
Location
Illinois, USA
Sukritact has en example in his Abu Simbel Wonder mod. Here is the contents of the file for the English Language:
Code:
<GameData>
	<Language_en_US>
		<!-- Description tags -->
		<Row Tag="[color="blue"]TXT_KEY_BUILDING_ABUSIMBEL[/color]">
			<Text>Abu Simbel</Text>
		</Row>
		<!-- Help tags -->
		<Row Tag="[color="green"]TXT_KEY_WONDER_ABUSIMBEL_HELP[/color]">
			<Text>Contains 2 slots for Great Works of Art. +2 [ICON_PRODUCTION] Production for Great Works housed in Abu Simbel, other Great Works in the city provide +1 [ICON_PRODUCTION] Production.</Text>
		</Row>
		<!-- Quote tags -->
		<Row Tag="[color="red"]TXT_KEY_WONDER_ABUSIMBEL_QUOTE[/color]">
			<Text>[NEWLINE]     "My name is Ozymandias, king of kings: Look on my works, ye Mighty, and despair!" [NEWLINE]- Percy Bysshe Shelley</Text>
		</Row>
		<!-- Pedia tags -->
		<Row Tag="[color="magenta"]TXT_KEY_WONDER_ABUSIMBEL_PEDIA[/color]">
			<Text>The Abu Simbel temples are two massive rock temples in Abu Simbel in Nubia, southern Egypt. They are situated on the western bank of Lake Nasser, about 230 km southwest of Aswan (about 300 km by road). The complex is part of the UNESCO World Heritage Site known as the "Nubian Monuments," which run from Abu Simbel downriver to Philae (near Aswan).[NEWLINE][NEWLINE]The twin temples were originally carved out of the mountainside during the reign of Pharaoh Ramesses II in the 13th century BCE, as a lasting monument to himself and his queen Nefertari, to commemorate his alleged victory at the Battle of Kadesh. However, the complex was relocated in its entirety in 1968, on an artificial hill made from a domed structure, high above the Aswan High Dam reservoir.[NEWLINE][NEWLINE]The relocation of the temples was necessary to avoid their being submerged during the creation of Lake Nasser, the massive artificial water reservoir formed after the building of the Aswan High Dam on the Nile River.</Text>
		</Row>
	</Language_en_US>
</GameData>
Here is the same thing for Espanol, contained within a file for the speaker of Spanish1:
Code:
<GameData>
	<Language_ES_ES>
		<!-- Description tags -->
		<Row Tag="[color="blue"]TXT_KEY_BUILDING_ABUSIMBEL[/color]">
			<Text>Abu Simbel|Abu Simbel</Text>
			<Gender>masculine|masculine</Gender>
			<Plurality>1|2</Plurality>
		</Row>
		<!-- Help tags -->
		<Row Tag="[color="green"]TXT_KEY_WONDER_ABUSIMBEL_HELP[/color]">
			<Text>Contiene 2 espacios para Grandes obras de arte. +2 de Producción [ICON_PRODUCTION] por Grandes obras que se albergan en Abu Simbel, otras Grandes obras en la ciudad proporcionan +1 a Producción [ICON_PRODUCTION].</Text>
		</Row>
		<!-- Quote tags -->
		<Row Tag="[color="red"]TXT_KEY_WONDER_ABUSIMBEL_QUOTE[/color]">
			<Text>[NEWLINE]     "Mi nombre es Ozymandias, rey de reyes: ¡Contemplad mis obras, oh poderosos, y desesperad!" [NEWLINE]- Percy Bysshe Shelley</Text>
		</Row>
		<!-- Pedia tags -->
		<Row Tag="[color="magenta"]TXT_KEY_WONDER_ABUSIMBEL_PEDIA[/color]">
			<Text>Abu Simbel es un emplazamiento de interés arqueológico que se compone de templos egipcios ubicado en Nubia, al sur de Egipto. Está localizado en la ribera occidental del lago Nasser, a unos 231 km al suroeste de Asuán (como 300 km por carretera), próximo a su emplazamiento original. Los templos forman parte del Museo al Aire Libre de Nubia y Asuán, complejo que fue declarado Patrimonio de la Humanidad por la Unesco en 1979 con el nombre de "Monumentos de Nubia, desde Abu Simbel hasta File", conocidos como los "Monumentos nubios", que se extienden hasta File, cerca de Asuán.[NEWLINE][NEWLINE]Los templos fueron excavados en la roca (speos) durante el reinado del faraón Ramsés II en el siglo XIII a. C., como un monumento dedicado a dicho faraón y a su esposa Nefertari, para conmemorar su supuesta victoria en la batalla de Qadesh y mostrar su poder a sus vecinos nubios.[NEWLINE][NEWLINE]En 1968, el complejo fue reubicado en una colina artificial, construida en terrenos próximos situados sobre el nivel del futuro lago Nasser. El traslado de los templos fue necesario para evitar que quedaran sumergidos, tras la construcción de la presa de Asuán, por el embalse formado por las aguas del río Nilo. Abu Simbel sigue siendo una de las más importantes atracciones turísticas de Egipto.</Text>
		</Row>
	</Language_ES_ES>
</GameData>
I have added the color-codings to show how the English-Language code aligns to the Spanish-Language code. You just do the same sort of thing for whichever language you are translating the mod into. An incomplete list of available languages:
Code:
<Language_en_US>
<Language_ES_ES>
<Language_DE_DE>
<Language_FR_FR>
<Language_IT_IT>
<Language_JA_JP>
<Language_KO_KR>
<Language_PL_PL>
<Language_RU_RU>
<Language_ZH_Hant_HK>
Be aware that some languages require 'gender' data for the tags that name things in-game, so as in the example of the Abu Simbel mod, in the <Language_ES_ES> the description tag for the wonder requires <Gender> and <Plurality> plurality data (esp. for proper insertion of grammatical uses of las, los, la, el) to designate in Espanol whether the proper way to present a possible in-game text would be Los Musketerios2 or if ought to be La Musketeria2. The romance language family all require this. I am not sure about any others. English sometimes has plurality specified by Firaxis, but my native English is such a doggerel language in this issue of plurality/gender/noun matching that incorrect usage is almost never noticed anyway. About all that is ever required for English is
Code:
			<Gender>neuter:the</Gender>
			<Gender>neuter:an</Gender>
			<Gender>neuter:no_article</Gender>









1It is not necessary to have the code in different files for English than for Spanish. This is just the way Sukritact did it. It is however often easier to manage the differing sets of language information when each is contained within its own xml-file. You could tack it all together in one file like as this:
Spoiler :
Code:
<GameData>
	<Language_en_US>
		<!-- Description tags -->
		<Row Tag="[color="blue"]TXT_KEY_BUILDING_ABUSIMBEL[/color]">
			<Text>Abu Simbel</Text>
		</Row>
		<!-- Help tags -->
		<Row Tag="[color="green"]TXT_KEY_WONDER_ABUSIMBEL_HELP[/color]">
			<Text>Contains 2 slots for Great Works of Art. +2 [ICON_PRODUCTION] Production for Great Works housed in Abu Simbel, other Great Works in the city provide +1 [ICON_PRODUCTION] Production.</Text>
		</Row>
		<!-- Quote tags -->
		<Row Tag="[color="red"]TXT_KEY_WONDER_ABUSIMBEL_QUOTE[/color]">
			<Text>[NEWLINE]     "My name is Ozymandias, king of kings: Look on my works, ye Mighty, and despair!" [NEWLINE]- Percy Bysshe Shelley</Text>
		</Row>
		<!-- Pedia tags -->
		<Row Tag="[color="magenta"]TXT_KEY_WONDER_ABUSIMBEL_PEDIA[/color]">
			<Text>The Abu Simbel temples are two massive rock temples in Abu Simbel in Nubia, southern Egypt. They are situated on the western bank of Lake Nasser, about 230 km southwest of Aswan (about 300 km by road). The complex is part of the UNESCO World Heritage Site known as the "Nubian Monuments," which run from Abu Simbel downriver to Philae (near Aswan).[NEWLINE][NEWLINE]The twin temples were originally carved out of the mountainside during the reign of Pharaoh Ramesses II in the 13th century BCE, as a lasting monument to himself and his queen Nefertari, to commemorate his alleged victory at the Battle of Kadesh. However, the complex was relocated in its entirety in 1968, on an artificial hill made from a domed structure, high above the Aswan High Dam reservoir.[NEWLINE][NEWLINE]The relocation of the temples was necessary to avoid their being submerged during the creation of Lake Nasser, the massive artificial water reservoir formed after the building of the Aswan High Dam on the Nile River.</Text>
		</Row>
	</Language_en_US>
	<Language_ES_ES>
		<!-- Description tags -->
		<Row Tag="[color="blue"]TXT_KEY_BUILDING_ABUSIMBEL[/color]">
			<Text>Abu Simbel|Abu Simbel</Text>
			<Gender>masculine|masculine</Gender>
			<Plurality>1|2</Plurality>
		</Row>
		<!-- Help tags -->
		<Row Tag="[color="green"]TXT_KEY_WONDER_ABUSIMBEL_HELP[/color]">
			<Text>Contiene 2 espacios para Grandes obras de arte. +2 de Producción [ICON_PRODUCTION] por Grandes obras que se albergan en Abu Simbel, otras Grandes obras en la ciudad proporcionan +1 a Producción [ICON_PRODUCTION].</Text>
		</Row>
		<!-- Quote tags -->
		<Row Tag="[color="red"]TXT_KEY_WONDER_ABUSIMBEL_QUOTE[/color]">
			<Text>[NEWLINE]     "Mi nombre es Ozymandias, rey de reyes: ¡Contemplad mis obras, oh poderosos, y desesperad!" [NEWLINE]- Percy Bysshe Shelley</Text>
		</Row>
		<!-- Pedia tags -->
		<Row Tag="[color="magenta"]TXT_KEY_WONDER_ABUSIMBEL_PEDIA[/color]">
			<Text>Abu Simbel es un emplazamiento de interés arqueológico que se compone de templos egipcios ubicado en Nubia, al sur de Egipto. Está localizado en la ribera occidental del lago Nasser, a unos 231 km al suroeste de Asuán (como 300 km por carretera), próximo a su emplazamiento original. Los templos forman parte del Museo al Aire Libre de Nubia y Asuán, complejo que fue declarado Patrimonio de la Humanidad por la Unesco en 1979 con el nombre de "Monumentos de Nubia, desde Abu Simbel hasta File", conocidos como los "Monumentos nubios", que se extienden hasta File, cerca de Asuán.[NEWLINE][NEWLINE]Los templos fueron excavados en la roca (speos) durante el reinado del faraón Ramsés II en el siglo XIII a. C., como un monumento dedicado a dicho faraón y a su esposa Nefertari, para conmemorar su supuesta victoria en la batalla de Qadesh y mostrar su poder a sus vecinos nubios.[NEWLINE][NEWLINE]En 1968, el complejo fue reubicado en una colina artificial, construida en terrenos próximos situados sobre el nivel del futuro lago Nasser. El traslado de los templos fue necesario para evitar que quedaran sumergidos, tras la construcción de la presa de Asuán, por el embalse formado por las aguas del río Nilo. Abu Simbel sigue siendo una de las más importantes atracciones turísticas de Egipto.</Text>
		</Row>
	</Language_ES_ES>
</GameData>
2I entirely made this 'word' and its possible usages in Espanol up. I have no idea what the proper word would be, and whether it would generally be used in the singular or plural by default, or whether it would by default be considered feminine or masculine.
 

AW Arcaeca

Deus Vult
Joined
Mar 10, 2013
Messages
2,976
Location
Operation Padlock ground zero
Text in Civ5 is processed in a system involving "text keys" - essentially, rather than directly using text, you provide things like buildings and units and whatever else with a set of characters which it can then compare against a table to see what it should display.
Spoiler :

Exactly what it will retrieve, therefore, depends on table it checks.
Spoiler :

So basically, do exactly as you would to add English text, but set it load into a different table. The language tables are, as far as I know:

Chinese: Language_ZH_HANT_HK
English: Language_en_US
French: Language_FR_FR
German: Language_DE_DE
Italian: Language_IT_IT
Japanese: Language_JA_JP
Korean: Language_KO_KR
Polish: Language_PL_PL
Russian: Language_RU_RU
Spanish: Language_ES_ES

EDIT: Aaaaaand that's the second time today I've been ninja'd by LeeS
 

Camus

Chieftain
Joined
Dec 25, 2015
Messages
14
Location
Poland, Łódź
Big thanks to both of you. I got it. Well, it looks easy, so let's try! :D

Wys&#322;ane z mojego E2105 przy u&#380;yciu Tapatalka
 

Hoop Thrower

Cyberbolivarian Inkarri
Joined
Aug 5, 2013
Messages
2,463
Location
Chile
2I entirely made this 'word' and its possible usages in Espanol up. I have no idea what the proper word would be, and whether it would generally be used in the singular or plural by default, or whether it would by default be considered feminine or masculine.
El Mosquete is the weapon. El Mosquetero is the person who uses them.

Los Mosqueteros would be the correct word. It's masculine and Plural.

La Mosquetería would be the second word (?). It's feminine and Singular. Never heard of anything being called that tho.

In case anyone cares. :crazyeye:
 
Top Bottom