Home›Support›English Support›[Resolved] Issue with German language strings for the woocommerce subscription intervals on product page
[Resolved] Issue with German language strings for the woocommerce subscription intervals on product page
This thread is resolved. Here is a description of the problem and solution.
Problem: You are experiencing issues with the display of subscription intervals on your product detail page in a multilingual setup using WPML. The intervals are incorrectly displayed as 'alle Monat' instead of 'alle 2 Monate' and 'alle 3 Monate'. Solution: First, ensure that the string used in the frontend is not the one found in the WPML String Translation. The likely original strings could be 'every %s months' or 'every %1$s %2$s'. Use the text search field in WPML > String Translation to search for strings like '%1$s' and '%s', and verify their translations. If this does not resolve the issue, consider adjusting the custom field settings as we did for the test product, which now displays correctly. You may also need to update translations for all affected products and clear the Object Cache to see the changes. For the specific string 'alle Monat — spare 10%', since 'Monat' is the original string and WPML cannot alter original strings, you can modify the display string using the following filter:
If these steps do not clarify or resolve the issue, we recommend opening a new support ticket. Also, check related known issues at https://wpml.org/known-issues/, verify the version of the permanent fix, and confirm that you have installed the latest versions of themes and plugins. For further assistance, please visit our support forum at WPML Support Forum.
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.
Background of the issue:
I am trying to ensure that the subscription intervals for products on our website, which is translated using WPML, are displayed correctly.
The main language is German, and the secondary is English.
We offer subscriptions on products in German language only.
Recently, the subscription interval has not been displayed correctly on the product detail page.
See here: hidden link.
I created a test product, translated it using WPML, and created a subscription plan for the translation.
The screenshot shows that the interval is displayed correctly: hidden link.
For comparison, here is the product screenshot in German: hidden link.
I have checked the string translation but cannot find any errors. Nothing has changed here since the initial installation of Woo Subscriptions and All Products for Woo Subscriptions.
I also had a deeper look at the string translation again and found the following string on the live site: hidden link. Changing or deleting this string does not solve the issue.
Symptoms:
The subscription interval on the product detail page is not displayed correctly. It says 'alle Monat' but should be 'alle 2 Monate' and 'alle 3 Monate'.
Questions:
What could be causing the incorrect display of subscription intervals on the product page?
How can I resolve the issue with the string translation not affecting the subscription interval display?
It looks like the string you found on String Translation is not the one that is used in this section on the Frontend.
It is more likely that the original string looks similar to:
'every %s months'
or
'every %1$s %2$s'
The only thing that I can imagine in the moment is that one of the placeholders, like '%2' or "%1$s", is not translated correctly into German.
I would suggest you use the text search field on WPML > String Translation and search for strings like:
- %1$s
- %1$s
- %s
Then try to identify the matching original string and verify the translations.
If this does not clarify the cause of the issue, please let me know, and I will offer to take a closer look as admin. For this purpose, I will enable a private reply form upon my next reply, so that you can provide access in a secure way.
Hallo Andreas,
thank you for your hints.
I tried to change this sting "%1$s every %2$s" from "%1$s alle %2$s" to e.g. %1$s jeden %2$s.
That has no impact on the placeholder "%1$s" or "%2$s". hidden link
I can not find any options for "%1$s" or "%2$s".
I think it would be helpful, if you can have a closer look as admin.
I would like to offer to take a closer look and request temporary access (wp-admin and FTP) to the website to investigate the issue further.
You can find the required fields below the comments section when you log in to leave the next reply. The information you provide is private, meaning only you and I can see and access it.
IMPORTANT
Please be sure to back up your website and database before granting us access.
If you can't see the "wp-admin / FTP" fields, your post and website login credentials will be set to "PUBLIC." DO NOT publish the data unless you see the required wp-admin / FTP fields.
I may need to install a plugin called "All In One WP Migration" to create a copy of the website so I can investigate the issue further.
However, I would also be very grateful if you could provide a staging site or a copy of the website from your server for this purpose.
If you have any questions about creating such a staging site, you can consult your hosting provider. Please note that WPML must also be registered on this staging site at https://wpml.org/account/websites/.
If you are unable to provide such a copy of the website for testing, please let me know on this ticket.
The private reply form looks like this: hidden link
Click "I still need assistance" the next time you reply.
Video: hidden link
Please note that we are required to request this information individually on each ticket. We are not permitted to access any credentials that were not specifically submitted on this ticket using the private response form.
I have found a string named "Monat" which by default is assigned to the English source language. You need to switch the source language for this string to German and then translate it.
Ragarding your message #17329750 I can not find the tring "Monat" assigned to source language English.
It seems to be translated correctly (see screenshot).
I think, there is also a problem with the plural of the word "month" and the number of the subscription range is missing.
In English language it shows "every 2 month", in German language it shows "alle Monat", but it should be "alle 2 Monate".
You can find a test product saved as draft called "Test Abo Produkt". The plan is translated manually to English. Here you can see that it works in English correctly but not in German.
I did another search for the string "monat" without selecting "exact match" and found the following (see screenshots). I'm not sure where this comes from.
Thank you for adjusting the custom field, but it was working fine in the English version before the change.
I tried to change the string with your codes snipped but that did not work.
The issue is not only the plural of the word Monat > Monate but also the number of the intervall is missing.
The string we need to focus on is "every 2 months". "save 10%" is another string. If you have a look at the source code, you can see this is seperated in span tags with differen classes.
As I mentioned earlier, the only relevant string I can find is this: %1$s every %2$s
The translation is this: %1$s alle %2$s
This shows on the English version "every 2 month" and on the German versin "alle Monat".
If I change %1$s alle %2$s to %1$s jeden %2$s the German frontend changes to "jeden Monat".
So I think we need to focus on this: %2$s
Not sure what this is related to: %1$s
As we offer subscriptions with 2 and 3 month intervall the placeholder %1$s should change "2 Monate" or "3 Monate".
While writing this, I repeatedly searched for different strings and tried to check my implementation. In doing so, I found the already translated string “%s months”. I deleted the translation here and regenerated it. This solved the problem.
It was a minor issue that had been bothering me for a long time.
Thank you very much for your support!