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

Last updated by benjaminO-5 1 year ago.

Assigned support staff: Bruno.

Author Posts
May 14, 2019 at 5:49 pm #3809717


I am trying to: Translate strings in my theme to Chinese

Link to a page where the issue can be seen: Local development site - screenshots included

I expected to see: The page should look exactly as it does in any other language, except in a different language. All of the page content should be there.

Instead, I got: Weird chunks of the site are missing in Chinese.

Everything works fine if I translate the site into Spanish, but when I translate into Chinese, some of the site just disappears. There are no errors in the error log. If I disable WPML and use .mo files to translate strings, then everything functions as expected. I suspect that there are character encoding problems since this is happening only with Chinese.

I'm including screenshots of the header. In English, everything that is supposed to be in the header is there - you can see the search icon. In Chinese, the search icon is missing. If you view the source for the page, there are chunks of HTML that just aren't there - none of the translated strings show up in the source, and some of the HTML surrounding those strings is also missing.

May 14, 2019 at 10:40 pm #3810977


Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Thank you for contacting us. Have you tried setting up a new website using your Chinese theme (as the native language) to see if these options will be displayed correctly even without WPML installed?

Also, some themes allow individual setting by language. Some themes allow configuration to be done using the top language selector on the theme options pages.

Have you checked to see if there are any options to view these features and whether they are enabled in the Chinese language (by accessing the options page of your theme and using the top bar, switching to Chinese)?

Thank you.

May 15, 2019 at 12:42 am #3811213


Yes, I have tried doing this without WPML: if I use .mo files and don't activate WPML, the theme works just fine. When I activate WPML, chunks of the site disappear.

This is all happening completely independently of theme settings/options. This is a theme my team has written, and when we use it on a multi-lingual site, we do create separate settings pages for each language, but for this problem, I'm talking about the strings that are in the PHP files of the theme, not the theme settings.

May 15, 2019 at 12:49 am #3811221


Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

>>> This is all happening completely independently of theme settings/options.

From what I understand, it looks like the option mentioned in your screenshots (the search icon) might be tied to your theme options.

How is this option is added to your site? Are you adding this search icon directly inside PHP files? If so, could you post the snippet of code so I can see?

May 16, 2019 at 4:58 pm #3828201


Hi, Bruno,

It turns out, you are correct that this is a theme settings issue. But what makes it really weird is that the theme settings automatically carried over from English to Spanish, but not from English to Chinese. I suspect that this is actually a problem with ACF, not WPML. In any case, I believe things are working as expected for now. Thanks for your help!