• We are currently performing site maintenance, parts of civfanatics are currently offline, but will come back online in the coming days (this includes any time you see the message "account suspended"). For more updates please see here.

Adding new locale to the game

Acid.Crash

Chieftain
Joined
Dec 30, 2024
Messages
74
Hi here,
I am trying to play around with the localization files and seems like things have changed since Civ6 guides.

My goal is to add an unsupported locale to the game

What have I currently done:

Step 1: added the following lines:
Code:
>>Sid Meier's Civilization VII\Base\Assets\schema\localization\schema-loc-20-languages.sql

INSERT INTO "Languages" VALUES('lang-code','LOC_LANGUAGE_lang-code_NAME',null,8);

INSERT INTO "LanguagePriorities" VALUES('lang-code','lang-code',100);
INSERT INTO "LanguagePriorities" VALUES('lang-code','en_US',50);

With this, I am expecting to add a basic text support in the game.
After adding it, a new entry is indeed visible (and selectable) in the Options > System > Language

1739196349914.png


I can verify it applies, because I see a side effect: there is no carousel banner for the news/patch/etc (screen added later).

Step 2: adding the following sample (it should rename the "additional content" item in the main menu)

Code:
>>Sid Meier's Civilization VII\Base\modules\base-standard\text\lang-code\ShellText.xml

<?xml version="1.0" encoding="utf-8"?>
<Database>
    <LocalizedText>
    <Replace Tag="LOC_UI_CONTENT_MGR_TITLE" Language="lang-code">
      <Text>Testing_new_locale1</Text>
    </Replace>
    </LocalizedText>
</Database>

Step 3: linking new file via
Code:
>>Sid Meier's Civilization VII\Base\modules\base-standard\base-standard.modinfo

<Item locale="lang-code">text/lang-code/ShellText.xml</Item>

Locale files seem to be defined twice (after comments in Line 512 and line 943)

1739196167580.png



In the end, I get the following result
Spoiler screen :


1739196841415.png




Per my understanding, I need to do the same for every new localized file within every module (Base and DLC)

With this, I will be grateful for any ideas with the following areas.

Is there an easier way of integrating new files from Step 3?
It seems questionable to overwrite whole *.modinfo file for the sake of adding few new lines.

How can I fix the missing carousel banner for the news/patch/etc
I assume it behaves so because it tries to find banner-locale for the unsupported language on the server and fails.
If this is the case, is it possible to override it to use English as a default?


Thank you in advance.
 
Last edited:
Nicely done!

For the double definitions of locale files, I think it's defined once for the "shell" scope and once for "game". Since text is always going to be necessary in the menus (shell) and in the game proper, I assume including text files twice would be the norm.

There's a log file twokdna.log that logs interactions with 2K's marketing and analytics servers. You'll see it queries for things like PromoLocalization_en_US and gets back stuff like

Code:
                {      
                        "key":"LOC_TEST_ACCOUNT_LINK_CTA",
                        "Description":"Text for Napoleon reward claim where user must link their account in order to receive the two leaders, Napoleon Emperor & Revolutionary",
                        "en_US":"Link 2K account to retrieve Napoleon leader!"
                },

So your guess that the news carousel fails because there's no language is certainly correct. I doubt there's a way to override it - the interaction is in native code, and the config file under DNA/Configurations doesn't seem to have language info so the DNA subsystem probably grabs whatever locale the game is set to.
 
@Solver Thank you for the info.

I did some more digging in Civ 6 department.
Apparently that news carousel banner has the same behavior (buss-out once new language is added)

However I stumbled upon an actual mod
That does show news carousel, but it replaces the language is some unusual way (manipulating with en-US and fi_FI).

With that I was thinking about the following.
If my custom locale will be stored inside an actual mod, will the carousel banner be fixed.

Unfortunately, I am not that familiar with full mod creation flow...
Maybe someone can help with testing or guiding me through...
 
Back
Top Bottom