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 9 replies, has 2 voices.

Last updated by Itamar 2 months, 3 weeks ago.

Assigned support staff: Itamar.

Author Posts
September 11, 2018 at 4:07 am #2722394

carecweb

I was translating a post with media files associated using the Translation module. Inside the translation editor, I was able to update the title but didn't upload any file.

Looking at the database however, it appears that two media translations where created at the posts table. One is the translation of the original (same trid in icl_translations table), having the translated title but the same url as the source. The other is a duplicate attachment post which does not have an associated url (no _wp_attached_file in postmeta table).

I assume this is because I have both "Translate existing media in all languages" and "Duplicate existing media for translated content" for both existing and new translations. See attached.

My questions then are:

1) Are my assumptions correct?

2) How does the two differ? I assume that "translate existing media" is when you want to reuse the same media to all translated posts, while the other if you want a specific media per language. If that's the case, shouldn't the option be either-or, and not mutually exclusive as is the case now in WPML?

3) I assume these two settings in WPML->Settings->Media Translation are global and the default for all media translations. Can those options be overriden per media since I want some reused for all translations while others (pdfs especially) to have specific versions per translation? Can you set the option in the: 1) post containing the media and 2) inside Media Manager?

4) What is your recommended workflow/settings for existing and new media, to minimize overrides and cleanup of database afterwards?

Thanks

September 12, 2018 at 12:46 pm #2727552

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi.

Thank you for contacting the WPML support forum.

Let me, please explain the following before I reply specifically to each point that you bring (1-4).

The option 'Translate existing media in all languages' will enable you to translate the media's texts like name, caption, alt text, and description for existing media. And the option 'Duplicate existing media for translated content' will show the same media for all language where you have posts that were translated. All this will happen once you press the 'Start' button for already existing media.

The two options 'Duplicate media attachments for translations' and 'Duplicate featured images for translations' under 'How to handle media for new content' will simply determine what will happen when you create a new post and add media to it. Will the media attachments and featured image be automatically duplicated to the translated post. This option is also available in each editing screen of the post in the 'Languages' section. Please see the attached screenshot.

Due to the above are things more clear now?
I ask it because I'm not sure that I understand your points because the options are not the same for existing media and new media.

I look forward to your reply!

Regards,
Itamar.

September 12, 2018 at 11:39 pm #2729224

carecweb

Thanks Itamar. Sorry if I'm not too clear or direct on my questions. Basically I just need to understand how media translation works and how we can use on different scenarios.

Let me just explain how we need to handle the media translations (which I guess is the same problem your other users have).

-------------------------------------------------------------------------

Scenarios:

1) Use the same media (file and properties) on translation

We will do this in cases where we use same files (mostly embedded images/photos) and don't need their properties. Basically use same media we uploaded in English on all translations. In these cases we also prefer to manage the files in WordPress in English.

2) Use same media file but with different translation

We'll do this for images with no embedded text, but we need their translated titles and alt texts on page. Also for certain documents if their translated pdf files are not available (temporarily or permanent) and so we're linking to original English as workaround.

3) Use different file but same properties

Similar to 1), we don't need the media's properties but this time we need a separate file such as when image contains embedded translated text. Even if the titles are not shown on page, we prefer these translated images to retain the original English titles for easier management within WordPress.

4) Use different file and properties

normal case

-------------------------------------------------------------------------

Now given the four scenarios above:

1) What would be the correct settings for "Translate existing media in other languages" and "Duplicate existing media for translated content" IN EACH SCENARIO?

I understand that the first 3 options in Media Translation settings are for existing while the 3 options below are for new posts. This will also answer my original question whether these two are indeed mutually exclusive or not.

2) How will the data appear in the database?

Cases 1) and 4) seems easy to understand, but what about 2) and 3)? Are the relevant "post" table properties (e.g. title, content) simply duplicated in case 3)? What about in case 2)? I hope the plugin will just copy the url location in "postmeta" table, and that we don't have to upload the same file with a different name for the translated post.

-------------------------------------------------------------------------

We appreciate if you can address each scenario and question. Unfortunately your Getting Stared->Media Translation page simply gives basic info and doesn't fully explain the Media Translation's capabilities and options for customization. And so we will be dependent on your detailed explanations and advice to advance.

Thanks Itamar

September 13, 2018 at 7:18 pm #2732789

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi.

When pressing the 'Start' button in WPML -> Settings -> Media Translation, a process will start which will go over all the images and set the selected options for media that is missing in translated content. The process is not reversible. You cannot uncheck the checkboxes and then revert the process. But in WPML Media (WPML -> Media Translation) you can set any of your scenarios for any of the media files. Or do it in the Translation Editor when you translate a post that contains images/media.

Does this answers question number one?

You do not need to upload the same file for scenario number two. This is exactly what WPML does for you.

About question number two I'm also consulting our second tier supporters I'll get back to you here with their answer. I'll also ask them to review your last reply in case that I'm missing something.

If you want to 'play' with the media options and see what's happening in each scenario, I've set up for you a test site in the following link.
hidden link
Through this link, you will be automatically logged in. If nobody logs in for seven days, the test site will not be available anymore.

Regards,
Itamar.

September 16, 2018 at 12:15 pm #2738848

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi there.

Here is my answer that is based on our second tier supporter reply and on more tests that I've conducted according to the questions that you ask.

In all cases, you better have all the options in WPML -> Settings -> Media Translation checked and applied (or run with the 'Start' button). And also have the WPML Media add-on active. The duplication is only being done in the DB, and no file duplication is being done. The duplication that is happening in the DB is happening in the wp_posts table where the media posts (post_type = attachment) will get another record (row) for the duplicated media. The same will happen in the wp_postmeta table, the content will be duplicated, and new records (rows) will be added for the duplicated media. So I hope that this answers to question number 2 in general.

Specifically, you ask: "Are the relevant "post" table properties (e.g. title, content) simply duplicated in case 3)?"

Yes, they will if they exist.

And also you ask: "What about in case 2)? I hope the plugin will just copy the url location in "postmeta" table, and that we don't have to upload the same file with a different name for the translated post."

Yes, as I explained, you are correct.

But you also mention the following: "We'll do this for images with no embedded text, but we need their translated titles and alt texts on page."

If there are no properties (caption, alt, description) for the media in the originally uploaded media, you cannot translate it. In other words, there is no translation option if there is nothing in the source.

I hope that all the above clarifications help you understand what you need to do and explain the media duplication issue. Please let me know if you have any more questions about this issue.

Best Regards,
Itamar.

September 18, 2018 at 12:33 am #2742835

carecweb

Thanks again Itamar. Appreciate you coordinating with your tech support to resolve my questions.

I am currently test-running WPML for our site and looking at several different areas which are not yet clear. Please give me time to digest your responses and test them on my end. I'll get back to you soon so please keep this ticket open in the meantime.

Thanks!

September 18, 2018 at 4:17 pm #2745891

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Ok, no problem.

To keep this ticket open, please reply here in one week if you still need time to test things.

Regards,
Itamar.

September 26, 2018 at 9:38 am #2766652

carecweb

Still need to test so my reply to keep ticket open. Thanks

September 26, 2018 at 9:48 am #2766688

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Ok, no problem.

I've now changed the status of this ticket in a way that it will not be closed.
Take your time and reply here once you have tested this.

Best Regards,
Itamar.

July 21, 2019 at 3:19 pm #4252665

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi.

I'm closing here since there was no reply from you in a long time. If you still need help with this issue, then please open a new ticket in our support forum, and we'll be happy to assist.

Best Regards,
Itamar.