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.

WordPress 6.7 has introduced a new issue that impact translations, please update WooCommerce and WPML to the latest versions before you report issues. More about this here - https://wpml.org/errata/php-error-wp-6-7-notice-function-_load_textdomain_just_in_time-was-called/
Sun Mon Tue Wed Thu Fri Sat
- 8:00 – 13:00 9:00 – 13:00 9:00 – 13:00 8:00 – 12:00 8:00 – 12:00 -
- 14:00 – 17:00 14:00 – 18:00 14:00 – 18:00 13:00 – 17:00 13:00 – 17:00 -

Supporter timezone: Europe/Zagreb (GMT+01:00)

Tagged: 

This topic contains 25 replies, has 2 voices.

Last updated by Bruno Kos 7 months, 3 weeks ago.

Assisted by: Bruno Kos.

Author Posts
March 26, 2024 at 10:25 am #15450469

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+01:00)

Escalated to 2nd Tier

March 27, 2024 at 5:16 pm #15457596

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+01:00)

We found that the issue happens when acf/settings/load_json is defined.

Can you please try the following:

1. Locate the file `global.php` in the directory `web\app\themes\gital-theme\functions`.
2. Comment out the following code on line 94 by adding `//` at the beginning of the line:

// add_filter( 'acf/settings/load_json', 'gital_theme\acf_load_directory' );

3. Confirm if the expected results are achieved after this change.

March 28, 2024 at 7:07 am #15458849

gustavG-2

Wonderfull! It works now.

Thank you very much for your great support!

Best regards

March 28, 2024 at 12:01 pm #15460346

gustavG-2

I'm sorry to say that I still seem to have problems with the blocks that I use on pages.

I have commented out the code you wrote about in global.php.
When I log in as a Swedish user, I go to a page and add a new block, for example, coworkers. It is in English (The block is originally written in Swedish and then translated into English using string translation).
When I then go back to my code in global.php and uncomment what was previously commented out, and then reload the page, I, of course, get it in Swedish as it was originally, and then when I comment it out again, it displays correctly in Swedish.

But if I want to add a new block, it doesn't work. It will then be in English.

March 28, 2024 at 1:29 pm #15460865

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+01:00)

Can you show us this on hidden link and record a video using tool such as hidden link, so a scenario which happens after you revert the code thing?

March 28, 2024 at 3:59 pm #15461639

gustavG-2

hidden link
Here you have 2 videos.

Everyting works fine if you just not add new blocks to the page. In company information the block works perfect.

March 29, 2024 at 7:52 am #15463264

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+01:00)

Escalated to 2nd Tier

April 2, 2024 at 9:01 am #15471555

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+01:00)

About this:

"Option page string": This feature ensures that the language displayed on the option page is taken directly from the user's profile, rather than relying solely on the default behavior of WPML in WordPress.

"Blocks in editor": With this feature, the language displayed in the editor is determined by the language of the page itself, rather than relying solely on the default WP behavior through WPML.

Additionally, when certain code sections are commented out, it allows WPML to function seamlessly. In such cases, the translation of the page string defaults to English.

Can you clarify a bit more what is expected here and whether this is the same issue as with Options page?

April 3, 2024 at 12:40 pm #15478440

gustavG-2

The option page works as expected.

The page that contains Gutenberg blocks do not work as expected. When a new block is created its field labels are in the language that the page is, not the language that the user is. The labels of the ACF fields is expected to follow the users language and not the current page language.

April 4, 2024 at 7:00 am #15481118

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+01:00)

We don't think that would be a proper way for the language display. Let's say you are creating a page in Spanish, while the user profile language is English. The content should be entered in Spanish, not in English.

April 4, 2024 at 8:28 am #15481596

gustavG-2

Yes, the content should be entered in Spanish, but the block title and labels, I think, should be in English, not in Spanish. Maybe I am thinking wrong.

April 4, 2024 at 11:54 am #15482784

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+01:00)

We think it makes sense these to follow the profile language of the user, as that is the main purpose of translating labels in the backend.
https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/translating-acf-field-labels-with-wpml/

April 5, 2024 at 3:49 am #15486127

gustavG-2

Ok let me just get this right!

When my user, whose profile is set to English (image 1), visits a backend page in Swedish (image 2), they should see the title of the ACF block and the labels for the fields (all backend only) in English.

The user should only see the old ACF blocks in English, but if they add a new block to the page in Swedish, it should be in Swedish. This is because the page is in Swedish.

Is this incorrect?

IMG 1.png
IMG 2.png
April 9, 2024 at 1:10 pm #15499360

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+01:00)

Can you create a new ticket for this mixed languages issue? As that thing with blocks seems to be a different issue than reported here (as per our 2nd tier, given that this theme options issue was found to be caused when the values are stored in an acf-json folder).