We are currently on vacation until 21st July 2025, ticket responses maybe be longer than normal during this period, sorry for any inconvenience.

WPML

Closed

Import WP Pro Updated 10 months ago 14 Replies

Evelien asked 11 months ago on September 12, 2024 at 9:10 am

Hi,

Do you have any experience or advise about WPML support. If I want to import a post type how it can be duplicated for WPML?

With thanks,
Demian

J

James replied Support Agent

11 months ago on September 12, 2024 at 8:44 pm

Hi Demian,

I have just published a quick guide on how to import data into WPML: https://www.importwp.com/docs/import-wpml-translations-from-csv-xml/

You will need to have the importwp-wpml plugin activated which i have attached: https://github.com/importwp/importwp-wpml , this plugin works with post types however there are still some issues with woocommerce product and attributes which i need to fix before this is available on the website: https://www.importwp.com/integrations/import-wpml-translations/

If you need any more help just let me know

James

GK

Geert replied

11 months ago on September 13, 2024 at 9:22 am

Not my ticket, but thank you for the solution. As I need the same :-)

ET

Evelien replied privately

10 months ago on September 26, 2024 at 3:39 pm

J

James replied Support Agent

10 months ago on September 27, 2024 at 2:09 pm

Hi,

If you set the remote url to: https://sitelink.kolibri24.com/v2/94865E5B-3C6C-4EE0-8A6A-CA9D83ADA852/zip and select XML , this should be downloaded and previewed in the file settings tab.

James

ET

Evelien replied

10 months ago on October 2, 2024 at 8:02 am

Unfortunately it's not able to read the details, it gives this error, see screenshot. Config Index Not FoundAnd these files it created, screenshot: /wp-content/uploads/importwp/.Debug doesn't give any logged errors.I have tried to map the import, but it imports one XML file.
ET

Evelien replied

10 months ago on October 2, 2024 at 2:28 pm

Hi James,

I will move the ZIP issue to a new ticket, as I want to come back to the initial ticket about WPML.

I have tried to import it with XML, but it's not generating a WPML copy of the post:

- I have enabled the custom post type to be translatable

- I have used the Name as the connected translatable item. I assume this is meant th Title of the post?

See here this screenshot: https://snipboard.io/go8i75.jpg

The default imported language is NL and the WPML translation is English (here chosen from a dropdown).

Please let me know if there is any error from my side.

J

James replied Support Agent

10 months ago on October 3, 2024 at 7:54 pm

Hi Eveilien,

Are you able to attach the xml file, and also export and attach your importer settings to this ticket by going to Tools > Import WP > Settings / Tools > Import / Export and select and export your importer as a JSON file.

James

ET

Evelien replied privately

10 months ago on October 4, 2024 at 8:43 am

J

James replied Support Agent

10 months ago on October 4, 2024 at 10:12 am

Hi Demian,

Based on the xml file it looks like the translations are combined within each record, and some times like the title is not translated so i have had to create a custom function to check if a translation string exists if not it uses the default.

if (!function_exists('iwp_ifelse')) {
    function iwp_ifelse($a = '', $b = '')
    {
        $a = trim($a);
        $b = trim($b);
        return !empty($a) ? $a : $b;
    }
}

I have attached an importer export that contains 2 importers, Kolibri NL - Step 1 contains the nl-NL translation, and Kolibri EN - Step 2 that contains the en-GB translation, both these importers have been reduced to title and images to be examples of how to connect translations (Step1 should be imported before step 2).

Step 2 connects the en-GB translation, by using the slug, and the en-GB translation slug is suffixed with -en, and the WPML translation field type is set to slug, and the translation field should reference the nl-NL translation slug (does not have the -en suffix), i had to use the slug as i could not find anything in the xml file to be used as a reference for each language.

James

ET

Evelien replied privately

10 months ago on October 4, 2024 at 12:07 pm

J

James replied Support Agent

10 months ago on October 4, 2024 at 12:24 pm

Did the example importer that i sent over work?

ET

Evelien replied

10 months ago on October 4, 2024 at 12:49 pm

Yes, but not the one with cstom fields attached. Please check.

J

James replied privately Support Agent

10 months ago on October 4, 2024 at 1:04 pm

ET

Evelien replied

10 months ago on October 4, 2024 at 1:52 pm

I cannot see your private reply here, but I can see it in my mailbox.

Okay great, I see you made the initial slug different. I thought it was within the WPML section. Thank you!