AutoLocalize is broken for strings with RichText formatting

Currently, strings using RichText tags won’t be translated despite having AutoLocalize enabled, even if you have the exact same string added as source in your localizationTable (With translations).

This can currently be reproduced in my game using the string below, but it happens with every other string that contains RichText formatting: (The exact same string is in the localizationTable in my game, but with no Context field)

Achieve victory with <i>every</i> possible Juggernaut vehicle. Unlock a very rare Chat Color and Title

All these strings used to be translated correctly in the past. There may have been several months since this stopped working.

1 Like

This is because the Source text for RichText is actually drawn from the ContentText property, which is based on the Text property with all RichText tags stripped off.

This was added in 2021: Upcoming New Property on Text Object - ContentText It looks like this was never documented though, and I can see how this behavior would be very confusing.

In your example, removing the tags from the Source text will make it work:

table:SetEntries({
	{
		-- Note that the <i> </i> tag was stripped off
		Source = "Achieve victory with every possible Juggernaut vehicle. Unlock a very rare Chat Color and Title",
		Values = {
			["pt-br"] = "Atingir a vitória com <i>cada</i> veículo Juggernaut possível. Desbloquear uma Cor e Titulo da Chat muito rara",
		},
	},
})
3 Likes

Thanks I didn’t realize that.

AutoLocalize used to require the RichText tags being present in source, must have missed when that changed.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.