Skip Navigation

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 17 replies, has 3 voices.

Last updated by seemaD 1 month ago.

Assisted by: Ahmed Mamdouh.

Author Posts
October 18, 2024 at 2:24 pm #16305214

seemaD

Background of the issue:
I want to know whether there is any hook available that can modify the target language code (for example, zh-hans to zh-cn) runtime after clicking on the "Send all items for translation" button but before sending for translation. The site I need help with is hidden link.

Symptoms:
No specific issue or error message mentioned.

Questions:
Is there a hook available in WPML to modify the target language code at runtime when after clicking on the "Send all items for translation" button but before sending items for translation? I'm trying to use the hook like 'wpml_tm_batch_factory_elements', but not sure whether it will work or not.

October 18, 2024 at 7:07 pm #16306140

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Hi there,

To better assist you, please share with me the desired end result you are hoping to achieve with the hook?

Our WPML hooks reference lists all available Hooks provided by WPML.

October 19, 2024 at 4:06 pm #16307404

seemaD

Hi Bobby, Please check the below details,

In my website, I want to use a URL like hidden link (for example), where "zh-tw" denotes the language code of "Chinese Taiwan" (here it is a custom language). Now, WPML offers "zh-hant" as the "Chinese (Traditional)" to be used, but at the same time it also offers to create custom language. So, I've created a custom language "Chinese Taiwan" where language code and default locale is "zh-tw" and "zh_TW" respectively, and before did it I've only renamed default locale of "Chinese (Traditional)" to "zh_TWW".

While I'm sending a post for translation to "Chinese Taiwan", it is not working, but if I removed the "Chinese Taiwan", added "Chinese (Traditional)" and sent it for translation, then it is working.

Now, my goal is to use "Chinese Taiwan" instead of "Chinese (Traditional)" and behind the scenes the target language code will be changed from "zh-tw" to "zh-hant" after clicking on the "Send all items for translation" button but before sending it for translation, so that it will work (as mentioned above).

Thank you.

October 21, 2024 at 5:31 pm #16313891

seemaD

Can someone please help me? It's taking too much time to get assistance from your end, which is not expected. I know there was a weekend, but today is Monday and your office hour has already started.

Request: Please assign someone from your team who is in Asia timezone that would be helpful.

October 21, 2024 at 8:54 pm #16314434

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Hi there,

Please note that our team is offline during the weekend, and we address tickets in the order they are received. I hope this clarifies the response time.

I'll attempt to find a supporter who is more closely aligned with your timezone to assist you better. In the meantime, please review the following:

1. Go to WPML->lanugages->edit languages
2. Change the default language for Chinese Traditional to zh_TWW and update
3. Add a new language -> add the code to zh-tw, and default locale to zh_TW
4. Map it to Chinese Traditional and save
5. Go to WPML->Translation Management->Tools->Language Mappings-> verify it';s mapped there to CN Traditional as well

Once done you will be able to translate automatically with Microsoft's engine

The language needs to be mapped because the engines do not recognize the language code zh-tw instead they are looking for zh-hant, it is not based on the default locale.

Sandbox created for reference:
hidden link

October 22, 2024 at 4:37 am #16314900

seemaD

Thanks for your help, Bobby. I already did the above practices, but still I'm getting "Rollback jobs".

SS-2.png
image (25).png
October 22, 2024 at 6:55 am #16315235

seemaD

As we are using Smartling, so could you please add this as a translator?

October 22, 2024 at 2:57 pm #16318239

seemaD

Hi, Bobby. It is difficult for me to discuss the issue, seek assistance from you, and report back to you on the outcome because we are in different timezones. So, in order to speed up this process (back and forth), I would request you to please assign someone from the Asia time zone.

Thank you!

October 22, 2024 at 7:06 pm #16319148

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Hi there,

You are using a translation service, this is different.

We need to map this connection from our side.

This ticket will be assigned to our Translation Services team.

Once there is feedback you will be updated here.

October 23, 2024 at 6:09 am #16319956

seemaD

Thanks for the update, Bobby. Please let me know, as we're facing this issue at one of our production sites.

October 23, 2024 at 8:19 am #16320549

Ahmed Mamdouh
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hello,

This is Ahmed Mamdouh from the translation proxy team and I'll help you with this issue.

First, I want to express my sincere apologies for the inconvenience you are facing and I promise I'll solve this issue as fast as possible.

I'll do the needed mapping for you, but I need you to provide me with 2 things to solve this issue:

1- Project ID: Go to WPML -> Support -> Troubleshooting and press "Ctrl + f" and type "icl_translation_projects" and send me a screenshot.

2- A screenshot from the languages page: Go to WPML -> Languages -> Edit Languages and send me a screenshot of this page to see the codes configured in the website and make the right mapping for your project.

Thanks for your understanding and cooperation,
Ahmed Mamdouh.

October 23, 2024 at 9:02 am #16320813

seemaD

Hi, Ahmed

Please find attached screenshots you've asked for.

Thank You.

screenshot-2.png
screenshot-1.png
October 23, 2024 at 9:23 am #16320924

Ahmed Mamdouh
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hello,

I added the needed mapping from zh-tw to zh-hant to your project, please try to resend the jobs again and let me know how it goes.

Best regards,
Ahmed Mamdouh.

October 23, 2024 at 10:13 am #16321213

seemaD

Hi,

It is working now. Thanks for your help, but we need to map this on our production site as well. So let me know if you need the same details for our production site as well or if something else is needed. Also, please make sure this conversation is private, as we are going to share our production details.

October 23, 2024 at 11:25 am #16321459

Ahmed Mamdouh
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hello,

No need to provide me with the production site details, I already added the needed mapping to your production site.

Please test it by sending the jobs from the production site and let me know how it goes.

Best regards,
Ahmed Mamdouh.