[LP] Civ6 - How To Add New Language?

Manias

Chieftain
Joined
May 8, 2018
Messages
3
Hello everyone, I added a new language (tr_TR) to the game in the form of "Vanilla_tr_TR.xml".

The main menu and many parts were as I wanted, but even though I translated the texts of the expansion packs, it is still based on the "en_US" folder in the expansion pack.

My LocalizationDatabase_Data.sql;

1670066650227.png
1670068971767.png


If there is no equivalent of the text to be translated, I set it to be based on the "en_US" folder.

1670066804474.png


Although there is an expansion pack translation in this "Vanilla_tr_TR.xml" file, some parts are still based on the "en_US" folder in the expansion pack.

How can I set the expansion packs to be based on the "Vanilla_tr_TR.xml" file? Or is there another way to do this?

All I want is to add a new language without touching the main language files.

This is my inspiration : https://forums.civfanatics.com/threads/localization-adding-a-new-language.603603/

This is how I translated the main language files;

XML:
$dir = "Z:\Documents\My Games\Sid Meier's Civilization VI\Text\en_US"
$outfile = "Z:\Documents\My Games\Sid Meier's Civilization VI\Text\Vanilla_cz_CZ.xml"
$language = "cz_CZ"

if (Test-Path $outfile) {Remove-Item -Path $outfile}
cd $dir

# Set The Formatting
$xmlsettings = New-Object System.Xml.XmlWriterSettings
$xmlsettings.Indent = $true
$xmlsettings.IndentChars = " "

# Filelist before out-XML creation (if accidentally same source-dest dir)
$files = Get-ChildItem -Path $dir -Name -Include *.xml

# Set the File Name Create The Document
$XmlWriter = [System.XML.XmlWriter]::Create($outfile, $xmlsettings)
# Write the XML Decleration and set the XSL
$xmlWriter.WriteStartDocument()
#$xmlWriter.WriteProcessingInstruction("xml-stylesheet", "type='text/xsl' href='style.xsl'")

# Start the Root Element
$xmlWriter.WriteStartElement("GameData")
$xmlWriter.WriteStartElement("LocalizedText")

foreach ($file in $files){
[xml]$XmlFileObj = Get-Content $file -Encoding UTF8
$xml_GameTransl = $XmlFileObj.SelectNodes("/GameData/BaseGameText/Row")
#DEBUG Select-Xml -Xml $XmlFileObj -XPath '/GameData/BaseGameText/Row/Text' | foreach{$_.node}

"Processing... " + $file

foreach ($Row in $xml_GameTransl) {
#DEBUG $row
$xmlWriter.WriteStartElement("Replace")
$xmlWriter.WriteAttributeString("Tag", $Row.Tag)
$xmlWriter.WriteAttributeString("Language", $language)
$xmlWriter.WriteElementString("Text",$Row.Text)
$xmlWriter.WriteEndElement()
}
}

$xmlWriter.WriteEndElement()
$xmlWriter.WriteEndElement()

# End, Finalize and close the XML Document
$xmlWriter.WriteEndDocument()
$xmlWriter.Flush()
$xmlWriter.Close()

An example of my language file is as in the picture ;

1670067737326.png


1670068661922.png

1670069141261.png


Although the area in the red square in the picture above has its equivalent in the "Vanilla_tr_TR.xml" file, it pulls the data from the expansion pack. In the "Expansion 1" and "Expansion 2" expansion packs, the English version of this text is as shown in the picture. The language texts in all expansion packs are available in the "Vanilla_en_TR.xml" file, but it does not read from there. How can I fix this?

***Is there a way for me to add the new language not as "Vanilla_en_TR.xml" but as a "tr_TR" folder like English?***

I'm waiting for your help. Best regards.
 
Last edited:
Top Bottom