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: America/Lima (GMT-05:00)

This topic contains 5 replies, has 2 voices.

Last updated by Andreas W. 5 months, 4 weeks ago.

Assisted by: Andreas W..

Author Posts
June 4, 2024 at 10:19 pm #15704476

brianH-21

Hello,

I have an issue on a website, which is part of a bigger multisite project in WordPress.

I have hardcoded strings which I translate with the String Translation plugin, but it doesn't echo the correct language, still shows me the default language.
If I enable * Look for strings while pages are rendered*, it shows me the translated strings, but only for 2h and I dont like this approach.

So far I tried:
1. Show custom MO Files Pre-generation dialog box
2. Increase memory Limit 512MB
3. Plugin is up to date
4. I did check file permissions in language folder they are 755

I did a workaround as a test and it works if I do it with if statment and ICL language.

Screenshot 2024-06-05 001759.png
Screenshot 2024-06-05 001051.png
June 4, 2024 at 11:32 pm #15704538

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

I would not suggest mixing up different languages this way in your theme's files.

Usually, the approach would be to register the French string and then translate this string into German with WPML > String Translation.

Do not use any conditional statement, only echo the French string and register it for translation. Then translate it with String Translation.

Could you please give this a try?

Bets regards
Andreas

June 5, 2024 at 6:06 am #15704903

brianH-21

As I mentioned in my ticket I don't want to do that. (I just did that as a temporary fix)

I do register the strings in WPML, and I do translate them.
But they dont show on frontend on French language as translated (German is my main),
unless I enable * Look for strings while pages are rendered*, then strings are shown as translated.

June 5, 2024 at 2:27 pm #15707501

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

I would like to offer to have a closer look at the problem and request temporary access (wp-admin and FTP) to the website to investigate this issue further.

You can find the required fields below the comment section when you log in to leave the next reply. The information you provide is private, which means only you and I can see and access it.

IMPORTANT
Please be sure to make a backup copy of the website and database before allowing us access.
If you can't see the wp-admin / FTP fields, your post and website credentials are set as PUBLIC. DO NOT publish the data unless you see the required wp-admin / FTP fields.

The private response form looks like this:
hidden link

Next time you reply, click "I still need assistance."

Video:
hidden link

Please note that we are obliged to request this information individually on each ticket. We may not access any access information not specifically submitted on this ticket in the private response form.

Best regards
Andreas

June 5, 2024 at 9:39 pm #15708900

brianH-21

Unfortunately for now I cant give you access to the site, because its a live site and it's for a client, Ill request this and send it privately.

Meanwhile while I get access, can you point out for some things that I can take a look for ?

It is a custom theme BTW.

June 5, 2024 at 9:54 pm #15708924

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

I suggest you register only the French string including a text domain and translate it with String Translation.

If this does not solve the issue, I suggest that you install the custom theme on the following test site and I will take a closer look into the issue:

One-Click-Login:
hidden link

This test site does not provide server access, but you can use the File Manager Plugin.

Please leave me a quick comment on this ticket once the theme is installed.

The topic ‘[Closed] String Translation doesnt echo custom strings on translated languages.’ is closed to new replies.