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.

Sun Mon Tue Wed Thu Fri Sat
- 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 -
- 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 3 replies, has 2 voices.

Last updated by Long Nguyen 10 months, 3 weeks ago.

Assisted by: Long Nguyen.

Author Posts
June 30, 2024 at 7:59 am #15861624

a.N

Background of the issue:
I'm using 'Auto register strings to translation' option to find strings that I need to translate and can't be found on my plugin by using 'Localization of themes or plugins'. My plugin uses wp_option table to save some values ('ga4acknowledge_text', 'setup_text', 'essential_cookies_text', 'essential_cookies_button_text', 'privacy_url', 'privacy_text', 'terms_url', 'terms_text'), under 'lwp_cookies_settings_options' key. These values are saved on a form (in plugins settings page), and they are written in Portuguese.

Symptoms:
After I found those strings and translated them to English, they work correctly on the frontend. However, if I switch off 'Auto register strings to translation', my strings are not translated anymore and I only see Portuguese strings in the English language.

Questions:
Can I get any help with this issue?
Why do my strings revert to Portuguese when I switch off 'Auto register strings to translation'?

July 1, 2024 at 2:53 am #15864560

Long Nguyen
WPML Supporter since 02/2022

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi there,

Thank you for contacting WPML support, I’m happy to help you with this issue.

I understand that, after disabling the option "Auto register strings to translation", the translation strings are not displayed in the frontend even they are translated in String Translation.

My plugin uses wp_option table to save some values ('ga4acknowledge_text', 'setup_text', 'essential_cookies_text', 'essential_cookies_button_text', 'privacy_url', 'privacy_text', 'terms_url', 'terms_text')

I suggest you follow the documentation below to register strings in the options for translation with custom XML configuration code, re-translate the strings and see if it helps.
https://wpml.org/documentation/support/language-configuration-files/translate-strings-in-wp-options-table/

Looking forward to your reply.
Thanks

July 1, 2024 at 11:32 am #15868172

a.N

I put this on my plugin folder, and I stilll cant see the strings to translate... "lwp_cookies_settings_options" is the option where the strings are saved in wp_options table

<wpml-config>
<admin-texts>
<key name="cookies_settings_options">
<key name="ga4acknowledge_text" />
<key name="setup_text" />
<key name="essential_cookies_text" />
<key name="essential_cookies_button_text" />
<key name="privacy_url" />
<key name="privacy_text" />
<key name="terms_url" />
<key name="terms_text" />
</key>
</admin-texts>
</wpml-config>

July 2, 2024 at 1:23 am #15871178

Long Nguyen
WPML Supporter since 02/2022

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

"lwp_cookies_settings_options" is the option where the strings are saved in wp_options table

You need to add the correct option name to the custom XML configuration code:

<key name="lwp_cookies_settings_options">

the prefix text "lwp_" is missing in your code. If it still doesn't work, please let me know where you setup the text in the admin area and display them in the frontend.
Then I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue. It would be better to have a testing site where the issue is replicated. Your next reply is set to private to share the info.

❌ IMPORTANT: Please backup your database and website before proceeding ❌
You can use this plugin to create the backup: https://wordpress.org/plugins/duplicator/
✙ I would need your permission to de-activate and re-activate Plugins and the Theme to change configurations on the site if needed. This is also a reason the backup is critical.

Looking forward to your reply.
Thanks

The topic ‘[Closed] translating plugin’ is closed to new replies.