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
9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 - -
- - - - - - -

Supporter timezone: Africa/Cairo (GMT+02:00)

This topic contains 5 replies, has 2 voices.

Last updated by Osama Mersal 1 year, 6 months ago.

Assisted by: Osama Mersal.

Author Posts
May 15, 2023 at 2:39 am #13644219

mikeD-5

Tell us what you are trying to do?

I have a theme with two textdomains; I want there to be only one.

Is there any documentation that you are following?

None exists that I can find

Is there a similar example that we can see?

None exists that I can find

What is the link to your site?

n/a

May 15, 2023 at 6:50 am #13644699

Osama Mersal
Supporter

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

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

Hi,

Thanks for contacting WPML forums support. I'll be glad to help you today.

1) If your theme has two text domains, WPML will identify them both, so in order to have one, please edit your theme and use only one text-domain.

If you use a custom theme, please check our guide about making your theme translatable. (https://wpml.org/documentation/support/translating-the-theme-you-created/)

2) Could you please share your Debug information with me?
You can read a detailed explanation about it here. (http://wpml.org/faq/provide-debug-information-faster-support)
The debug info will give me a lot of information about how your site is configured.

Best regards,
Osama

May 15, 2023 at 1:18 pm #13648357

mikeD-5

Yes, I can edit the gettext calls in the theme to use a single text domain. Is that the only thing that is required? Will WPML detect that the textdomain has changed and migrate the already completed translations from the old textdomain to the new one? Or is there another step?

May 15, 2023 at 1:23 pm #13648377

Osama Mersal
Supporter

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

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

Hi,

After editing the text domains, please go to WPML-> Theme and Plugin Localization and scan your theme.

Please note you might need to re-translate the strings after that, so kindly keep a backup before this step and export the translations PO file. (https://wpml.org/documentation/getting-started-guide/string-translation/#import-export-po)

Best regards,
Osama

May 15, 2023 at 1:25 pm #13648379

mikeD-5

OK, so the answer then is "No, there is no way to consolidate textdomains without re-entering all already completed translations."

This seems like a weakness of the system to me, but it is what it is I guess.

May 15, 2023 at 1:32 pm #13648465

Osama Mersal
Supporter

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

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

Hi,

Thanks for your reply. You can export the completed translations before the change and import them to the new text domain.

When WPML scans the theme after the change, it will see new strings in the text domain X, not old strings from text domain Y converted to X.

The best way to make this change is to try it on a staging site first to know the outcome before applying it to your live site.

I hope this helps you. If you need further info, please let me know.

Best regards,
Osama

The topic ‘[Closed] How do I consolidate textdomains within a theme’ is closed to new replies.