<?xml version="1.0" encoding="UTF-8"?>
<!--
	WPML configuration for Hotel Booking for WooCommerce.

	Declares only the custom types, taxonomies, custom fields and option keys
	that this plugin actually registers. Everything here was verified against
	the plugin source:
	  - booking_addon  : register_post_type() in includes/class-custom-post-types.php
	  - rate_plan      : register_taxonomy()   in includes/class-custom-taxonomies.php
	  - amenities      : register_taxonomy()   in includes/class-custom-taxonomies.php
	  - unit           : booking-addon post meta written by class-booking-addon-metabox.php
	  - features       : rate_plan term meta written by class-admin-rate-plans.php
	  - option keys    : WC settings pages / custom WC_Email classes

	WooCommerce core objects (the `product` post type, `product_cat`, etc.) are
	deliberately NOT declared here - WooCommerce Multilingual owns those.
-->
<wpml-config>

	<!--
		Booking add-ons are shown to guests on the booking form, so their titles
		translate. display-as-translated keeps an add-on visible in every
		language even before it has been translated: WPML then serves the
		translation where one exists and the original where it does not.
		Without it, any untranslated add-on silently disappears from the
		booking form in the other languages.
	-->
	<custom-types>
		<custom-type translate="1" display-as-translated="1">booking_addon</custom-type>
	</custom-types>

	<!--
		Rate plan and amenity names/descriptions are guest-facing. Same
		display-as-translated reasoning as add-ons: an untranslated rate plan or
		amenity must still be listed, otherwise rooms lose rates in the
		languages where the term was not translated yet.
	-->
	<taxonomies>
		<taxonomy translate="1" display-as-translated="1">rate_plan</taxonomy>
		<taxonomy translate="1" display-as-translated="1">amenities</taxonomy>
	</taxonomies>

	<!--
		Guest-visible booking add-on text:
		  - unit        : quantity label (e.g. set, pax, portion)
		  - description : short add-on description shown on the booking form
		Price, min, max, sub_type, required, active, priority, room_ids and
		_addon_type stay untranslated: they are numeric or machine values that
		must stay identical in every language.
	-->
	<custom-fields>
		<!-- Guest-facing text: translatable. -->
		<custom-field action="translate">unit</custom-field>
		<custom-field action="translate">description</custom-field>
		<custom-field action="translate">_no_of_beds</custom-field>
		<custom-field action="translate">_room_size</custom-field>

		<!--
			Booking configuration. These MUST be copied into every translation,
			not translated and not ignored: rates, allotment and occupancy drive
			price and availability, so a translated room that is missing them
			cannot be booked at all.
		-->
		<custom-field action="copy">_allotment</custom-field>
		<custom-field action="copy">_min_stay</custom-field>
		<custom-field action="copy">_max_adults</custom-field>
		<custom-field action="copy">_max_children</custom-field>
		<custom-field action="copy">_hbfwc_rate_plans</custom-field>
		<custom-field action="copy">_default_rate_prices</custom-field>
	</custom-fields>

	<!-- Rate plan feature bullets (e.g. "Non-refundable, Without Breakfast"). -->
	<custom-term-fields>
		<custom-term-field action="translate">features</custom-term-field>
	</custom-term-fields>

	<!--
		Option-stored, guest-facing text. These live in serialized options, so
		gettext alone cannot reach them; declaring them here lists them under
		WPML > String Translation and makes them translatable per language.
	-->
	<admin-texts>

		<!-- Main plugin settings (WC settings page id "hbfwc"). -->
		<key name="woocommerce_hbfwc_settings">
			<key name="addtocart_label"/>
			<key name="partial_payment_due_moment"/>
			<key name="security_bond_label"/>
			<key name="security_bond_notice"/>
			<key name="invoice_business_name"/>
			<key name="invoice_business_address"/>
		</key>

		<!-- Custom booking emails: WC_Email option keys (subject/heading/body text). -->
		<key name="woocommerce_hbfwc_new_booking_settings">
			<key name="subject"/>
			<key name="heading"/>
			<key name="additional_content"/>
			<key name="intro_content"/>
		</key>
		<key name="woocommerce_hbfwc_customer_processing_booking_settings">
			<key name="subject"/>
			<key name="heading"/>
			<key name="additional_content"/>
			<key name="intro_content"/>
		</key>
		<key name="woocommerce_hbfwc_customer_pending_booking_settings">
			<key name="subject"/>
			<key name="heading"/>
			<key name="additional_content"/>
			<key name="intro_content"/>
		</key>
		<key name="woocommerce_hbfwc_customer_on_hold_booking_settings">
			<key name="subject"/>
			<key name="heading"/>
			<key name="additional_content"/>
			<key name="intro_content"/>
		</key>
		<key name="woocommerce_hbfwc_customer_completed_booking_settings">
			<key name="subject"/>
			<key name="heading"/>
			<key name="additional_content"/>
			<key name="intro_content"/>
		</key>
		<key name="woocommerce_hbfwc_customer_cancelled_booking_settings">
			<key name="subject"/>
			<key name="heading"/>
			<key name="additional_content"/>
			<key name="intro_content"/>
		</key>
		<key name="woocommerce_hbfwc_customer_refunded_booking_settings">
			<key name="subject"/>
			<key name="heading"/>
			<key name="additional_content"/>
			<key name="intro_content"/>
		</key>
		<key name="woocommerce_hbfwc_customer_failed_booking_settings">
			<key name="subject"/>
			<key name="heading"/>
			<key name="additional_content"/>
			<key name="intro_content"/>
		</key>
		<key name="woocommerce_hbfwc_cancelled_booking_settings">
			<key name="subject"/>
			<key name="heading"/>
			<key name="additional_content"/>
			<key name="intro_content"/>
		</key>
		<key name="woocommerce_hbfwc_failed_booking_settings">
			<key name="subject"/>
			<key name="heading"/>
			<key name="additional_content"/>
			<key name="intro_content"/>
		</key>

	</admin-texts>

</wpml-config>
