Please make sure to update to WPML 4.3.5 and check our list of Known Issues before reporting

Hi, Amit here, I am the WPML Support Manager, our current ticket queue is high, update your WPML plugins and make sure you meet the minimal requirements for running WPML before reporting an issue please - many tickets are resolved doing that

Please look at our updated list of Known Issues and you can also use our support search to find helpful information and of course review our documentation before opening a ticket.

If you do need to open a ticket please make sure to provide us with all the needed information as described in this page

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 10 replies, has 2 voices.

Last updated by Marcel 2 weeks, 3 days ago.

Assigned support staff: Marcel.

Author Posts
November 12, 2019 at 10:07 am #4930321

willem-heinC

Hi Support,
I'm building a site for Accommodation rental. We use Motopress Hotel booking and WPML for translation. I have 2 fields which repeat every time for the 58 accommodations: Bed type (about 10 options) and Pets ( 2 options) These are custom fileds in The Moto press plugin. I'm trying to automatically translate English to Dutch I tried with string translation but I cannot find it. I tried with AFC but I guess I need a little help there if that is the correct tool to use.

Is there any documentation that you are following?
WPML - Motopress
hidden link

Is there a similar example that we can see?
Well things like categories en tags can have a standard translation.

What is the link to your site?
hidden link

Thanks Willem-Hein

November 13, 2019 at 9:58 am #4937095

Marcel
Supporter

Languages: English (English ) German (Deutsch )

Timezone: Europe/Madrid (GMT+01:00)

Hi Willem-Hein,

Thank you for contacting WPML Support.

WPML has a build-in function to make Strings from The Backend appearing in the String Translation table. Please follow this guide https://wpml.org/documentation/support/language-configuration-files/#admin-texts search & mark the checkbox on the left site, then you can translate the content using our WPML String Translation plugin, which you have already installed.

Best Marcel

November 14, 2019 at 5:54 pm #4949333

willem-heinC

Hi Marcel,
Thanks for your answer. I have added the two fields in the in the wpml-config.xml in the root of the motopress hotel booking plugin.

like this under the <admin-texts>
<key>
<key name="mphb_pets">
<key name="Pets at request"/>
<key name="Sorry, no pets"/>
</key>
However I cannot find it back in String translation. What setting should this custom field have, translate, copy once, do not translate? Als this field is not mentioned in the Wp-options tabel, can I just add it?

I'm new to this, do you think you can help me with some more explanation? I'm not sure what the next step would be.
Thanks
Willem-Hein

November 15, 2019 at 8:57 am #4952051

Marcel
Supporter

Languages: English (English ) German (Deutsch )

Timezone: Europe/Madrid (GMT+01:00)

Hi Willem-Hein,

this is not a valid XML, as the config only include the shortcode/textdomain, not your site content itself.

Please use the following. This will register all Admin Strings from Motopress Plugin:

<admin-texts>
  <key name="motopress">
    <key name="*"/>
  </key>
</admin-texts>

Best Marcel

November 15, 2019 at 2:17 pm #4954731

willem-heinC

Hi Marcel,
I added it in the wpml-config in root of Motopress. No strings visible yet: This is how the file looks there was already a lot o Moto press stuff in the existing file:

<wpml-config>
    <custom-types>
        <custom-type translate="0">mphb_booking</custom-type>
        <custom-type translate="1">mphb_room_type</custom-type>
        <custom-type translate="1">mphb_room_attribute</custom-type>
        <custom-type translate="0">mphb_season</custom-type>
        <custom-type translate="1">mphb_rate</custom-type>
        <custom-type translate="1">mphb_room_service</custom-type>
        <custom-type translate="0">mphb_room</custom-type>
        <custom-type translate="0">mphb_payment</custom-type>
        <custom-type translate="0">mphb_reserved_room</custom-type>
        <custom-type translate="0">mphb_coupon</custom-type>
    </custom-types>
    <taxonomies>
        <taxonomy translate="1">mphb_room_type_category</taxonomy>
        <taxonomy translate="1">mphb_room_type_tag</taxonomy>
        <taxonomy translate="1">mphb_room_type_facility</taxonomy>
    </taxonomies>
    <custom-fields>
        <!-- Services -->
        <custom-field action="copy">mphb_price</custom-field>
        <custom-field action="copy">mphb_price_periodicity</custom-field>
        <custom-field action="copy">mphb_min_quantity</custom-field>
        <custom-field action="copy">mphb_is_auto_limit</custom-field>
        <custom-field action="copy">mphb_max_quantity</custom-field>
        <custom-field action="copy">mphb_price_quantity</custom-field>
        <custom-field action="translate">mphb_description</custom-field>
        <!-- Accommodation Types -->
        <custom-field action="copy">mphb_adults_capacity</custom-field>
        <custom-field action="copy">mphb_children_capacity</custom-field>
        <custom-field action="copy">mphb_size</custom-field>
        <custom-field action="translate">mphb_view</custom-field>
        <custom-field action="translate">mphb_bed</custom-field>   
		<custom-field action="translate">mphb_thingstodo</custom-field>
		<custom-field action="translate">mphb_latitude</custom-field>
		<custom-field action="translate">mphb_longitude</custom-field>
        <custom-field action="copy">mphb_gallery</custom-field>
        <custom-field action="copy">mphb_services</custom-field>
        <!-- Rates -->
        <custom-field action="copy">mphb_room_type_id</custom-field>
        <custom-field action="copy">mphb_season_prices</custom-field>
        <!-- Attributes -->
        <custom-field action="copy">mphb_public</custom-field>
        <custom-field action="copy">mphb_visible</custom-field>
        <custom-field action="copy">mphb_orderby</custom-field>
    </custom-fields>
    <admin-texts>
        <!-- MPHB\Settings\MainSettings -->
        <key name="mphb_children_age"/>
        <key name="mphb_checkout_text"/>
        <key name="mphb_disabled_booking_text"/>
        <!-- MPHB\Emails\AbstractEmail -->
        <key name="mphb_email_admin_pending_booking_subject"/>
        <key name="mphb_email_admin_pending_booking_header"/>
        <key name="mphb_email_admin_pending_booking_content"/>
        <key name="mphb_email_admin_customer_confirmed_booking_subject"/>
        <key name="mphb_email_admin_customer_confirmed_booking_header"/>
        <key name="mphb_email_admin_customer_confirmed_booking_content"/>
        <key name="mphb_email_admin_customer_cancelled_booking_subject"/>
        <key name="mphb_email_admin_customer_cancelled_booking_header"/>
        <key name="mphb_email_admin_customer_cancelled_booking_content"/>
        <key name="mphb_email_admin_payment_confirmed_booking_subject"/>
        <key name="mphb_email_admin_payment_confirmed_booking_header"/>
        <key name="mphb_email_admin_payment_confirmed_booking_content"/>
        <key name="mphb_email_customer_cancelled_booking_subject"/>
        <key name="mphb_email_customer_cancelled_booking_header"/>
        <key name="mphb_email_customer_cancelled_booking_content"/>
        <key name="mphb_email_customer_pending_booking_subject"/>
        <key name="mphb_email_customer_pending_booking_header"/>
        <key name="mphb_email_customer_pending_booking_content"/>
        <key name="mphb_email_customer_confirmation_booking_subject"/>
        <key name="mphb_email_customer_confirmation_booking_header"/>
        <key name="mphb_email_customer_confirmation_booking_content"/>
        <key name="mphb_email_customer_approved_booking_subject"/>
        <key name="mphb_email_customer_approved_booking_header"/>
        <key name="mphb_email_customer_approved_booking_content"/>
        <!-- MPHB\Settings\EmailSettings -->
        <key name="mphb_email_footer_text"/>
        <key name="mphb_email_from_name"/>
        <key name="mphb_email_reserved_room_details"/>
        <key name="mphb_email_cancellation_details"/>
        <!-- MPHB\Payments\Gateways\Gateway -->
        <key name="mphb_payment_gateway_test_title"/>
        <key name="mphb_payment_gateway_test_description"/>
        <key name="mphb_payment_gateway_cash_title"/>
        <key name="mphb_payment_gateway_cash_description"/>
        <key name="mphb_payment_gateway_2checkout_title"/>
        <key name="mphb_payment_gateway_2checkout_description"/>
        <key name="mphb_payment_gateway_paypal_title"/>
        <key name="mphb_payment_gateway_paypal_description"/>
        <key name="mphb_payment_gateway_stripe_title"/>
        <key name="mphb_payment_gateway_stripe_description"/>
        <key name="mphb_payment_gateway_braintree_title"/>
        <key name="mphb_payment_gateway_braintree_description"/>
        <key name="mphb_payment_gateway_beanstream_title"/>
        <key name="mphb_payment_gateway_beanstream_description"/>
        <!-- Fees & Taxes -->
        <key name="mphb_fees">
            <key name="*">
                <key name="label"/>
            </key>
        </key>
        <key name="mphb_accommodation_taxes">
            <key name="*">
                <key name="label"/>
            </key>
        </key>
        <key name="mphb_service_taxes">
            <key name="*">
                <key name="label"/>
            </key>
        </key>
        <key name="mphb_fee_taxes">
            <key name="*">
                <key name="label"/>
            </key>
        </key>
			<key name="motopress">
				<key name="*"/>
  			</key>
    </admin-texts>
</wpml-config>
November 15, 2019 at 2:26 pm #4954767

Marcel
Supporter

Languages: English (English ) German (Deutsch )

Timezone: Europe/Madrid (GMT+01:00)

Please add my example to WPML -> Settings -> in the Tab "Custom XML config".

See: https://wpml.org/documentation/support/language-configuration-files/#using-wpml-language-configuration-file-with-child-themes

If you need help, please let me know, then I can activate a private message for site credentials.

Best Marcel

November 16, 2019 at 10:26 am #4957983

willem-heinC

Thanks again marcel, I think I need help. I get this message:

The XML is not valid:
Element 'admin-texts': No matching global declaration available for the validation root.
Thanks
Willem-Hein

November 18, 2019 at 1:56 pm #4965691

Marcel
Supporter

Languages: English (English ) German (Deutsch )

Timezone: Europe/Madrid (GMT+01:00)

Sure, no problem. The next message is marked as private.

Best Marcel

November 19, 2019 at 11:51 am #4971595

Marcel
Supporter

Languages: English (English ) German (Deutsch )

Timezone: Europe/Madrid (GMT+01:00)

Hi,

I added now the following config. You will find now all Strings inside String translation table:

<wpml-config>
    <admin-texts>
        <key name="motopress">
            <key name="*"/></key>
        <key name="mphb_registered_attributes">
            <key name="*"/></key>
        <key name="widget_mphb_rooms_widget">
            <key name="*"/></key>
        <key name="mphb_bed_types">
            <key name="*"/></key>
    </admin-texts>
</wpml-config>

The "Pets at request" text was saved as "Copy once". I mad it also translatable with the option "Translate".

Could you please check now all again?

Best Marcel

November 20, 2019 at 12:14 pm #4979833

willem-heinC

Hi Marcel,

Thanks for your work, the bed types are translated, I can translate the Pet types per accommodation now, I would have hoped I could do it in one time via String translation.
Thanks,
Willem-Hein

November 20, 2019 at 1:27 pm #4980689

Marcel
Supporter

Languages: English (English ) German (Deutsch )

Timezone: Europe/Madrid (GMT+01:00)

Hi Willem-Hein, yes sometimes the plugins use different keys work it, depending on the author 🙂

Best Marcel