Sage 10.x Localization strings with WPML

Hi,
in my file /resources/views/partials/related-events.blade.php i wrote this code

<h4 class="my-5">{{_e('Potrebbero interessarti anche', 'my-theme')}}</h4>

Follow this guide Sage 10.x: Localization | Roots Documentation i installed gettext in WSL, i run yarn pot, i opened sage.pot with POedit, translate “Potrebbero interessarti anche” in “Related events”

add this code in app/setup.php

add_action('after_setup_theme', function () {
    load_theme_textdomain('my-theme', get_template_directory() . '/lang');
});

Uploaded all files and folder but i still view only the source string non the translated version.

I use WPML with string translation.
Where am i wrong?

The POT file is only a template (T stands for template), you have to save a PO file and then save/compile that to a MO file, which is actually used by WordPress/PHP.
Also ensure you have the correct locale set up to be used by the site, and that the MO (and therefore also the source PO file) have the proper locale in the filename.
For example, for German formal translation I would have two files in the resources/lang/ directory, de_DE_formal.po and de_DE_formal.mo.

WPML should support native WordPress translation and only override string translations for those strings also added in the WMPL plugin: Using PO/MO files instead of String Translation - WPML

In case anyone else stumbles upon this.
WPML doesn’t compile the blade syntax properly, so you’ll have to use default php code.
In this case for example:

<h4 class="my-5"><?php echo _e('Potrebbero interessarti anche', 'my-theme') ?></h4>

Hope this helps.

The WP i18n CLI command natively supports Blade-PHP templates by the way, and it can generate a POT file from Blade-PHP/PHP/JSON-files.

Yes, but the String Translation functionality for “Localization of themes and plugins” won’t recognize it when using blade syntax.

I am not using WPML, but it appears as it can import PO-files (that can be generated WP i18n CLI from Blade-PHP files):