Resource icon

Localization: Adding a new language

Merri

Warlord
Joined
Aug 18, 2007
Messages
231
Merri submitted a new resource:

Localization: Adding a new language - Guides a simple way to add a new language option via Text user folder

View attachment 457405

In Civilization VI user folder (for example: C:\Users\Merri\Documents\My Games\Sid Meier's Civilization VI) you can add a new empty Text folder.

To this folder you can create a LocalizationDatabase_Data.sql file:

Code:
INSERT INTO "Languages" VALUES('fi_FI','Suomi',null,2);
INSERT INTO "DefaultAudioLanguages" VALUES('fi_FI','English(US)');
INSERT INTO "SteamLanguages" VALUES('finnish','fi_FI');
INSERT INTO "LanguagePriorities"...

Read more about this resource...

2016-11-02 Civ6 Localization.png
 
Last edited:
I have created simple PowerShell script to transform from source EN_US directory into the file with translation. Not nic, but will do the work and pretty fast ;)

$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()
 
I have created simple PowerShell script to transform from source EN_US directory into the file with translation. Not nic, but will do the work and pretty fast ;)

$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()
Thanks for everything. How can I edit the language files in the DLC folder? The main language file does not read on Base folder (Vanilla_ex_EX.xml). DLC's still appear in English.
 
Last edited:
Hello! I have a friend, who is doing ukrainian localization and a friend who can an voice the characters. The problem is - we dont understand how to change audio. Can someone help with this?
 
Hello! I have a friend, who is doing ukrainian localization and a friend who can an voice the characters. The problem is - we dont understand how to change audio. Can someone help with this?
How i can contact to your friend? I want to join to the translation work.
 
Hello, my 12 year old daughter is really enthusiastic about Civ6. She would like to play in Dutch language. I found the translated files on Github, but I don´t know where to put them. We are on Linux Pop_OS! (Ubuntu derivative) and Civ6 is installed through Steam. I don't know where to find the user folder to put the files into... Can anyone help?
 
Top Bottom