[Vanilla] How to add localized text

catwill

Chieftain
Joined
Jul 17, 2020
Messages
5
I tried to add localized text to gameplay text, but it failed.
Modding.log outputs this message↓.
Warning: LocalizedText - Failed loading XML.
Some .xml files always show this message, and some.xml files never show this. Some .xml files sometimes show this, but other times they don't show this.
What can I do? Is there a way to add localized text without any errors?

Lists of which file causes the warning
Always : "Robocosan_Text_Agendas_and_Traits.xml", "Robocosan_Text_Agendas_and_Traits_JP.xml"
Sometimes : "Robocosan_Text_Pedia.xml", "Robocosan_Text_Pedia_JP.xml"
Never : "Robocosan_Text_Citizen_and_Cities.xml", "Robocosan_Text_Citizen_and_Cities_JP.xml"

P.S. This mod doesn't show icons properly. And some files about Fallbackimages may be broken. If you know anything about these problem, let me know.

Since I am Japanese, my English may be hard to understand. Ask me if you have something which can't understand.
 

Attachments

  • RBM FS.zip
    8.2 MB · Views: 50
Code:
		<Row Tag="LOC_TRAIT_CIVILIZATION_BUILDING_CASTING_TOOLS_DESCRIPTION" Language="en_US">
			<Text>This building provides +2 [ICON_Food] Food, +2 [ICON_Production] Production, +2 [ICON_GOLD] Gold, +2 [ICON_Culture] Culture, +2 [ICON_SCIENCE] Science, and +2 [ICON_FAITH] Faith to its city.</Text>
		</Row>
	</LocalizedText>
  </BaseGameText>
</GameData>
The </BaseGameText> command is a syntax error since this is at the top of the file
Code:
<GameData>
	<LocalizedText>
		<!-- 遭遇時な
And <LocalizedText> and <BaseGameText> are each their own table. One cannot be "under" another.

Files Robocosan_Text_Agendas_and_Traits_JP.xml and Robocosan_Text_Agendas_and_Traits.xml contain this error at the bottom of the file

-----------------------------------------------------

Code:
		<Row Tag="LOC_LOADING_INFO_LEADER_DEFAULT" Language="en_US">
			<Text>Hello-robo! Roboco here!</Text>
		</Row>
</GameData>
Table <LocalizedText> is never closed

File Robocosan_Text_Pedia.xml and Robocosan_Text_Pedia_JP.xml both contain this error at the bottom of the file.


-------------------------------------------------

You are loading all of the text files in both the FrontEndActions and InGameActions. While Text files can be loaded into both "ends" of the game this can often lead to error messages and or incomplete loading of data because there is only one Localized Text system and the game does not allow multiple attempts to define a row that has exactly the same data for the combination of Tag and Language within table LocalizedText. It isn't actually necessary to load anything into the FrontEnd LocalizedText which does not directly have anything to do with game set up menus and civilization or leader selection screens. Use of <Replace> instead of <Row> will keep the game from generating errors related to attempts to define the same combination of Tag and Language in the <LocalizedText> table more than once within a mod.
 
I'm not sure why I couldn't find such a simple mistake...
I fixed those problems and replace <Row> to <Replace>. It works well!
Thank you for answering my question!
 
Top Bottom