HomeWildfire Games

Internationalise Damage Types and Status Effects using (optional) JSON files.

Description

Internationalise Damage Types and Status Effects using (optional) JSON files.

.json files in simulation/data/template/helpers/damage_types and status_effects will be used to internationalise damage types and status effects, as well as share common text.
Fixes the order of damage types being inconsistent.

Add the possibility for i10n xml extractor to set a custom context.

Fixes #4801
Related to D2296.

Featuring work from: Freagarach

Differential Revision: https://code.wildfiregames.com/D2337

Event Timeline

Nescio added a subscriber: Nescio.May 26 2020, 9:00 PM

simulation/ai/petra/config.js lines 25 to 30:

	// Define damage type importance factors here.
	this.DamageTypeImportance = {
		"Hack": 0.085,
		"Pierce": 0.075,
		"Crush": 0.065
	};

Maybe move these into those new damage files?
Also, why the template_helpers/ folder? Wouldn't simulation/data/damage_types/ be sufficient? Cf. simulation/data/resources/.

Maybe move these into those new damage files?

I think I debated that on IRC a (long)while ago. I would rather not, these values are IMO specific to the AI, not to the damage types. Ideally, the AI would compute them dynamically instead of hardcoding, but I don't think it's a good idea to start mixing these.

Also, why the template_helpers/ folder? Wouldn't simulation/data/damage_types/ be sufficient? Cf. simulation/data/resources/.

Yeah, I hesitated before committing this...
I think I might go back on this TBH, the "template_helpers" bit is kind of ugly. The reason is mostly that damage types don't really have existence outside of templates, and these files are optional, which I guess I wanted to make clear.

Nescio added inline comments.Jun 23 2020, 8:19 PM
/ps/trunk/binaries/data/mods/public/simulation/data/template_helpers/damage_types/crush.json
4

like → such as

/ps/trunk/binaries/data/mods/public/simulation/data/template_helpers/damage_types/hack.json
4

idem

/ps/trunk/binaries/data/mods/public/simulation/data/template_helpers/damage_types/pierce.json
4

idem

Freagarach added inline comments.
/ps/trunk/binaries/data/mods/public/gui/common/tooltips.js
178

The context is not needed, since translators have nothing to translate here.