Skip to content
HOI4DOC

Bindable Localization

Details

Bindable localization is a modular way of binding localization parameters in script for the specified localization key.
Any variable that accepts a bindable localization accepts the following:

The bound localization object has the following members:

  • localization_key = KEY: The localization key that is used for the object.
  • PARAMETER = BINDABLE_LOC: A parameter to the localization key that is replaced with the localized version BINDABLE_LOC,
    where BINDABLE_LOC is a bound localization object itself.

Examples

The following are example usages where the tooltip is a bindable localization:

tooltip = MY_TOOLTIP # Simple loc key tooltip

### Loc entries
MY_TOOLTIP = "This is a tooltip"

### Localized result
This is a tooltip
tooltip = {
	localization_key = MY_TOOLTIP # Root look key
	IMPORTANT_QUESTION = { # ID IMPORTANT_QUESTION in MY_TOOLTIP will get value:
		localization_key = MEANING_OF_LIFE # Root loc key in IMPORTANT_QUESTION
		ANSWER = "42" # ID ANSWER in IMPORTANT_QUESTION will get value 42
	}
	THE_REST_IS = UNIMPORTANT
}

### Loc entries
MY_TOOLTIP = "The thing everyone wonders is if $IMPORTANT_QUESTION$. The rest is $THE_REST_IS$."
MEANING_OF_LIFE = "the meaning of life is $ANSWER$"
UNIMPORTANT = "unimportant"

### Result
The thing everyone wonders is if the meaning of life is 42. The rest is unimportant.
# Using a formatter
custom_effect_tooltip = idea_desc|canadian_pacific_railway

Source: Script Concepts Documentation

Name