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.

Tagged: 

This topic contains 12 replies, has 2 voices.

Last updated by Marcel 1 year, 6 months ago.

Assisted by: Marcel.

Author Posts
September 7, 2023 at 6:33 am #14356099

mariuszC-6

Hi,
I am translating a website from Polish to German. I have a problem with the translation because the changes made are not visible on the frontend, or scanning the child theme and the ACF PRO plugin does not include fields for translation (localizaton: wp-content/themes/wolmart-child/functions.php
wp-content/themes/wolmart-child/template-parts/product-time-counter.php). How can I solve this?

SITE URL: hidden link

Zrzut ekranu 2023-09-7 o 08.33.03.png
Zrzut ekranu 2023-09-7 o 08.26.20.png
Zrzut ekranu 2023-09-7 o 08.26.30.png
Zrzut ekranu 2023-09-7 o 08.26.57.png
Zrzut ekranu 2023-09-7 o 08.27.56.png
September 8, 2023 at 5:20 pm #14367939

Marcel
Supporter

Languages: English (English ) German (Deutsch )

Timezone: Europe/Madrid (GMT+02:00)

Hi,

can you please paste the code from wp-content/themes/wolmart-child/template-parts/product-time-counter.php). How can I solve this? to see Wolmart are using getText() calls to make the strings translateable?

Thank You!

Best Regards
Marcel

September 8, 2023 at 5:29 pm #14368063

mariuszC-6

Hi,

I can provide the necessary information or allow you to work on the site.

Code:
<?php
/**
*
* Template for time delivery box on product card
*
*/
?>
<?php

$time = get_field( 'godzina_do_ktorej_sa_odbierane_paczki', 'option' );

?>
<div class="delivery-time" data-time="<?= $time; ?>">
<input class="easterSunday" type="hidden" value="<?= the_field( 'data_niedzieli_wielkanocnej', 'option' ); ?>">
<input class="easterMonday" type="hidden" value="<?= the_field( 'data_poniedzialku_wielkanocnego', 'option' ); ?>">
<input class="pentecost" type="hidden" value="<?= the_field( 'data_zielonych_swiatek', 'option' ); ?>">
<input class="godHoly" type="hidden" value="<?= the_field( 'data_bozego_ciala', 'option' ); ?>">
<p>
Zamów w ciągu, <span class="delivery-countdown"></span> a paczkę wyślemy - <span class="weekday"></span><span
class="date-delivery"></span> (dotyczy zamówień opłaconych lub za pobraniem - więcej informacji)
</p>
</div>

<button id="open-popup" class="delivery-popup"><?php echo the_field( 'tekst_na_przycisku', 'option' ); ?></button>

<div id="popup">
<div class="form-popup-bg"></div>
<div class="table-delivery-methods">
<table>
<tr class="table-nav">
<th>Sposób wysyłki</th>
<th>Cena</th>
<th>Czas dostawy</th>
</tr>
<?php
wp_reset_postdata();
if ( have_rows( 'metody_wysylki', 'option' ) ):
while ( have_rows( 'metody_wysylki', 'option' ) ) : the_row(); ?>
<tr>
<td class="table-inside-value">
<p><?php echo the_sub_field( 'nazwa_metody_wysylki', 'option' ); ?></p></td>
<td class="table-inside-value">
<p><?php echo the_sub_field( 'cena_metody_wysylki', 'option' ); ?> zł</p></td>
<td class="table-inside-value"><p><?php echo the_sub_field( 'czas_dostawy', 'option' ); ?></p>
</td>
</tr>
<?php endwhile;
else :
endif;

?>
</table>
<button id="close-popup">×</button>
</div>
</div>

September 8, 2023 at 5:43 pm #14368089

Marcel
Supporter

Languages: English (English ) German (Deutsch )

Timezone: Europe/Madrid (GMT+02:00)

Hi,

not all code from your screenshot is incluuded to this template.

The issue here is that the content such as "więcej informacji" is not using getText() calls. You can make that translatable as described here: https://wpml.org/documentation/support/translating-the-theme-you-created/#wrapping-basic-strings.

More information about i18n you can find here: https://codex.wordpress.org/I18n_for_WordPress_Developers

Best Regards
marcel

September 8, 2023 at 5:48 pm #14368093

mariuszC-6

Alright. What about the phrases that WPML found, I added for translation, and translated, but they are still in Polish? For instance, "Uzupełnij NIP".

September 11, 2023 at 11:01 am #14375325

Marcel
Supporter

Languages: English (English ) German (Deutsch )

Timezone: Europe/Madrid (GMT+02:00)

Hi,

if the string was correctly registered and translatied, you too low WP_MEMORY_LIMIT could be the reason if the output is not viewable.

Add this code to your wp-config.php to increase WP memory:

define('WP_MEMORY_LIMIT', '256M'); 

Paste it just before: "That's all, stop editing! Happy blogging."

See here for more information https://wpml.org/home/minimum-requirements/
Note: WPML needs a minimum WP Memory limit of 128M to work only under a minimal environment, which means with a default theme and no other plugins installed. Right now, you have 2GB of PHP Memory available, but WP is not allowed to use more than 40MB.

Does it work afterwards?

Best Regards
Marcel

September 11, 2023 at 2:00 pm #14376977

mariuszC-6

Look at hidden link for memory limit.

September 11, 2023 at 2:13 pm #14377061

Marcel
Supporter

Languages: English (English ) German (Deutsch )

Timezone: Europe/Madrid (GMT+02:00)

Hi,

as mentioned before, you have 2GB of PHP memory available, but WP can only use 40MB of it. You need to increase the WP constant WP_MEMORY_LIMIT. This is not the same as the PHP memory_limit.

Once done, check on WPML -> Support if it worked. You can't check this via phpinfo() because it's a WP constant defined in wp-config.php.

Best Regards
Marcel

September 11, 2023 at 2:20 pm #14377085

mariuszC-6

Modification in .htaccess, wp-config, or php.ini doesn't work. Do you know how to fix it?

Zrzut ekranu 2023-09-11 o 16.18.41.png
September 11, 2023 at 2:25 pm #14377143

Marcel
Supporter

Languages: English (English ) German (Deutsch )

Timezone: Europe/Madrid (GMT+02:00)

Try it as described to add above line 86 in your wp-config.php (before ASPATH https://wordpress.stackexchange.com/questions/286072/wp-memory-limit-didnt-work-in-wp-config). If this is not working, you will need to get in touch with your hoster.

Best Regards
Marcel

September 11, 2023 at 2:40 pm #14377397
mariuszC-6

Ok, it works. However, the keywords "PI-NUTS - PRODUCENT NATURALNYCH WYROBÓW ORZECHOWYCH" and "Uzupełnij NIP" are either not visible for translation or have not been translated.

New threads created by Marcel and linked to this one are listed below:

https://wpml.org/forums/topic/removal-of-function-only-on-specific-language/

September 11, 2023 at 2:46 pm #14377473

Marcel
Supporter

Languages: English (English ) German (Deutsch )

Timezone: Europe/Madrid (GMT+02:00)

Hi,

which textdomain did you translate?

I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue. It would be better to a testing site where the issue is replicated.

You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.

Maybe I'll need to replicate your site locally. For this, I’ll need to temporarily install a plugin called “Duplicator” or "All in One WP Migration" on your site. This will allow me to create a copy of your site and your content. Once the problem is resolved I will delete the local site. Let me know if this is ok with you.

IMPORTANT
-Please make a backup of site files and database before providing us access.
-If you do not see the wp-admin/FTP fields this means your post & website login details will be made PUBLIC. DO NOT post your website details unless you see the required wp-admin/FTP fields. If you do not, please ask me to enable the private box. The private box looks like this:
hidden link

Best Regards
Marcel

September 13, 2023 at 3:50 pm #14391473

Marcel
Supporter

Languages: English (English ) German (Deutsch )

Timezone: Europe/Madrid (GMT+02:00)

Hi,

thanks for the access

#1
"producent naturalnych wyrobów orzechowych"
-> This is part of the WPBakery post meta content and not a string: hidden link.

It is not included in the WPML editor. It copied 1:1 the same output to the page builder content here: hidden link because the heading shortcode is encoded.

There are two ways to solve it:
- Deactivate the WPML editor for the Header and translate directly via WPBakery
- Decode the shortcode as described here. https://wpml.org/documentation/support/translating-urlencoded-shortcodes/.

#2
"Uzupełnij NIP"
-> You had the textdomain "WordPress" translated. I made an automatic string scan (https://wpml.org/documentation/getting-started-guide/string-translation/finding-strings-that-dont-appear-on-the-string-translation-page/#auto-register-strings-for-translation) and found another string in textdomain "default".

Translating this one solved it: hidden link. Same for the placeholder text: hidden link

Best Regards
Marcel