#AVIALABLE CUSTOM LOCALISATION KEYS
#When adding new custom loc keys, add them to the appropriate category (or add a new one) and describe them. Name the strings "String_X" where x is its content.
# To not display anything, you can use 'localisation_key = ""'

defined_text = {
	name = GetCourtFactionMood
	use_first_valid = yes

	text = {
		localisation_key = String_Happy
		trigger = { liege = { has_character_flag = faction_court_happy } }
	}
	text = {
		localisation_key = String_Unhappy
		trigger = { liege = { has_character_flag = faction_court_unhappy } }
	}
	text = {
		localisation_key = String_Angry
		trigger = { liege = { has_character_flag = faction_court_angry } }
	}
	text = {
		localisation_key = String_Content
	}
}

defined_text = {
	name = GetGloryFactionMood
	use_first_valid = yes

	text = {
		localisation_key = String_Happy
		trigger = { liege = { has_character_flag = faction_glory_happy } }
	}
	text = {
		localisation_key = String_Unhappy
		trigger = { liege = { has_character_flag = faction_glory_unhappy } }
	}
	text = {
		localisation_key = String_Angry
		trigger = { liege = { has_character_flag = faction_glory_angry } }
	}
	text = {
		localisation_key = String_Content
	}
}

defined_text = {
	name = GetTraditionFactionMood
	use_first_valid = yes

	text = {
		localisation_key = String_Happy
		trigger = { liege = { has_character_flag = faction_tradition_happy } }
	}
	text = {
		localisation_key = String_Unhappy
		trigger = { liege = { has_character_flag = faction_tradition_unhappy } }
	}
	text = {
		localisation_key = String_Angry
		trigger = { liege = { has_character_flag = faction_tradition_angry } }
	}
	text = {
		localisation_key = String_Content
	}
}

defined_text = {
	name = GetProsperityFactionMood
	use_first_valid = yes

	text = {
		localisation_key = String_Happy
		trigger = { liege = { has_character_flag = faction_prosperity_happy } }
	}
	text = {
		localisation_key = String_Unhappy
		trigger = { liege = { has_character_flag = faction_prosperity_unhappy } }
	}
	text = {
		localisation_key = String_Angry
		trigger = { liege = { has_character_flag = faction_prosperity_angry } }
	}
	text = {
		localisation_key = String_Content
	}
}

defined_text = {
	name = GetImperialDecadence

	text = {
		localisation_key = String_imperial_decadence
		trigger = {
			real_tier = EMPEROR
			primary_title = {
				check_variable = { which = imperial_decadence value >= 0 }
			}
		}
	}
}

defined_text = {
	name = ValidateChecksum
	use_first_valid = yes

	text = {
		localisation_key = String_ValidChecksum
		trigger = { supported_checksum = yes }
	}

	text = {
		localisation_key = String_InvalidChecksum
		trigger = {supported_checksum = no }
	}
}

defined_text = {
	name = GetIsraeliteCulture

	text = {
		localisation_key = String_Ashkenazi
		trigger = {
			any_demesne_province = {
				owned_by = PREV
				any_province_holding = { has_building = ct_jewish_community_1 }

				OR = {
					region = world_europe_west_germania
					region = world_europe_east
					region = world_europe_west_britannia
					region = world_europe_south_east
				}
			}
		}
	}

	text = {
		localisation_key = String_Sephardi
		trigger = {
			any_demesne_province = {
				owned_by = PREV
				any_province_holding = { has_building = ct_jewish_community_1 }

				OR = {
					region = world_europe_west_iberia
					region = world_africa_north
					region = world_europe_west_francia
					region = custom_roman_italia
					region = world_africa_west
				}
			}
		}
	}

	text = {
		localisation_key = String_Mizrahim
		trigger = {
			any_demesne_province = {
				owned_by = PREV
				any_province_holding = { has_building = ct_jewish_community_1 }

				NOR = {
					region = world_europe_west_germania
					region = world_europe_east
					region = world_europe_west_britannia
					region = world_europe_south_east
					region = world_europe_west_iberia
					region = world_africa_north
					region = world_europe_west_francia
					region = custom_roman_italia
					region = world_africa_west
				}
			}
		}
	}
}

defined_text = {
	name = GetTradeGuildHQ
	use_first_valid = yes

	text = {
		localisation_key = amber_road
		trigger = { trade_post_has_building = tr_amber_road_trade_guild_1 }
	}

	text = {
		localisation_key = atlantic_trade
		trigger = { trade_post_has_building = tr_atlantic_trade_guild_1 }
	}

	text = {
		localisation_key = balkan_road
		trigger = { trade_post_has_building = tr_balkan_road_trade_guild_1 }
	}

	text = {
		localisation_key = baltic_sea
		trigger = { trade_post_has_building = tr_baltic_trade_guild_1 }
	}

	text = {
		localisation_key = british_trade
		trigger = { trade_post_has_building = tr_british_trade_guild_1 }
	}

	text = {
		localisation_key = french_trade
		trigger = { trade_post_has_building = tr_french_trade_guild_1 }
	}

	text = {
		localisation_key = iberian_trade
		trigger = { trade_post_has_building = tr_iberian_trade_guild_1 }
	}

	text = {
		localisation_key = mediterranean_trade
		trigger = { trade_post_has_building = tr_mediterranean_trade_guild_1 }
	}

	text = {
		localisation_key = salt_road
		trigger = { trade_post_has_building = tr_salt_road_trade_guild_1 }
	}

	text = {
		localisation_key = rus_road
		trigger = { trade_post_has_building = tr_rus_road_trade_guild_1 }
	}
}

defined_text = {
	name = GetTributaryPeriod

	text = {
		localisation_key = String_tributary_period
		trigger = {
			OR = {
				is_tributary = { type = forced }
				is_tributary = { type = voluntary }
			}
			primary_title = {
				check_variable = { which = tributary_years value >= 0 }
				check_variable = { which = tributary_years value < 30 }
			}
		}
	}

	text = {
		localisation_key = String_tributary_period_vassalize
		trigger = {
			OR = {
				is_tributary = { type = forced }
				is_tributary = { type = voluntary }
			}
			primary_title = {
				check_variable = { which = tributary_years value >= 30 }
			}
		}
	}
}

defined_text = {
	name = GetFeastAppetizer

	text = {
		localisation_key = EVTOPTA_PLUS_4601
		trigger = { has_character_flag = jd_feast_salmon }
	}
	text = {
		localisation_key = EVTOPTB_PLUS_4601
		trigger = { has_character_flag = jd_feast_cheese_eggs }
	}
	text = {
		localisation_key = EVTOPTC_PLUS_4601
		trigger = { has_character_flag = jd_feast_roasted_milk }
	}
	text = {
		localisation_key = EVTOPTD_PLUS_4601
		trigger = { has_character_flag = jd_feast_balls }
	}
}

defined_text = {
	name = GetFeastMainDish

	text = {
		localisation_key = EVTOPTA_PLUS_4602
		trigger = { has_character_flag = jd_feast_poultry }
	}
	text = {
		localisation_key = EVTOPTB_PLUS_4602
		trigger = { has_character_flag = jd_feast_cattle }
	}
	text = {
		localisation_key = EVTOPTC_PLUS_4602
		trigger = { has_character_flag = jd_feast_pig }
	}
	text = {
		localisation_key = EVTOPTD_PLUS_4602
		trigger = { has_character_flag = jd_feast_horse }
	}
}

defined_text = {
	name = GetTerribleDish

	text = {
		localisation_key = EVTOPTD_PLUS_4601
		trigger = { has_character_flag = jd_feast_balls }
	}
	text = {
		localisation_key = EVTOPTD_PLUS_4602
		trigger = { has_character_flag = jd_feast_horse }
	}
}

defined_text = {
	name = GetShortGovernmentName
	use_first_valid = yes

	text = { # Imperial
		localisation_key = String_Imperial
		trigger = { has_law = imperial_administration }
	}
	text = { # Monastic
		localisation_key = String_Monastic
		trigger = { government = theocratic_feudal_government }
	}
	text = {
		localisation_key = String_DefaultGovernmentName
	}
}

defined_text = {
	name = GetLordshipFoa

	text = { # Male
		localisation_key = LORD_FOA
		trigger = { is_female = no }
	}
	text = { # Female
		localisation_key = LADY_FOA
		trigger = { is_female = yes }
	}
}

defined_text = {
	name = GetTyranny

	text = {
		localisation_key = String_tyranny
		trigger = {
			check_variable = { which = tyrant value >= 0 }
		}
	}
}

defined_text = {
	name = GetTanistryOrEldership

	text = {
		localisation_key = succ_tanistry
		trigger = {
			holder_scope = {
				OR = {
					culture_group = celtic
					religion = celtic_pagan

					any_owned_bloodline = {
						has_bloodline_flag = bloodline_tanistry
						bloodline_is_active_for = PREV
					}
				}
			}
		}
	}

	text = {
		localisation_key = succ_eldership
		trigger = {
			holder_scope = {
				OR = {
					# add baltic/WA cultures as well?
					religion = baltic_pagan
					religion = west_african_pagan
					has_religion_feature = religion_beatification
					has_religion_feature = religion_feature_baltic
					has_religion_feature = religion_feature_west_african
					has_religion_feature = religion_feature_egyptian
				}
			}
		}
	}
}

defined_text = {
	name = GetTanistryOrEldershipDesc

	text = {
		localisation_key = succ_tanistry_desc
		trigger = {
			holder_scope = {
				OR = {
					culture_group = celtic
					religion = celtic_pagan

					any_owned_bloodline = {
						has_bloodline_flag = bloodline_tanistry
						bloodline_is_active_for = PREV
					}
				}
			}
		}
	}

	text = {
		localisation_key = succ_eldership_desc
		trigger = {
			holder_scope = {
				OR = {
					# add baltic/WA cultures as well?
					religion = baltic_pagan
					religion = west_african_pagan
					has_religion_feature = religion_beatification
					has_religion_feature = religion_feature_baltic
					has_religion_feature = religion_feature_west_african
					has_religion_feature = religion_feature_egyptian
				}
			}
		}
	}
}

defined_text = {
	name = GetVoteTanistryOrEldership

	text = {
		localisation_key = elective_to_tanistry
		trigger = {
			holder_scope = {
				OR = {
					culture_group = celtic
					religion = celtic_pagan

					any_owned_bloodline = {
						has_bloodline_flag = bloodline_tanistry
						bloodline_is_active_for = PREV
					}
				}
			}
		}
	}

	text = {
		localisation_key = elective_to_eldership
		trigger = {
			holder_scope = {
				OR = {
					# add baltic/WA cultures as well?
					religion = baltic_pagan
					religion = west_african_pagan
					has_religion_feature = religion_beatification
					has_religion_feature = religion_feature_baltic
					has_religion_feature = religion_feature_west_african
					has_religion_feature = religion_feature_egyptian
				}
			}
		}
	}
}

defined_text = {
	name = GetFeudalElectiveType
	use_first_valid = yes

	text = {
		localisation_key = succ_hre_elective
		trigger = {
			OR = {
				title = e_hre
				has_title_flag = alternate_hre
			}
		}
	}

	text = {
		localisation_key = succ_byzantine_elective
		trigger = {
			OR = {
				title = e_byzantium
				title = e_roman_empire
				has_title_flag = alternate_byz
			}
		}
	}

	text = {
		localisation_key = succ_feudal_elective
	}
}

defined_text = {
	name = GetVoteFeudalElectiveType
	use_first_valid = yes

	text = {
		localisation_key = elective_to_hre_elective
		trigger = {
			OR = {
				title = e_hre
				has_title_flag = alternate_hre
			}
		}
	}

	text = {
		localisation_key = elective_to_byzantine_elective
		trigger = {
			OR = {
				title = e_byzantium
				title = e_roman_empire
				has_title_flag = alternate_byz
			}
		}
	}

	text = {
		localisation_key = elective_to_feudal_elective
	}
}

defined_text = {
	name = GetFeudalElectiveTypeDesc
	use_first_valid = yes

	text = {
		localisation_key = succ_hre_elective_desc
		trigger = {
			OR = {
				title = e_hre
				has_title_flag = alternate_hre
			}
		}
	}
	text = {
		localisation_key = succ_byzantine_elective_desc
		trigger = {
			OR = {
				title = e_byzantium
				title = e_roman_empire
				has_title_flag = alternate_byz
			}
		}
	}

	text = {
		localisation_key = succ_feudal_elective_desc
	}
}

defined_text = {
	name = GetRites
	use_first_valid = yes

	text = {
		trigger = { trait = latin_rites }
		localisation_key = string_latin
	}
	text = {
		trigger = { trait = greek_rites }
		localisation_key = string_greek
	}
	text = {
		trigger = { trait = iconoclast_rites }
		localisation_key = string_iconoclast
	}
}

defined_text = {
	name = GetFaithRites
	use_first_valid = yes

	text = {
		trigger = { religion = ROOT }
		localisation_key = "[GetRites] rites"
	}
	text = {
		localisation_key = "[Religion.GetName] faith"
	}
}

### Societies

## Warrior Lodges

# Celtic
defined_text = {
	name = GetCelticWarriorSocietyName
	use_first_valid = yes

	text = {
		trigger = {
			has_alternate_start_parameter = {
				key = religion_names
				value = random
			}
		}
		localisation_key = warrior_lodge_celtic_random
	}
	text = {
		localisation_key = warrior_lodge_celtic_real
	}
}

defined_text = {
	name = GetCelticWarriorSocietyDesc
	use_first_valid = yes

	text = {
		trigger = {
			has_alternate_start_parameter = {
				key = religion_names
				value = random
			}
		}
		localisation_key = warrior_lodge_celtic_desc_random
	}
	text = {
		localisation_key = warrior_lodge_celtic_desc_real
	}
}

# Egyptian
defined_text = {
	name = GetEgyptianWarriorSocietyName
	use_first_valid = yes

	text = {
		trigger = {
			has_alternate_start_parameter = {
				key = religion_names
				value = random
			}
		}
		localisation_key = warrior_lodge_egyptian_random
	}
	text = {
		localisation_key = warrior_lodge_egyptian_real
	}
}

defined_text = {
	name = GetEgyptianWarriorSocietyDesc
	use_first_valid = yes

	text = {
		trigger = {
			has_alternate_start_parameter = {
				key = religion_names
				value = random
			}
		}
		localisation_key = warrior_lodge_egyptian_desc_random
	}
	text = {
		localisation_key = warrior_lodge_egyptian_desc_real
	}
}

## Secret Religious Societies

# Celtic
defined_text = {
	name = GetReligiousCommunityName_celtic_pagan
	use_first_valid = yes

	text = {
		trigger = {
			has_alternate_start_parameter = {
				key = religion_names
				value = random
			}
		}
		localisation_key = alt_start_community_name_celtic_pagan
	}
	text = {
		localisation_key = secret_religious_society_REAL_celtic_pagan
	}
}

defined_text = {
	name = GetReligiousCommunityName_celtic_pagan_reformed
	use_first_valid = yes

	text = {
		trigger = {
			has_alternate_start_parameter = {
				key = religion_names
				value = random
			}
		}
		localisation_key = alt_start_community_name_celtic_pagan_reformed
	}
	text = {
		localisation_key = secret_religious_society_REAL_celtic_pagan_reformed
	}
}

defined_text = {
	name = GetReligiousSocietyDesc_celtic_pagan
	use_first_valid = yes

	text = {
		trigger = {
			has_alternate_start_parameter = {
				key = religion_names
				value = random
			}
		}
		localisation_key = alt_start_community_desc
	}
	text = {
		localisation_key = secret_religious_society_celtic_pagan_desc_REAL
	}
}

defined_text = {
	name = GetReligiousSocietyDesc_celtic_pagan_reformed
	use_first_valid = yes

	text = {
		trigger = {
			has_alternate_start_parameter = {
				key = religion_names
				value = random
			}
		}
		localisation_key = alt_start_community_desc
	}
	text = {
		localisation_key = secret_religious_society_celtic_pagan_reformed_desc_REAL
	}
}

# Egyptian
defined_text = {
	name = GetReligiousCommunityName_egyptian_pagan
	use_first_valid = yes

	text = {
		trigger = {
			has_alternate_start_parameter = {
				key = religion_names
				value = random
			}
		}
		localisation_key = alt_start_community_name_egyptian_pagan
	}
	text = {
		localisation_key = secret_religious_society_REAL_egyptian_pagan
	}
}

defined_text = {
	name = GetReligiousCommunityName_egyptian_pagan_reformed
	use_first_valid = yes

	text = {
		trigger = {
			has_alternate_start_parameter = {
				key = religion_names
				value = random
			}
		}
		localisation_key = alt_start_community_name_egyptian_pagan_reformed
	}
	text = {
		localisation_key = secret_religious_society_REAL_egyptian_pagan_reformed
	}
}

defined_text = {
	name = GetReligiousSocietyDesc_egyptian_pagan
	use_first_valid = yes

	text = {
		trigger = {
			has_alternate_start_parameter = {
				key = religion_names
				value = random
			}
		}
		localisation_key = alt_start_community_desc
	}
	text = {
		localisation_key = secret_religious_society_egyptian_pagan_desc_REAL
	}
}

defined_text = {
	name = GetReligiousSocietyDesc_egyptian_pagan_reformed
	use_first_valid = yes

	text = {
		trigger = {
			has_alternate_start_parameter = {
				key = religion_names
				value = random
			}
		}
		localisation_key = alt_start_community_desc
	}
	text = {
		localisation_key = secret_religious_society_egyptian_pagan_reformed_desc_REAL
	}
}

defined_text = {
	name = GetNewTitleName
	use_first_valid = yes

	text = {
		trigger = {
			event_target:target_title = { has_holder = no }
		}
		localisation_key = NEW_TITLE_DEFINED
	}
	text = {
		trigger = {
			event_target:target_title = { has_holder = yes }
		}
		localisation_key = NEW_TITLE_BASED_ON_CAPITOL_PROVINCE
	}
	fallback_text = {
		localisation_key = NEW_TITLE_BASED_ON_PRIMARY_TITLE
	}
}